Protected Member Functions | Protected Attributes

MultiCommodityFlow Class Reference

Multi-commodity flow calculating base class. More...

#include <mcf.h>

Inheritance diagram for MultiCommodityFlow:
MCF1stPass MCF2ndPass

Protected Member Functions

 MultiCommodityFlow (LinkGraphJob *job)
template<class Tannotation , class Tedge_iterator >
void Dijkstra (NodeID from, PathVector &paths)
 A slightly modified Dijkstra algorithm.
uint PushFlow (EdgeAnnotation &edge, Path *path, uint accuracy, uint max_saturation)
 Push flow along a path and update the unsatisfied_demand of the associated edge.
void CleanupPaths (NodeID source, PathVector &paths)
 Clean up paths that lead nowhere and the root path.

Protected Attributes

LinkGraphJobjob
 Job we're working with.
LinkGraphgraph
 Component we're working with.
uint max_saturation
 Maximum saturation for edges.

Detailed Description

Multi-commodity flow calculating base class.

Definition at line 61 of file mcf.h.


Member Function Documentation

void MultiCommodityFlow::CleanupPaths ( NodeID  source_id,
PathVector &  paths 
) [protected]

Clean up paths that lead nowhere and the root path.

Parameters:
source_id ID of the root node.
paths Paths to be cleaned up.

Definition at line 222 of file mcf.cpp.

References Path::Detach(), Path::GetFlow(), Path::GetNode(), Path::GetNumChildren(), and Path::GetParent().

Referenced by MCF1stPass::MCF1stPass(), and MCF2ndPass::MCF2ndPass().

template<class Tannotation , class Tedge_iterator >
void MultiCommodityFlow::Dijkstra ( NodeID  source_node,
PathVector &  paths 
) [protected]

A slightly modified Dijkstra algorithm.

Grades the paths not necessarily by distance, but by the value Tannotation computes. It uses the max_saturation setting to artificially decrease capacities.

Template Parameters:
Tannotation Annotation to be used.
Tedge_iterator Iterator to be used for getting outgoing edges.
Parameters:
source_node Node where the algorithm starts.
paths Container for the paths to be calculated.

Definition at line 176 of file mcf.cpp.

References Edge::capacity, Edge::distance, EdgeAnnotation::flow, LinkGraphJob::GetEdge(), LinkGraph::GetEdge(), LinkGraph::GetSize(), graph, job, and max_saturation.

uint MultiCommodityFlow::PushFlow ( EdgeAnnotation edge,
Path path,
uint  accuracy,
uint  max_saturation 
) [protected]

Push flow along a path and update the unsatisfied_demand of the associated edge.

Parameters:
edge Edge whose ends the path connects.
path End of the path the flow should be pushed on.
accuracy Accuracy of the calculation.
max_saturation If < UINT_MAX only push flow up to the given saturation, otherwise the path can be "overloaded".

Definition at line 253 of file mcf.cpp.

References Path::AddFlow(), Clamp(), EdgeAnnotation::demand, job, and EdgeAnnotation::unsatisfied_demand.

Referenced by MCF1stPass::MCF1stPass(), and MCF2ndPass::MCF2ndPass().


The documentation for this class was generated from the following files: