Distance-based annotation for use in the Dijkstra algorithm. More...
Data Structures | |
struct | Comparator |
Comparator for std containers. More... | |
Public Member Functions | |
DistanceAnnotation (NodeID n, bool source=false) | |
Constructor. | |
bool | IsBetter (const DistanceAnnotation *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. | |
uint | GetAnnotation () const |
Return the actual value of the annotation, in this case the distance. |
Distance-based annotation for use in the Dijkstra algorithm.
This is close to the original meaning of "annotation" in this context. Paths are rated according to the sum of distances of their edges.
Definition at line 14 of file mcf.cpp.
DistanceAnnotation::DistanceAnnotation | ( | NodeID | n, | |
bool | source = false | |||
) | [inline] |
uint DistanceAnnotation::GetAnnotation | ( | ) | const [inline] |
Return the actual value of the annotation, in this case the distance.
Definition at line 30 of file mcf.cpp.
References Path::distance.
Referenced by DistanceAnnotation::Comparator::operator()().
bool DistanceAnnotation::IsBetter | ( | const DistanceAnnotation * | 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 180 of file mcf.cpp.
References Path::distance, and Path::free_capacity.