Satsuma
a delicious .NET graph library
|
Finds a minimum cost feasible circulation using the network simplex method. More...
Public Member Functions | |
void | Clear () |
Reverts the solver to its initial state. More... | |
long | Flow (Arc arc) |
Returns the amount currently circulating on an arc. More... | |
NetworkSimplex (IGraph graph, Func< Arc, long > lowerBound=null, Func< Arc, long > upperBound=null, Func< Node, long > supply=null, Func< Arc, double > cost=null) | |
Hint: use named arguments when calling this constructor. More... | |
void | Run () |
Runs the algorithm until the problem is found to be infeasible, an optimal solution is found, or the objective is found to be unbounded. More... | |
void | Step () |
Performs an iteration in the simplex algorithm. More... | |
Properties | |
Func< Arc, double > | Cost [get, set] |
The cost of sending a unit of circulation through an arc. More... | |
IEnumerable< KeyValuePair< Arc, long > > | Forest [get] |
Returns those arcs which belong to the basic forest. More... | |
IGraph | Graph [get, set] |
Func< Arc, long > | LowerBound [get, set] |
The lower bound for the circulation. More... | |
SimplexState | State [get, set] |
The current execution state of the simplex algorithm. More... | |
Func< Node, long > | Supply [get, set] |
The desired difference of outgoing and incoming flow for a node. More... | |
Func< Arc, long > | UpperBound [get, set] |
The upper bound for the circulation. More... | |
IEnumerable< Arc > | UpperBoundArcs [get] |
Returns those arcs which are saturated (the flow equals to the upper bound), but are not in the basic forest. More... | |
Finds a minimum cost feasible circulation using the network simplex method.
Lower/upper bounds and supply must be integral, but cost can be double. Edges are treated as directed arcs, but this is not a real restriction if, for all edges, lower bound + upper bound = 0.
Definition at line 50 of file NetworkSimplex.cs.
Satsuma.NetworkSimplex.NetworkSimplex | ( | IGraph | graph, |
Func< Arc, long > | lowerBound = null , |
||
Func< Arc, long > | upperBound = null , |
||
Func< Node, long > | supply = null , |
||
Func< Arc, double > | cost = null |
||
) |
Hint: use named arguments when calling this constructor.
Definition at line 94 of file NetworkSimplex.cs.
void Satsuma.NetworkSimplex.Clear | ( | ) |
Reverts the solver to its initial state.
Implements Satsuma.IClearable.
Definition at line 139 of file NetworkSimplex.cs.
long Satsuma.NetworkSimplex.Flow | ( | Arc | arc | ) |
Returns the amount currently circulating on an arc.
Definition at line 116 of file NetworkSimplex.cs.
void Satsuma.NetworkSimplex.Run | ( | ) |
Runs the algorithm until the problem is found to be infeasible, an optimal solution is found, or the objective is found to be unbounded.
Definition at line 371 of file NetworkSimplex.cs.
void Satsuma.NetworkSimplex.Step | ( | ) |
Performs an iteration in the simplex algorithm.
Modifies the State field according to what happened.
Definition at line 251 of file NetworkSimplex.cs.
|
getset |
The cost of sending a unit of circulation through an arc.
Must be finite. If null
is supplied in the constructor, then the constant 1.0
function is taken.
Definition at line 68 of file NetworkSimplex.cs.
|
get |
Returns those arcs which belong to the basic forest.
Definition at line 127 of file NetworkSimplex.cs.
|
getset |
Definition at line 52 of file NetworkSimplex.cs.
|
getset |
The lower bound for the circulation.
long.MinValue
means negative infinity (unbounded). If null
is supplied in the constructor, then the constant 0
function is taken.
Definition at line 56 of file NetworkSimplex.cs.
|
getset |
The current execution state of the simplex algorithm.
Definition at line 91 of file NetworkSimplex.cs.
|
getset |
The desired difference of outgoing and incoming flow for a node.
Must be finite. The sum must be zero for each graph component. If null
is supplied in the constructor, then the constant 0
function is taken.
Definition at line 65 of file NetworkSimplex.cs.
|
getset |
The upper bound for the circulation.
Must be greater or equal to the lower bound. long.MaxValue
means positive infinity (unbounded). If null
is supplied in the constructor, then the constant long.MaxValue
function is taken.
Definition at line 61 of file NetworkSimplex.cs.
|
get |
Returns those arcs which are saturated (the flow equals to the upper bound), but are not in the basic forest.
Definition at line 136 of file NetworkSimplex.cs.