9. Hyperflow Model

The hyperflow model on derivation graphs accessible through mod::flow::Flow (C++) and mod.Flow (Python) consists of many different variables and constraints. This page is not meant to fully describe the model but to describe how the variables are available in the C++ and Python interface.

9.1. Variable Specifiers

The following information is common for both the C++ and Python interface. Though, in Python the specifiers are defined in module scope, while in C++ they are defined in the namespace mod::flow::vars. Thus, it may be useful to use the using-declaration using namespace mod::flow::vars; when defining linear expressions/constraints in C++.

Each defined specifier represents a sum of variables, and indexing the specifier retrieves a specifier for a single variable (or a sum of a subset of the variables) as indicated by the argument. E.g., inFlow represents the sum \(\sum_{v\in V}x^-_v\) while inFlow[x] retrieves the specifier for \(x^-_v\) where x is either the vertex \(v\) or a graph associated with that vertex in the underlying derivation graph \(\mathcal{H} = (V, E)\). In the table below, the “Type” column refers to the types flow::VarSumVertex/FlowVarSumVertex or flow::VarSumEdge/FlowVarSumEdge.

Specifier

Type

Extension

Description

inFlow

Vertex

Base

The input flow variables, \(x^-_v\).

outFlow

Vertex

Base

The output flow variables, \(x^+_v\).

isInUsed

Vertex

Base

Indicator variables for \(x^-_v > 0\).

isOutUsed

Vertex

Base

Indicator variables for \(x^+_v > 0\).

isInLessOut

Vertex

Base

Indicator variables for \(x^-_v < x^+_v\).

isInGreaterOut

Vertex

Base

Indicator variables for \(x^-_v > x^+_v\).

isInOutZero

Vertex

Base

Indicator variables for \(x^-_v = x^+_v = 0\).

vertex

Vertex

Base

Variables for flow through each vertex, \(\sum_{v\in V}\sum_{e\in \delta^-(v)} x_e\). The indexed variable specifier retrieves the inner sum for some \(v\).

isVertexUsed

Vertex

Base

Indicator variables for \(\sum_{e\in \delta^-(v)} x_e\).

transitInternal

Vertex

Base

Variables for flow through each vertex, which enters and exits the vertex from/to the networks. That is, excluding the flow that is covered by inFlow and that covered by outFlow. Note, the indexed specifier can only be used if the separation of the transit flow is possible in the underlying expanded derivation graph. The non-indexed specifier can only be used if all indexed specifiers exist. The necessary network expansion can be triggered by disabling IO flow reversal (flow::Flow::setAllowIOReversal()/Flow.allowIOReversal), or by explicitly calling flow::Flow::separateIOInternalTransit()/Flow.separateIOInternalTransit() to make the variable available for the relevant vertices.

isOverallAutocata

Vertex

Overall autocatalysis

Indicator variables for overall autocatalysis.

isOverallCata

Vertex

Overall catalysis

Indicator variables for overall catalysis.

edge

Edge

Base

The edge flow variables, \(x_e\), without the input/output edges.

isEdgeUsed

Edge

Base

Indicator variables for \(x_e > 0\) for the non-input/output edges.

isBothReverseUsed

Edge

Base

For each unique unordered pair of edges (not input/output) \(e_a = (S_a, T_a), e_b = (T_a, S_a)\) there is an indicator variable indicating \(x_{e_a} > 0 \wedge x_{e_b} > 0\). The indexed specifier can only be retrieved if the given dg::DG::HyperEdge/DGHyperEdge actually has an inverse. Two edges being each others inverse maps to the same indexed indicator variable.

9.2. Objective Function

The objective function is always minimised and can be changed to any linear expression. The default objective function is determined by the enabled extensions. Each extension will add some linear expression to the objective function if it is enabled.

Extension

Added Linear Expression

Base

edge \(+\) inFlow

Transit

\(0\)

Overall Autocatalysis

isOverallAutocata

Overall Catalysis

isOverallCata