template<typename DiGraph, typename ParametricAPI>
MaxParametricSolver class
Maximum Parametric Solver.
| Template parameters | |
|---|---|
| DiGraph | The type of the directed graph. |
| ParametricAPI | The type of the parametric API. |
This class solves the following parametric network problem:
max r s.t. dist[v] - dist[u] <= distrance(e, r) for all edges e(u, v) in gra(V, E)
A parametric network problem refers to a type of optimization problem that involves finding the optimal solution to a network flow problem as a function of one single parameter.
Example parametric network: a ----c(5,r)----> b | | |c(2,r) c(3,r)| | | v v d ----c(4,r)----> e Where c(i,r) represents cost depending on parameter r
Constructors, destructors, conversion operators
- MaxParametricSolver(const DiGraph& gra, ParametricAPI& omega)
Public functions
-
template<typename Ratio, typename Mapping, typename Domain>auto run(Ratio& r_opt, Mapping& dist, Domain) -> auto
Function documentation
template<typename DiGraph, typename ParametricAPI>
MaxParametricSolver<DiGraph, ParametricAPI>:: MaxParametricSolver(const DiGraph& gra,
ParametricAPI& omega)
| Parameters | |
|---|---|
| gra in | The parameter "gra" is of type DiGraph and it represents a directed graph. It is used as input for the constructor of the MaxParametricSolver class. |
| omega in | omega is an object of type ParametricAPI. |
The MaxParametricSolver constructor initializes the MaxParametricSolver object with a given DiGraph and ParametricAPI.
template<typename DiGraph, typename ParametricAPI>
template<typename Ratio, typename Mapping, typename Domain>
auto MaxParametricSolver<DiGraph, ParametricAPI>:: run(Ratio& r_opt,
Mapping& dist,
Domain)
| Template parameters | |
|---|---|
| Ratio | The type representing a ratio or a fraction. |
| Mapping | The type of the mapping from vertices to their distances. |
| Domain | The type of the domain for distances. |
| Parameters | |
| r_opt in | r_opt is a reference to a variable of type Ratio. |
| dist in | The dist parameter is a mapping that represents the distance between two elements in a domain. It is used in the get_weight lambda function to calculate the weight of an edge. * |
| Returns | The function run returns an object of type Cycle. |
The function "run" iteratively finds the minimum weight cycle in a graph until the weight of the current minimum cycle is greater than or equal to a given ratio.