11. 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.

11.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

Module

Description

inFlow

Vertex

Base

The input flow variables, \(x^-_v\). When listing a solution the column header for this variable is In.

outFlow

Vertex

Base

The output flow variables, \(x^+_v\). When listing a solution the column header for this variable is Out.

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 network. 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.

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.

isOverallCata

Vertex

OverallCatalysis

Indicator variables for overall catalysis. When listing a solution the column header for this variable is OC.

isOverallAutocata

Vertex

OverallAutocatalysis

Indicator variables for overall autocatalysis. When listing a solution the column header for this variable is OA.

energy

Vertex

Thermodynamics

Variables for the free energy of each molecule/vertex. When listing a solution the column header for this variable is G.

logConcentration

Vertex

Thermodynamics

Variables for the logarithm of the concentration for each molecule/vertex. Note that the concentration it self does not appear in the model, only these variables. When listing a solution the column header for this variable is logK.

deltaEnergy

Edge

Thermodynamics

The thermodynamic energy difference for each reaction/hyperedge.

11.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 modules. Each module will add some linear expression to the objective function if it is enabled. If the objective function is explicitly specified by the user, it is not modified by the modules.

Extension

Added Linear Expression

Base

edge \(+\) inFlow

OverallAutocatalysis

isOverallAutocata

OverallCatalysis

isOverallCata

Thermodynamics

\(0\)