Capacity-based annotation for use in the Dijkstra algorithm. More...
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. |
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 47 of file mcf.cpp.
CapacityAnnotation::CapacityAnnotation | ( | NodeID | n, | |
bool | source = false | |||
) | [inline] |
int CapacityAnnotation::GetAnnotation | ( | ) | const [inline] |
Return the actual value of the annotation, in this case the capacity.
Definition at line 63 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.
base | Other path. | |
cap | Capacity of the new edge to be added to base. | |
dist | Distance of the new edge. |
Definition at line 215 of file mcf.cpp.
References Path::capacity, Path::distance, Path::free_capacity, Path::GetCapacityRatio(), and min().