Lecture 16 Maximum Matching
-
Upload
minerva-keith -
Category
Documents
-
view
31 -
download
1
description
Transcript of Lecture 16 Maximum Matching
Lecture 16
Maximum Matching
Incremental Method
• Transform from a feasible solution to another feasible solution to increase (or decrease) the value of objective function.
Matching in Bipartite Graph
common.
in endpoint no have edges any twoin which edges of
subset a is matching a ),,,(graph bipartite aGiven EUVG
y.cardinalit maximum
with matching a find ),,(graph bipartite aGiven EVG
Maximum Matching
1
1
Note: Every edge has capacity 1.
2. Can we do those augmentation in the same time?
1. Can we do augmentation directly in bipartite graph?
1. Can we do augmentation directly in bipartite graph?
Yes!!!
Alternative Path
path. e within thedges matched
and unmatchedbetween alternates and vertex,free aat
ends vertex,free aat startspath that a ispath augmentingAn
vertex.free a called is
matching somein edgean ofendpoint not the ishat A vertex t
M
Optimality Condition
path. augmenting no hasit iff maximum is matchingA
. .path w.r.t augmentingan contains *Then
.|*||| with matchings twobe * and Let )(
Trivial. )(
MMM
MMMM
M *M *M
*M
*MM *MM
1)(deg vM 2)(deg * vMM1)(deg * vM
Puzzle
contain? * does w.r.t.
paths augmentingdisjoint many how ,|||*| If
MMM
kMM
why?,exactly :Answer k
Extension to Graph
Matching in Graph
common.
in endpoint no have edges any twoin which edges of
subset a is matching a ),,(graph aGiven EVG
y.cardinalit maximum
with matching a find ),,(graph aGiven EVG
Maximum Matching
Note
• We cannot transform Maximum Matching in Graph into a maximum flow problem.
• However, we can solve it with augmenting path method.
Alternative Path
path. e within thedges matched
and unmatchedbetween alternates and vertex,free aat
ends vertex,free aat startspath that a ispath augmentingAn
vertex.free a called is
matching somein edgean ofendpoint not the ishat A vertex t
M
Optimality Condition
path. augmenting no hasit iff maximum is matchingA
. .path w.r.t augmentingan contains *Then
.|*||| with matchings twobe * and Let )(
Trivial. )(
MMM
MMMM
M *M *M
*M
2. Can we do those augmentation in the same time?
Hopcroft–Karp algorithm
• The Hopcroft–Karp algorithm may therefore be seen as an adaptation of the Edmonds-Karp algorithm for maximum flow.
In Each Phase
. to from paths
shortest disjoint ofset maximal find graph, residualIn
ts
s t
least two.at by increasespath
augmentingshortest theoflength thephase,each In
Running Time
phases. /2
mostat through from obtained becan * Hence,
/2. is *in paths augmenting of # Thus,
1.2length has themofEach
.for paths augmenting |||*|
contains *Then matching. maximum *
and phase after matching thebe Let
time.)(in excuted becan phaseEach
n
MM
nMM
n
MMM
MMM
nM
mO
|||| EV
Reading Material
Max Weighted Matching
Maximum Weight Matching
weight.total
maximumis with matching a find ,:weight
edge positive with ),(graph bipartite aGiven
REw
EVG
1
3
?
It is hard to be transformed to maximum flow!!!
Minimum Weight Matching
weight. toalmaximumis with matching a find ,:
weight edge enonnegativ with ),(graph aGiven
REc
EVG
Augmenting Path
edges. matchedon that edges unmatchedon weight
total with thecycle ealternativan is cycle augmentingAn
edges. matched
on weight total the edges unmatchedon weight total thethat,
propert path with ealternativ maxinal a ispath augmentingAn
vertex.free a called is
matching somein edgean ofendpoint not the ishat A vertex t
M
Optimality Condition
. w.r.t.path/cycle augmentingan contains *Then
*).()( with matchings twobe * and Let )(
Trivial. )(
MMM
McMcMM
M *M *M
*M
cycle. augmenting no andpath
augmenting no hasit iffweight -maximum is matchingA
35
36
37
38
39
40
41
42
43
44
Chinese Postman
distance.
possibleleast with theletters,deliver order toin city ain
roadevery along travel toshesPostman wi Chinese The
once.least at traversedis edge
each in which graph theof walk closedshortest a
find weight,edge enonnegativ graph with aGiven
Minimum Weight Perfect Matching
• Minimum Weight Perfect Matching can be transformed to Maximum Weight Matching.
• Chinese Postman Problem is equivalent to Minimum Weight Perfect Matching in graph on odd nodes.