Data Structures | Public Member Functions

# CapacityAnnotation Class Reference

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

`#include <mcf.h>`

Inheritance diagram for CapacityAnnotation:

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

## Detailed Description

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.

## Member Function Documentation

int CapacityAnnotation::GetAnnotation | ( |  | ) | const`[inline]`

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

Returns:
  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.

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

References Path::capacity, Path::distance, Path::free_capacity, Path::GetCapacityRatio(), and min().

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

- src/linkgraph/mcf.h
- src/linkgraph/mcf.cpp