Computes a min-cost flow using a network simplex method. More...
#include <ogdf/graphalg/MinCostFlowReinelt.h>
Classes | |
struct | arctype |
struct | nodetype |
Public Member Functions | |
MinCostFlowReinelt () | |
virtual bool | call (const Graph &G, const EdgeArray< int > &lowerBound, const EdgeArray< int > &upperBound, const EdgeArray< TCost > &cost, const NodeArray< int > &supply, EdgeArray< int > &flow, NodeArray< TCost > &dual) override |
Computes a min-cost flow in the directed graph G using a network simplex method. More... | |
int | infinity () const |
Public Member Functions inherited from ogdf::MinCostFlowModule< TCost > | |
MinCostFlowModule () | |
Initializes a min-cost flow module. More... | |
virtual | ~MinCostFlowModule () |
virtual bool | call (const Graph &G, const EdgeArray< int > &lowerBound, const EdgeArray< int > &upperBound, const EdgeArray< TCost > &cost, const NodeArray< int > &supply, EdgeArray< int > &flow) |
Computes a min-cost flow in the directed graph G . More... | |
Private Member Functions | |
void | beacircle (arctype **eplus, arctype **pre, bool *from_ub) |
void | beadouble (arctype **eplus, arctype **pre, bool *from_ub) |
int | mcf (int mcfNrNodes, int mcfNrArcs, Array< int > &mcfSupply, Array< int > &mcfTail, Array< int > &mcfHead, Array< int > &mcfLb, Array< int > &mcfUb, Array< TCost > &mcfCost, Array< int > &mcfFlow, Array< TCost > &mcfDual, TCost *mcfObj) |
void | start (Array< int > &supply) |
Private Attributes | |
Array< arctype > | arcs |
arctype * | last_n1 = nullptr |
arctype * | last_n2 = nullptr |
EpsilonTest | m_eps |
TCost | m_maxCost = std::numeric_limits<TCost>::lowest() |
int | mm = 0 |
int | nn = 0 |
Array< nodetype > | nodes |
nodetype * | root = nullptr |
nodetype | rootStruct |
arctype * | searchend = nullptr |
arctype * | searchend_n1 = nullptr |
arctype * | searchend_n2 = nullptr |
arctype * | start_arc = nullptr |
arctype * | start_b = nullptr |
arctype * | start_n1 = nullptr |
arctype * | start_n2 = nullptr |
arctype * | startsearch = nullptr |
Additional Inherited Members | |
Static Public Member Functions inherited from ogdf::MinCostFlowModule< TCost > | |
static bool | checkComputedFlow (const Graph &G, const EdgeArray< int > &lowerBound, const EdgeArray< int > &upperBound, const EdgeArray< TCost > &cost, const NodeArray< int > &supply, const EdgeArray< int > &flow) |
checks if a computed flow is a feasible solution to the given problem instance. More... | |
static bool | checkComputedFlow (const Graph &G, const EdgeArray< int > &lowerBound, const EdgeArray< int > &upperBound, const EdgeArray< TCost > &cost, const NodeArray< int > &supply, const EdgeArray< int > &flow, TCost &value) |
checks if a computed flow is a feasible solution to the given problem instance. More... | |
static bool | checkProblem (const Graph &G, const EdgeArray< int > &lowerBound, const EdgeArray< int > &upperBound, const NodeArray< int > &supply) |
Checks if a given min-cost flow problem instance satisfies the preconditions. More... | |
static void | generateProblem (Graph &G, int n, int m, EdgeArray< int > &lowerBound, EdgeArray< int > &upperBound, EdgeArray< TCost > &cost, NodeArray< int > &supply) |
Generates an instance of a min-cost flow problem with n nodes and m + n edges. More... | |
Computes a min-cost flow using a network simplex method.
Definition at line 52 of file MinCostFlowReinelt.h.
|
inline |
Definition at line 54 of file MinCostFlowReinelt.h.
|
private |
Definition at line 304 of file MinCostFlowReinelt.h.
|
private |
Definition at line 417 of file MinCostFlowReinelt.h.
|
overridevirtual |
Computes a min-cost flow in the directed graph G
using a network simplex method.
G
must be connected, lowerBound
[e] <= upperBound
[e] for all edges e, and the sum over all supplies must be zero.G | is the directed input graph. |
lowerBound | gives the lower bound for the flow on each edge. |
upperBound | gives the upper bound for the flow on each edge. |
cost | gives the costs for each edge. |
supply | gives the supply (or demand if negative) of each node. |
flow | is assigned the computed flow on each edge. |
dual | is assigned the computed dual variables. |
Implements ogdf::MinCostFlowModule< TCost >.
Definition at line 154 of file MinCostFlowReinelt.h.
|
inline |
Definition at line 81 of file MinCostFlowReinelt.h.
|
private |
->basis leaving arc
Definition at line 583 of file MinCostFlowReinelt.h.
|
private |
Definition at line 251 of file MinCostFlowReinelt.h.
|
private |
Definition at line 121 of file MinCostFlowReinelt.h.
|
private |
Definition at line 127 of file MinCostFlowReinelt.h.
|
private |
Definition at line 128 of file MinCostFlowReinelt.h.
|
private |
Definition at line 118 of file MinCostFlowReinelt.h.
|
private |
Definition at line 139 of file MinCostFlowReinelt.h.
|
private |
Definition at line 142 of file MinCostFlowReinelt.h.
|
private |
Definition at line 141 of file MinCostFlowReinelt.h.
|
private |
Definition at line 120 of file MinCostFlowReinelt.h.
|
private |
Definition at line 124 of file MinCostFlowReinelt.h.
|
private |
Definition at line 125 of file MinCostFlowReinelt.h.
|
private |
Definition at line 134 of file MinCostFlowReinelt.h.
|
private |
Definition at line 135 of file MinCostFlowReinelt.h.
|
private |
Definition at line 136 of file MinCostFlowReinelt.h.
|
private |
Definition at line 129 of file MinCostFlowReinelt.h.
|
private |
Definition at line 130 of file MinCostFlowReinelt.h.
|
private |
Definition at line 131 of file MinCostFlowReinelt.h.
|
private |
Definition at line 132 of file MinCostFlowReinelt.h.
|
private |
Definition at line 133 of file MinCostFlowReinelt.h.