|
graph_analysis
|
#include <MinCostFlow.hpp>
Public Types | |
| enum | EdgeIndex { LOWER_BOUND = 0, UPPER_BOUND, COST, RESULT_FLOW } |
| enum | VertexIndex { SUPPLY_DEMAND = 0, RESULT_POTENTIAL } |
| enum | Type { NetworkSimplex, CostScaling, CapacityScaling, CycleCanceling } |
| typedef NWeightedEdge< int32_t, 5 > | edge_t |
| typedef NWeightedVertex< int32_t, 2 > | vertex_t |
Public Member Functions | |
| MinCostFlow (const BaseGraph::Ptr &graph, Type type=NetworkSimplex) | |
| uint32_t | run () |
MinCostFlow allows to use existing algorithms for min-cost flow optimization to be performed on an existing graph
The constructed graph should consist of edges of type: NWeightedEdge<int32_t,5> Indices correspond to EdgeIndex, i.e. 0 -> lower bound 1 -> upper bound 2 -> cost 3 -> result: flow and supply/demand nodes: WeightedVertex<int32_t> (will use 'int' value though) 0 -> supply/demand (supply is a positive value, demand a negative one) 1 -> result: potential
The min cost flow is solved using the graph specific solvers, e.g., default for the underlying lemon graph structure is the NetworkSimplex
| typedef NWeightedEdge<int32_t,5> graph_analysis::algorithms::MinCostFlow::edge_t |
| typedef NWeightedVertex<int32_t,2> graph_analysis::algorithms::MinCostFlow::vertex_t |
| graph_analysis::algorithms::MinCostFlow::MinCostFlow | ( | const BaseGraph::Ptr & | graph, |
| Type | type = NetworkSimplex |
||
| ) |
| uint32_t graph_analysis::algorithms::MinCostFlow::run | ( | ) |
All results will be added into the graph access we
1.8.17