Why it matters

Weighted bipartite matching is common optimization. Hungarian is standard.

Advertisement

The architecture

Cost matrix.

Reduce rows + columns.

Cover zeros with min lines.

Repeat until n lines needed.

Hungarian algorithmCost matrixn × nReduce + cover zerositerativelyMatching from zerosoptimal assignmentO(V³) complexity; use library for practical problems
Hungarian steps.
Advertisement

How it works end to end

Alternative: min-cost max-flow reduction.

Rectangular: pad with dummy nodes.

Applications: task-to-worker assignment, kidney exchange.