Distance-based annotation for use in the Dijkstra algorithm. More...
#include <mcf.h>
Data Structures | |
struct | comp |
Public Member Functions | |
DistanceAnnotation (NodeID n, bool source=false) | |
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. | |
FORCEINLINE 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 23 of file mcf.h.
FORCEINLINE uint DistanceAnnotation::GetAnnotation | ( | ) | const [inline] |
return the actual value of the annotation, in this case the distance
Definition at line 33 of file mcf.h.
References Path::distance.
Referenced by DistanceAnnotation::comp::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 | the other path | |
cap | the capacity of the new edge to be added to base | |
dist | the distance of the new edge |
Definition at line 24 of file mcf.cpp.
References Path::distance, and Path::free_capacity.