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

Suurballe Class Template Reference
[Path and Flow Algorithms]

#include <lemon/suurballe.h>

Collaboration diagram for Suurballe:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename Graph, typename LengthMap>
class lemon::Suurballe< Graph, LengthMap >

The class lemon::Suurballe implements an algorithm for finding k edge-disjoint paths from a given source node to a given target node in an edge-weighted directed graph having minimal total weight (length).

Warning:
Length values should be nonnegative.
Parameters:
Graph The directed graph type the algorithm runs on.
LengthMap The type of the length map (values should be nonnegative).
Note:
It it questionable whether it is correct to call this method after Suurballe for it is just a special case of Edmonds' and Karp's algorithm for finding minimum cost flows. In fact, this implementation just wraps the MinCostFlow algorithms. The paper of both Suurballe and Edmonds-Karp published in 1972, therefore it is possibly right to state that they are independent results. Most frequently this special case is referred as Suurballe method in the literature, especially in communication network context.
Author:
Attila Bernath

Definition at line 58 of file suurballe.h.

Public Member Functions

 Suurballe (Graph &_G, LengthMap &_length, Node _s, Node _t)
 The constructor of the class.
int run (int k)
 Runs the algorithm.
Length totalLength ()
 This function gives back the total length of the found paths.
const EdgeIntMap & getFlow () const
 Returns the found flow.This function returns a const reference to the EdgeMap flow.
const EdgeIntMap & getPotential () const
 Returns the optimal dual solution.
bool checkComplementarySlackness ()
 Checks whether the complementary slackness holds.
template<typename Path>
void getPath (Path &p, size_t j)
 Read the found paths.


Constructor & Destructor Documentation

Suurballe Graph &  _G,
LengthMap &  _length,
Node  _s,
Node  _t
[inline]
 

Parameters:
_G The directed graph the algorithm runs on.
_length The length (weight or cost) of the edges.
_s Source node.
_t Target node.

Definition at line 95 of file suurballe.h.


Member Function Documentation

int run int  k  )  [inline]
 

Runs the algorithm. Returns k if there are at least k edge-disjoint paths from s to t. Otherwise it returns the number of edge-disjoint paths found from s to t.

Parameters:
k How many paths are we looking for?

Definition at line 108 of file suurballe.h.

Here is the call graph for this function:

const EdgeIntMap& getPotential  )  const [inline]
 

This function returns a const reference to the NodeMap potential (the dual solution).

Definition at line 163 of file suurballe.h.

bool checkComplementarySlackness  )  [inline]
 

This function checks, whether the given solution is optimal. Currently this function only checks optimality, doesn't bother with feasibility It is meant for testing purposes.

Definition at line 171 of file suurballe.h.

Here is the call graph for this function:

void getPath Path &  p,
size_t  j
[inline]
 

This function gives back the j-th path in argument p. Assumes that run() has been run and nothing changed since then.

Warning:
It is assumed that p is constructed to be a path of graph G. If j is not less than the result of previous run, then the result here will be an empty path (j can be 0 as well).
Parameters:
Path The type of the path structure to put the result to (must meet lemon path concept).
p The path to put the result to
j Which path you want to get from the found paths (in a real application you would get the found paths iteratively)

Definition at line 188 of file suurballe.h.


The documentation for this class was generated from the following file:
Generated on Sat Mar 19 10:58:55 2005 for LEMON by  doxygen 1.4.1