Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Preflow Class Template Reference
[Path and Flow Algorithms]

#include <lemon/preflow.h>

List of all members.


Detailed Description

template<typename Graph, typename Num, typename CapacityMap = typename Graph::template EdgeMap<Num>, typename FlowMap = typename Graph::template EdgeMap<Num>>
class lemon::Preflow< Graph, Num, CapacityMap, FlowMap >

This class provides an implementation of the preflow algorithm producing a flow of maximum value in a directed graph. The preflow algorithms are the fastest known max flow algorithms up to now. The source node, the target node, the capacity of the edges and the starting flow value of the edges should be passed to the algorithm through the constructor. It is possible to change these quantities using the functions source, target, capacityMap and flowMap.

After running phase1() or run(), the maximal flow value can be obtained by calling flowValue(). The minimum value cut can be written into a bool node map by calling minCut(). (minMinCut() and maxMinCut() writes the inclusionwise minimum and maximum of the minimum value cuts, resp.)

Parameters:
Graph The directed graph type the algorithm runs on.
Num The number type of the capacities and the flow values.
CapacityMap The capacity map type.
FlowMap The flow map type.
Author:
Jacint Szabo
Todo:
Second template parameter is superfluous


Public Types

enum  FlowEnum
 Indicates the property of the starting flow map. More...
enum  StatusEnum
 Indicates the state of the preflow algorithm. More...

Public Member Functions

 Preflow (const Graph &_gr, Node _s, Node _t, const CapacityMap &_cap, FlowMap &_f)
 The constructor of the class.
void run ()
 Runs the preflow algorithm.
void run (FlowEnum fp)
 Runs the preflow algorithm.
void phase1 (FlowEnum fp)
 Runs the first phase of the preflow algorithm.
void phase1 ()
 Runs the first phase of the preflow algorithm.
void phase2 ()
 Runs the second phase of the preflow algorithm.
Num flowValue () const
 Returns the value of the maximum flow.
template<typename _CutMap>
void minCut (_CutMap &M) const
 Returns a minimum value cut.
template<typename _CutMap>
void minMinCut (_CutMap &M) const
 Returns the inclusionwise minimum of the minimum value cuts.
template<typename _CutMap>
void maxMinCut (_CutMap &M) const
 Returns the inclusionwise maximum of the minimum value cuts.
void source (Node _s)
 Sets the source node to _s.
Node source () const
 Returns the source node.
void target (Node _t)
 Sets the target node to _t.
Node target () const
 Returns the target node.
void capacityMap (const CapacityMap &_cap)
 Sets the edge map of the capacities to _cap.
const CapacityMap & capacityMap () const
 Returns a reference to capacity map.
void flowMap (FlowMap &_f)
 Sets the edge map of the flows to _flow.
const FlowMap & flowMap () const
 Returns a reference to flow map.


The documentation for this class was generated from the following file:
Generated on Sat Aug 27 14:16:08 2005 for LEMON by  doxygen 1.4.4