Data Structures | Public Member Functions

CapacityAnnotation Class Reference

Capacity-based annotation for use in the Dijkstra algorithm. More...

Inheritance diagram for CapacityAnnotation:
Path

Data Structures

struct  Comparator
 Comparator for std containers. More...

Public Member Functions

 CapacityAnnotation (NodeID n, bool source=false)
 Constructor.
bool IsBetter (const CapacityAnnotation *base, uint cap, int free_cap, uint dist) const
 Determines if an extension to the given Path with the given parameters is better than this path.
int GetAnnotation () const
 Return the actual value of the annotation, in this case the capacity.

Detailed Description

Capacity-based annotation for use in the Dijkstra algorithm.

This annotation rates paths according to the maximum capacity of their edges. The Dijkstra algorithm still gives meaningful results like this as the capacity of a path can only decrease or stay the same if you add more edges.

Definition at line 46 of file mcf.cpp.


Constructor & Destructor Documentation

CapacityAnnotation::CapacityAnnotation ( NodeID  n,
bool  source = false 
) [inline]

Constructor.

Parameters:
n ID of node to be annotated.
source If the node is the source of its path.

Definition at line 54 of file mcf.cpp.


Member Function Documentation

int CapacityAnnotation::GetAnnotation (  )  const [inline]

Return the actual value of the annotation, in this case the capacity.

Returns:
Capacity.

Definition at line 62 of file mcf.cpp.

References Path::GetCapacityRatio().

Referenced by CapacityAnnotation::Comparator::operator()().

bool CapacityAnnotation::IsBetter ( const CapacityAnnotation base,
uint  cap,
int  free_cap,
uint  dist 
) const

Determines if an extension to the given Path with the given parameters is better than this path.

Parameters:
base Other path.
cap Capacity of the new edge to be added to base.
dist Distance of the new edge.
Returns:
True if base + the new edge would be better than the path associated with this annotation.

Definition at line 214 of file mcf.cpp.

References Path::capacity, Path::distance, Path::free_capacity, Path::GetCapacityRatio(), and min().


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