Professional Documents
Culture Documents
Maximum Cardinality Bipartite Matching (Graph Modeling + Max Flow)
Maximum Cardinality Bipartite Matching (Graph Modeling + Max Flow)
SPECIAL GRAPHS
c Steven & Felix, NUS
To find the solution for non-trivial cases, we have to reduce this problem to a Max Flow problem.
We assign the original vertex cost (the weight of taking that vertex) as capacity from source to
that vertex for user A and capacity from that vertex to sink for user B. Then, we give ‘infinite’
capacity in between any edge in between sets A and B. See Figure 4.29.
Figure 4.29: Reducing MWIS on Bipartite Graph to Max Flow Problem (from LA 3487 [11])
Then, we run O(V E 2 ) Edmonds Karp’s algorithm on this Flow graph. After the Max Flow algo-
rithm terminates, the solution is {s-component vertices in User A} + {t-component vertices in
User B} where s-component (t-component) are the vertices still reachable to source vertex (sink ver-
tex) after running Max Flow. In Figure 4.30, the solution is: {A1 (20), A2 (18), A4 (54)}+{B3 (47)} =
139. This value can also be obtained via: MWIS = Total Weight - Max Flow = 259 − 120 = 139.
91