Finds the minimum cost flow of a directed graph.
MinCostFlow(
arcSources,
arcTargets,
arcCapacities,
arcCosts,
nodeSupplies,
numNodes,
algorithm = "NetworkSimplex"
)
A named list containing four entries: 1) "flows": A vector corresponding to the flows of arcs in the graph, 2) "potentials": A vector of potentials of the graph's nodes, 3) "cost": the total cost of the flows in the graph, i.e. the mincostflow value, and 4) "feasibility": LEMON's feasibility type, demonstrating how feasible the graph problem is, one of "INFEASIBLE", "OPTIMAL", and "UNBOUNDED"
Vector corresponding to the source nodes of a graph's edges
Vector corresponding to the destination nodes of a graph's edges
Vector corresponding to the capacities of nodes of a graph's edges
Vector corresponding to the capacities of nodes of a graph's edges
Vector corresponding to the supplies of each node
The number of nodes in the graph
Choices of algorithm include "NetworkSimplex", "CostScaling", "CapacityScaling", and "CycleCancelling". NetworkSimplex is the default.
For details on LEMON's implementation, including differences between the algorithms, see https://lemon.cs.elte.hu/pub/doc/1.3.1/a00612.html.