Data Structures | Public Member Functions

DistanceAnnotation Class Reference

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

#include <mcf.h>

Inheritance diagram for DistanceAnnotation:
Path

Data Structures

struct  Comparator

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.
uint GetAnnotation () const
 Return the actual value of the annotation, in this case the distance.

Detailed Description

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.h.


Member Function Documentation

uint DistanceAnnotation::GetAnnotation (  )  const [inline]

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

Returns:
Distance.

Definition at line 25 of file mcf.h.

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.

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 16 of file mcf.cpp.

References Path::distance, and Path::free_capacity.


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