|
| template<typename Graph, typename T, typename Fn1, typename Fn2, typename Mapping> |
| auto | parametric_search (const Graph &gra, T &r_opt, Fn1 &&distrance, Fn2 &&zero_cancel, Mapping &&dist, size_t max_iters) |
| | Template Method: parametric max-problem search skeleton.
|
| template<typename Fn, typename Edge, typename Arr> |
| auto | make_get_weight (Fn &fn, const Arr &xval) |
| | Build the per-edge weight callable used by Howard's method.
|
template<typename Fn, typename Edge, typename Arr>
| auto netoptim_detail::make_get_weight |
( |
Fn & | fn, |
|
|
const Arr & | xval ) |
Build the per-edge weight callable used by Howard's method.
Uses fn.make_weight_fn(x) when the oracle provides it; otherwise returns a lambda forwarding to fn.eval(edge, x).
- Template Parameters
-
| Fn | edge-oracle type |
| Edge | graph edge type |
| Arr | iterate / point type |
- Parameters
-
| [in] | fn | edge oracle |
| [in] | xval | current iterate |
- Returns
- callable (const Edge&) -> double
template<typename Graph, typename T, typename Fn1, typename Fn2, typename Mapping>
| auto netoptim_detail::parametric_search |
( |
const Graph & | gra, |
|
|
T & | r_opt, |
|
|
Fn1 && | distrance, |
|
|
Fn2 && | zero_cancel, |
|
|
Mapping && | dist, |
|
|
size_t | max_iters ) |
Template Method: parametric max-problem search skeleton.
The iteration structure is fixed here; the distance function and the zero-canceling function are injected as strategies. Returns the critical cycle that determines the optimal parameter (empty if none).
- Template Parameters
-
| Graph | directed graph type |
| T | numeric type for the parameter r |
| Fn1 | distance callable (parameter, edge) -> weight |
| Fn2 | zero-canceling callable (cycle) -> parameter |
| Mapping | distance mapping (vertex -> distance) |
- Parameters
-
| [in] | gra | directed graph containing the network structure |
| [in,out] | r_opt | parameter to be maximized, updated with optimal value |
| [in] | distrance | monotone decreasing function of parameter r |
| [in] | zero_cancel | function to compute new parameter from cycle |
| [in,out] | dist | distance mapping used in the algorithm |
| [in] | max_iters | maximum number of iterations (default: 1000) |
- Returns
- Cycle the critical cycle that determines the optimal parameter