template<typename Node, typename Edge, typename Ratio>
MinParametricAPI class

Minimum Parametric API Interface.

This abstract class defines the interface for minimum parametric problems. Concrete implementations must provide distance and zero_cancel methods.

Example of parametric problem with constraints:
a ----d(5,r)----> b
|                |
|d(2,r)    d(3,r)|
|                |
v      c(1)      v
d ----d(4,r)----> e

Where d(i,r) represents distance depending on parameter r
and c(1) represents a constraint

Public functions

auto distance(const Ratio& ratio, const Edge& edge) -> Ratio -> auto pure virtual
Calculate the distance for a given ratio and edge.
auto zero_cancel(const std::vector<Edge>& cycle) -> Ratio -> auto pure virtual
Calculate the ratio that would make the cycle's total distance zero.

Function documentation

template<typename Node, typename Edge, typename Ratio>
auto MinParametricAPI<Node, Edge, Ratio>::distance(const Ratio& ratio, const Edge& edge) -> Ratio pure virtual

Calculate the distance for a given ratio and edge.

Parameters
ratio The ratio parameter that affects the distance calculation
edge The edge in the graph
Returns Ratio The calculated distance based on the given ratio and edge

template<typename Node, typename Edge, typename Ratio>
auto MinParametricAPI<Node, Edge, Ratio>::zero_cancel(const std::vector<Edge>& cycle) -> Ratio pure virtual

Calculate the ratio that would make the cycle's total distance zero.

Parameters
cycle The cycle in the graph that needs to be evaluated
Returns Ratio The ratio that would make the cycle's total distance zero