ResGraphAdaptor< Graph, Number, CapacityMap, FlowMap, Tol > Class Template Reference
[Adaptor Classes for Graphs]


Detailed Description

template<typename Graph, typename Number, typename CapacityMap, typename FlowMap, typename Tol = Tolerance<Number>>
class lemon::ResGraphAdaptor< Graph, Number, CapacityMap, FlowMap, Tol >

An adaptor for composing the residual graph for directed flow and circulation problems. Let $ G=(V, A) $ be a directed graph and let $ F $ be a number type. Let moreover $ f,c:A\to F $, be functions on the edge-set.

In the appications of ResGraphAdaptor, $ f $ usually stands for a flow and $ c $ for a capacity function. Suppose that a graph instange g of type ListGraph implements $ G $.

       ListGraph g;

Then ResGraphAdaptor implements the graph structure with node-set $ V $ and edge-set $ A_{forward}\cup A_{backward} $, where $ A_{forward}=\{uv : uv\in A, f(uv)<c(uv)\} $ and $ A_{backward}=\{vu : uv\in A, f(uv)>0\} $, i.e. the so called residual graph. When we take the union $ A_{forward}\cup A_{backward} $, multilicities are counted, i.e. if an edge is in both $ A_{forward} $ and $ A_{backward} $, then in the adaptor it appears twice. The following code shows how such an instance can be constructed.

       typedef ListGraph Graph; 
       Graph::EdgeMap<int> f(g);
       Graph::EdgeMap<int> c(g); 
       ResGraphAdaptor<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > ga(g); 
Author:
Marton Makai
#include <lemon/graph_adaptor.h>

Inheritance diagram for ResGraphAdaptor< Graph, Number, CapacityMap, FlowMap, Tol >:

Inheritance graph
[legend]

List of all members.

Classes

class  ResCap
 Residual capacity map. More...

Public Member Functions

 ResGraphAdaptor (const Graph &_graph, const CapacityMap &_capacity, FlowMap &_flow, const Tol &_tolerance=Tol())
 Constructor of the residual graph.
Number rescap (const Edge &edge) const
void augment (const Edge &e, Number a) const
 Augment on the given edge in the residual graph.

Static Public Member Functions

static bool forward (const Edge &e)
 Returns the direction of the edge.
static bool backward (const Edge &e)
 Returns the direction of the edge.
static Edge forward (const typename Graph::Edge &e)
static Edge backward (const typename Graph::Edge &e)


Constructor & Destructor Documentation

ResGraphAdaptor ( const Graph &  _graph,
const CapacityMap &  _capacity,
FlowMap &  _flow,
const Tol &  _tolerance = Tol() 
) [inline]

Constructor of the residual graph. The parameters are the graph type, the flow map, the capacity map and a tolerance object.


Member Function Documentation

Number rescap ( const Edge &  edge  )  const [inline]

Gives back the residual capacity of the edge.

void augment ( const Edge &  e,
Number  a 
) const [inline]

Augment on the given edge in the residual graph. It increase or decrease the flow on the original edge depend on the direction of the residual edge.

static bool forward ( const Edge &  e  )  [inline, static]

Returns true when the edge is same oriented as the original edge.

static bool backward ( const Edge &  e  )  [inline, static]

Returns true when the edge is opposite oriented as the original edge.

static Edge forward ( const typename Graph::Edge &  e  )  [inline, static]

Gives back the forward oriented residual edge.

static Edge backward ( const typename Graph::Edge &  e  )  [inline, static]

Gives back the backward oriented residual edge.


Generated on Thu Jun 4 04:04:21 2009 for LEMON by  doxygen 1.5.9