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 |
---|---|---|---|
|
Vertex |
Base |
The input flow variables, \(x^-_v\). |
|
Vertex |
Base |
The output flow variables, \(x^+_v\). |
|
Vertex |
Base |
Indicator variables for \(x^-_v > 0\). |
|
Vertex |
Base |
Indicator variables for \(x^+_v > 0\). |
|
Vertex |
Base |
Indicator variables for \(x^-_v < x^+_v\). |
|
Vertex |
Base |
Indicator variables for \(x^-_v > x^+_v\). |
|
Vertex |
Base |
Indicator variables for \(x^-_v = x^+_v = 0\). |
|
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\). |
|
Vertex |
Base |
Indicator variables for \(\sum_{e\in \delta^-(v)} x_e\). |
|
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 |
|
Vertex |
Overall autocatalysis |
Indicator variables for overall autocatalysis. |
|
Vertex |
Overall catalysis |
Indicator variables for overall catalysis. |
|
Edge |
Base |
The edge flow variables, \(x_e\), without the input/output edges. |
|
Edge |
Base |
Indicator variables for \(x_e > 0\) for the non-input/output edges. |
|
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
|
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 |
|
Transit |
\(0\) |
Overall Autocatalysis |
|
Overall Catalysis |
|