Zero-Cost Matching via Maximum Flow¶
Definition¶
To obtain a maximum zero-cost matching, create a source , one vertex for each matrix row, one for each column, and a sink . Add source-to-row edges, row-to-column edges exactly where the matrix entry is zero, and column-to-sink edges. Give every edge capacity 1 and compute an integral maximum flow.
Interpretation¶
After the reductions of the Hungarian algorithm, the question is how many zeros can be chosen with no two in the same row or column. This construction answers it with a maximum flow: each unit of flow from to passes through one row and one column joined by a zero, so it selects one zero-cost pair.
Rows and have a zero only in column 2, so both need , which can pass on at most one unit to . The green flow uses and and has value . A flow of value would need all three rows, so it does not exist. Only two independent zeros can be selected, fewer than the three needed for a complete assignment.
Capacity on each edge lets every row send at most one unit, so no row is used twice; capacity on each edge does the same for the columns. These are exactly the conditions of a bipartite matching. To read the flow as a set of pairs, every edge must carry or ; the augmenting path algorithm started from zero flow guarantees this for integer capacities.
When the flow value is smaller than the number of rows, the Hungarian algorithm needs a minimum zero cover. It uses as many lines as there are independent zeros, here , and tells which entries to adjust next.
Key Results¶
- The maximum flow value is the maximum number of simultaneous zero-cost assignments.
- Read selected pairs from row-to-column edges carrying flow 1.
- The augmenting path algorithm starting at zero preserves integrality for these integer capacities.
Examples¶
The figure’s zero pairs are . Its integral maximum flow is 2, so only two independent zeros can be assigned, fewer than the three required for a complete assignment. The minimum cut also determines a minimum zero cover; further Hungarian adjustment is needed.
- The five-job practice matrix admits four zero-cost pairs.
- One such matching is jobs 1, 2, 3, 4 to machines 1, 4, 3, 2.
Prerequisites¶
Related Concepts¶
Sources¶
- OR Modelling · Week 5
Last updated: 20 October 2026 03:02
Zero-Cost Matching via Maximum FlowMinimum Zero CoverBipartite MatchingAugmenting Path AlgorithmHungarian Algorithm