5 Weighted Matching
5 Weighted Matching
Matching
CS31005: Algorithms-II
Autumn 2020
IIT Kharagpur
Matching
A matching in an undirected graph G = (V, E) is a
subset of edges M ⊆ E, such that for all vertices v ∈ V,
at most one edge of M is incident on v
Size of the matching M = |M|
Weight of the matching M (for weighted graphs) =
sum of the weights of the edges in M
A maximum cardinality matching is a matching with
maximum number of edges among all possible
matchings
A maximum weighted matching is a matching with
highest weight among all other matchings in the graph
Our problem: Given a weighted bipartite graph G = (V,
E) with partitions X and Y, and positive weights on each
edge, find a maximum weighted matching in G
Models assignment problems with cost in practice
Simple flow based techniques that we used for
unweighted bipartite graphs no longer work for
weighted graphs…
9
4
5 5
12
1
3
5