#include <lemon/circulation.h>
Classes | |
struct | DefElevator |
struct | DefFlowMap |
struct | DefStandardElevator |
Named parameter for setting Elevator type More... | |
Public Member Functions | |
Circulation (const Graph &g, const LCapMap &lo, const UCapMap &up, const DeltaMap &delta) | |
The constructor of the class. | |
~Circulation () | |
Destrcutor. | |
Circulation & | lowerCapMap (const LCapMap &map) |
Sets the lower bound capacity map. | |
Circulation & | upperCapMap (const LCapMap &map) |
Sets the upper bound capacity map. | |
Circulation & | deltaMap (const DeltaMap &map) |
Sets the lower bound map on excess. | |
Circulation & | flowMap (FlowMap &map) |
Sets the flow map. | |
const FlowMap & | flowMap () |
Returns the flow map. | |
Circulation & | elevator (Elevator &elevator) |
Sets the elevator. | |
const Elevator & | elevator () |
Returns the elevator. | |
Circulation & | tolerance (const Tolerance &tolerance) const |
const Tolerance & | tolerance () const |
Execution control | |
void | init () |
Initializes the internal data structures. | |
void | greedyInit () |
Initializes the internal data structures. | |
bool | start () |
Starts the algorithm. | |
bool | run () |
Runs the circulation algorithm. | |
Query Functions | |
template<class GT > | |
void | barrierMap (GT &bar) |
Returns a barrier. | |
bool | barrier (const Node &node) |
Returns true if the node is in the barrier. | |
Value | flow (const Edge &edge) const |
Returns the flow on the edge. | |
Checker Functions | |
bool | checkFlow () |
Check if the flow is a feasible circulation. | |
bool | checkBarrier () |
Check whether or not the last execution provides a barrier. |
Circulation | ( | const Graph & | g, | |
const LCapMap & | lo, | |||
const UCapMap & | up, | |||
const DeltaMap & | delta | |||
) | [inline] |
The constructor of the class.
g | The directed graph the algorithm runs on. | |
lo | The lower bound capacity of the edges. | |
up | The upper bound capacity of the edges. | |
delta | The lower bound on node excess. |
Circulation& lowerCapMap | ( | const LCapMap & | map | ) | [inline] |
Sets the lower bound capacity map.
(*this) Circulation& upperCapMap | ( | const LCapMap & | map | ) | [inline] |
Sets the upper bound capacity map.
(*this) Circulation& deltaMap | ( | const DeltaMap & | map | ) | [inline] |
Sets the lower bound map on excess.
(*this) Circulation& flowMap | ( | FlowMap & | map | ) | [inline] |
Sets the flow map.
(*this) const FlowMap& flowMap | ( | ) | [inline] |
Circulation& elevator | ( | Elevator & | elevator | ) | [inline] |
Sets the elevator.
(*this) const Elevator& elevator | ( | ) | [inline] |
Circulation& tolerance | ( | const Tolerance & | tolerance | ) | const [inline] |
Sets the tolerance used by algorithm.
const Tolerance& tolerance | ( | ) | const [inline] |
Returns the tolerance used by algorithm.
void init | ( | ) | [inline] |
Initializes the internal data structures. This function sets all flow values to the lower bound.
void greedyInit | ( | ) | [inline] |
Initializes the internal data structures. This functions uses greedy approach to construct the initial solution.
bool start | ( | ) | [inline] |
This function starts the algorithm.
bool run | ( | ) | [inline] |
Runs the circulation algorithm.
fc.greedyInit();
return fc.start();
void barrierMap | ( | GT & | bar | ) | [inline] |
Barrier is a set B of nodes for which
holds. The existence of a set with this property prooves that a feasible flow cannot exists.
bool barrier | ( | const Node & | node | ) | [inline] |
Returns true if the node is in the barrier
Value flow | ( | const Edge & | edge | ) | const [inline] |
Sets the flowMap
to the flow on the edges. This method can be called after the second phase of algorithm.
bool checkBarrier | ( | ) | [inline] |
Check whether or not the last execution provides a barrier