Algorithm 1. KuhnβMunkres Algorithm
|
Β Β Input: A bipartite graph , corresponding edge weights
|
Β Β Output: the perfect matching M. |
βΒ Step 1: Generate initial labeling and match in
|
βΒ Step 2: If perfect, stop. Otherwise, pick a free vertex . Set ,. |
βΒ Step 3: If , update labels (forcing ) with following Equations (6) and (7)
|
|
|
βΒ Step 4: If , choose :
|
ββββΒ Β Β If free, is augmenting path. Augment M and go to 2
|
Β Β Β ββββIf matched, say to , extend alternating tree: , . Go to |