FindMinimumCostFlow
✖
FindMinimumCostFlow
finds the minimum cost flow in the graph g with sd1, sd2, … vertex supplies or demands.
finds the minimum cost maximum flow between source vertex s and target vertex t in a graph g.
finds the minimum cost flow between source s and target t, with the required flow d.
Details and Options


- FindMinimumCostFlow finds a flow of minimum total cost from a set of supply vertices to a set of demand vertices in a graph with capacity constraints and edge costs.
- By default, the minimum total cost is returned.
- Matrices and SparseArray objects can be used in FindMinimumCostFlow.
- For undirected graphs, edges are taken to have flows in both directions at the same time and same capacities.
- Self-loops are ignored and parallel edges are merged.
- FindMinimumCostFlow[data,…,"OptimumFlowData"] returns an OptimumFlowData object flowdata that can be used to extract additional properties, using the form flowdata["property"].
- FindMinimumCostFlow[data,…,"property"] can be used to directly give the value of "property".
- Properties related to the optimal flow data include:
-
"CostValue" cost of the flow "EdgeList" list of edges contributing to the flow "FlowGraph" graph of vertices and edges contributing to the flow "FlowMatrix" matrix of edge flows between pairs of vertices "FlowValue" value of the flow "VertexList" list of vertices contributing to the flow - The following options can be given:
-
EdgeCapacity Automatic capacity bounds for each edge EdgeCost Automatic cost per unit flow on edges - With the default setting EdgeCapacity->Automatic, the edge capacity of an edge is taken to be the EdgeCapacity in the graph g if available, otherwise Infinity.
- With the default setting EdgeCost->Automatic, the cost per unit flow on an edge is taken to be the EdgeCost in the graph g if available, otherwise 1.
- FindMinimumCostFlow works with undirected graphs, directed graphs, multigraphs, and mixed graphs.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Find the minimum cost flow between supply and demand:

https://wolfram.com/xid/0tp74wsks1ok4t-8g1mxg

Find the minimum cost maximum flow between two vertices in a graph:

https://wolfram.com/xid/0tp74wsks1ok4t-zswhz4

https://wolfram.com/xid/0tp74wsks1ok4t-rrsa87


https://wolfram.com/xid/0tp74wsks1ok4t-njdf6y

Scope (10)Survey of the scope of standard use cases
FindMinimumCostFlow works with undirected graphs:

https://wolfram.com/xid/0tp74wsks1ok4t-gay90t


https://wolfram.com/xid/0tp74wsks1ok4t-1vbgvr


https://wolfram.com/xid/0tp74wsks1ok4t-5e2cau


https://wolfram.com/xid/0tp74wsks1ok4t-s2h57c


https://wolfram.com/xid/0tp74wsks1ok4t-i4ww80

Use rules to specify the graph:

https://wolfram.com/xid/0tp74wsks1ok4t-bndh30

Compute the minimum cost flow with vertex supplies:

https://wolfram.com/xid/0tp74wsks1ok4t-sj73o

Compute the minimum cost flow with a required flow:

https://wolfram.com/xid/0tp74wsks1ok4t-knszb8

Compute the minimum cost flow for a cost matrix:

https://wolfram.com/xid/0tp74wsks1ok4t-cojxn

Find properties of a minimum cost flow:

https://wolfram.com/xid/0tp74wsks1ok4t-zldbvh

https://wolfram.com/xid/0tp74wsks1ok4t-gtx79i

List of edges contributing to the flow:

https://wolfram.com/xid/0tp74wsks1ok4t-bd3lak


https://wolfram.com/xid/0tp74wsks1ok4t-scruz


https://wolfram.com/xid/0tp74wsks1ok4t-q50o8n

Wolfram Research (2012), FindMinimumCostFlow, Wolfram Language function, https://reference.wolfram.com/language/ref/FindMinimumCostFlow.html (updated 2015).
Text
Wolfram Research (2012), FindMinimumCostFlow, Wolfram Language function, https://reference.wolfram.com/language/ref/FindMinimumCostFlow.html (updated 2015).
Wolfram Research (2012), FindMinimumCostFlow, Wolfram Language function, https://reference.wolfram.com/language/ref/FindMinimumCostFlow.html (updated 2015).
CMS
Wolfram Language. 2012. "FindMinimumCostFlow." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/FindMinimumCostFlow.html.
Wolfram Language. 2012. "FindMinimumCostFlow." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/FindMinimumCostFlow.html.
APA
Wolfram Language. (2012). FindMinimumCostFlow. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindMinimumCostFlow.html
Wolfram Language. (2012). FindMinimumCostFlow. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindMinimumCostFlow.html
BibTeX
@misc{reference.wolfram_2025_findminimumcostflow, author="Wolfram Research", title="{FindMinimumCostFlow}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/FindMinimumCostFlow.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_findminimumcostflow, organization={Wolfram Research}, title={FindMinimumCostFlow}, year={2015}, url={https://reference.wolfram.com/language/ref/FindMinimumCostFlow.html}, note=[Accessed: 29-March-2025
]}