|
TraceMaker
C++ API of the engine
|
Min-cost flow on a small graph (exposed for tests). More...
#include <place/lower_bound.hpp>
Public Member Functions | |
| MinCostFlow (int n) | |
| void | add_arc (int u, int v, std::int64_t cost, std::int64_t cap=kInf) |
| std::pair< std::int64_t, std::int64_t > | solve (int s, int t, std::int64_t limit) |
| Sends up to limit units from s to t at minimum cost; returns {flow, cost}. | |
Static Public Attributes | |
| static constexpr std::int64_t | kInf = INT64_MAX / 4 |
Min-cost flow on a small graph (exposed for tests).
Successive shortest paths with Dijkstra and potentials; arcs from add_arc have infinite capacity unless cap is given. Costs are integers.
Definition at line 30 of file lower_bound.hpp.
|
inlineexplicit |
Definition at line 32 of file lower_bound.hpp.
| void tmk::place::MinCostFlow::add_arc | ( | int | u, |
| int | v, | ||
| std::int64_t | cost, | ||
| std::int64_t | cap = kInf ) |
| std::pair< std::int64_t, std::int64_t > tmk::place::MinCostFlow::solve | ( | int | s, |
| int | t, | ||
| std::int64_t | limit ) |
Sends up to limit units from s to t at minimum cost; returns {flow, cost}.
The graph must have no negative cycle; negative arc costs are allowed (initial potentials by Bellman–Ford).
|
staticconstexpr |
Definition at line 33 of file lower_bound.hpp.