graph_analysis
Public Types | Public Member Functions | List of all members
graph_analysis::algorithms::MinCostFlow Class Reference

#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 ()
 

Detailed Description

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

Member Typedef Documentation

◆ edge_t

◆ vertex_t

Member Enumeration Documentation

◆ EdgeIndex

Enumerator
LOWER_BOUND 
UPPER_BOUND 
COST 
RESULT_FLOW 

◆ Type

Enumerator
NetworkSimplex 
CostScaling 
CapacityScaling 
CycleCanceling 

◆ VertexIndex

Enumerator
SUPPLY_DEMAND 
RESULT_POTENTIAL 

Constructor & Destructor Documentation

◆ MinCostFlow()

graph_analysis::algorithms::MinCostFlow::MinCostFlow ( const BaseGraph::Ptr &  graph,
Type  type = NetworkSimplex 
)

Member Function Documentation

◆ run()

uint32_t graph_analysis::algorithms::MinCostFlow::run ( )

All results will be added into the graph access we

Returns
the total cost

The documentation for this class was generated from the following files: