

Construct a subgraph graph G consisting of the "best cost edges"; // We will discuss what is a "best cost edge" later Find a maximal matching M in subgraph G repeat until M is a complete matching { Add the "next best cost edges" to G; // Notice the quotes: it's more complex that just // looking at the cost of an edge Find a maximal matching M in (modified) subgraph G; } 

The least cost edge in the graph is (a_{1}, b_{1}):
However, the minimum cost solution does not contain the edge (a_{1}, b_{1}):
Reason:


Cost matrix:  b1 b2 + a1  1 4 a2  5 9 
The minimum cost incurred to match a_{2} = 5 (by matching a_{2} to b_{1})
Compute the additional incurred cost when using nonoptimal edged by subtracting the minimum cost from the other edges that is incident to that same node:
Subtract min cost:  Result: 

The 0weight edges are the best edges to match a_{1} and a_{2} when nothing else matters
However, we know that something else does matter:

How to read the cost 3 and 4:

Now you can tell exactly what you need to do:

Therefore:









