MinCostFlow
Minimum cost flow problem (Min-Cost Flow) is a fundamental optimization problem in network flow theory. Given a directed graph with edge capacities and per-unit costs, and a set of node supplies and/or demands, the objective is to push flow through the network so that all capacity constraints are respected and the net production/consumption at every node is satisfied while the total cost of the flow is minimized.
Formally, each edge e has a capacity u_e and a cost c_e per unit of flow. A
Common approaches include the successive shortest augmenting path method, often implemented with Dijkstra’s algorithm and node
Min-cost flow generalizes several classic problems, including the max-flow problem, the transportation problem, and the assignment