Minimum Cost Perfect Matching

Abstract

This is pseudocode for Minimum Cost Perfect Matching in Bipartite Graphs

\SetAlgoCaptionSeparator

.3

{algorithm}

Minimum Cost Perfect Matching in Bipartite Graphs

\AlgoDisplayBlockMarkers\AlgoDisplayGroupMarkers\SetAlgoBlockMarkers

{ } \SetAlgoNoEnd\SetAlgoNoLine

\SetKwInOut

InputInput\SetKwInOutOutputOutput \InputGraph G = (V,E) with bipartition U,W where |U| = |W| and costs c. \OutputA minimum cost perfect matching M or a deficient set S

yv:=12min{ce:eE} (1)

for all v V B
\WhileConstruct graph H with vertices V and edges

{uvE:cuv=yu+yv} (2)
\uIf

H has perfect matching M stop (M is a minimum cost perfect matching of G) Let S U be a deficient set for H B
\uIfall edges of G with an endpoint in S have an endpoint in NH(S) stop (S is a deficient set of G)

:=min{cuv-yu-yv:uvE,uS,vNH(S)} (3)
yv:={yv+ for vSyv- for vNH(S)yv (4)