Capacity-based annotation for use in the Dijkstra algorithm. More...
#include <mcf.h>
Data Structures | |
struct | Comparator |
Public Member Functions | |
CapacityAnnotation (NodeID n, bool source=false) | |
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 38 of file mcf.h.
int CapacityAnnotation::GetAnnotation | ( | ) | const [inline] |
Return the actual value of the annotation, in this case the capacity.
Definition at line 49 of file mcf.h.
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 50 of file mcf.cpp.
References Path::capacity, Path::distance, Path::free_capacity, Path::GetCapacityRatio(), and min().