Download - Lecture 16 Maximum Matching
![Page 1: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/1.jpg)
Lecture 16
Maximum Matching
![Page 2: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/2.jpg)
Incremental Method
• Transform from a feasible solution to another feasible solution to increase (or decrease) the value of objective function.
![Page 3: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/3.jpg)
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
![Page 4: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/4.jpg)
![Page 5: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/5.jpg)
1
1
![Page 6: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/6.jpg)
Note: Every edge has capacity 1.
![Page 7: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/7.jpg)
![Page 8: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/8.jpg)
![Page 9: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/9.jpg)
![Page 10: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/10.jpg)
![Page 11: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/11.jpg)
![Page 12: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/12.jpg)
![Page 13: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/13.jpg)
![Page 14: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/14.jpg)
![Page 15: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/15.jpg)
2. Can we do those augmentation in the same time?
1. Can we do augmentation directly in bipartite graph?
![Page 16: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/16.jpg)
1. Can we do augmentation directly in bipartite graph?
Yes!!!
![Page 17: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/17.jpg)
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
![Page 18: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/18.jpg)
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
![Page 19: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/19.jpg)
*MM *MM
1)(deg vM 2)(deg * vMM1)(deg * vM
![Page 20: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/20.jpg)
Puzzle
contain? * does w.r.t.
paths augmentingdisjoint many how ,|||*| If
MMM
kMM
why?,exactly :Answer k
![Page 21: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/21.jpg)
Extension to Graph
![Page 22: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/22.jpg)
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
![Page 23: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/23.jpg)
Note
• We cannot transform Maximum Matching in Graph into a maximum flow problem.
• However, we can solve it with augmenting path method.
![Page 24: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/24.jpg)
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
![Page 25: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/25.jpg)
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
![Page 26: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/26.jpg)
2. Can we do those augmentation in the same time?
![Page 27: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/27.jpg)
Hopcroft–Karp algorithm
• The Hopcroft–Karp algorithm may therefore be seen as an adaptation of the Edmonds-Karp algorithm for maximum flow.
![Page 28: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/28.jpg)
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
![Page 29: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/29.jpg)
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
![Page 30: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/30.jpg)
Max Weighted Matching
![Page 31: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/31.jpg)
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!!!
![Page 32: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/32.jpg)
Minimum Weight Matching
weight. toalmaximumis with matching a find ,:
weight edge enonnegativ with ),(graph aGiven
REc
EVG
![Page 33: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/33.jpg)
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
![Page 34: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/34.jpg)
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
![Page 35: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/35.jpg)
35
![Page 36: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/36.jpg)
36
![Page 37: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/37.jpg)
37
![Page 38: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/38.jpg)
38
![Page 39: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/39.jpg)
39
![Page 40: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/40.jpg)
40
![Page 41: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/41.jpg)
41
![Page 42: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/42.jpg)
42
![Page 43: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/43.jpg)
43
![Page 44: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/44.jpg)
44
![Page 45: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/45.jpg)
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
![Page 46: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/46.jpg)
![Page 47: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/47.jpg)
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.
![Page 48: Lecture 16 Maximum Matching](https://reader035.vdocuments.us/reader035/viewer/2022062407/56812ec1550346895d9461a9/html5/thumbnails/48.jpg)