Data Structures | Public Member Functions

# DistanceAnnotation Class Reference

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

Inheritance diagram for DistanceAnnotation:

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

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

## Constructor & Destructor Documentation

DistanceAnnotation::DistanceAnnotation | ( | NodeID | n,
|  | bool | source = `false` |
| ) |  |  | `[inline]`

Constructor.

Parameters:

  | n | ID of node to be annotated.
  | source | If the node is the source of its path.

Definition at line 23 of file mcf.cpp.

## 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 31 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.

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

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

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

- src/linkgraph/mcf.cpp