Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
Combinatorial Optimization and Graph Theory
ORCOMatchings in bipartite graphs
Execution of the Hungarian Method
Zoltán Szigeti
Z. Szigeti OCG-ORCO 1 / 1
Algorithm Hungarian method (Kuhn)
Example
Execute the Hungarian method to find a minimum weight perfect
matching in the following bipartite graph.
U
V
u1 u2 u3 u4
v1 v2 v3 v4
v4
v3
v2
v1 3
u1 u2 u3 u4
2 1 1
1
3
4
4
5
58
8 8
2
7
9
Z. Szigeti OCG-ORCO 1 / 1
Execution of the Hungarian method
3
min{3, 9, 8, 7}
5 38 4 57 82
9311 2
4 18
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3
min{2, 4, 5, 8}
2
5 38 4 57 82
9311 2
4 18
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3
min{1, 1, 2, 4}
2 1
5 38 4 57 82
9311 2
4 18
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3
min{1, 5, 3, 8}
2 1 1
5 38 4 57 82
9311 2
4 18
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
y15 38 4 5
7 8293
11 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
3 + 0 = 3
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
3 + 0 6= 9
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
3 + 0 6= 8
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
3 + 0 6= 7
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
2 + 0 = 2
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
2 + 0 6= 4
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
2 + 0 6= 5
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
2 + 0 6= 8
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
1 + 0 = 1
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
1 + 0 = 1
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
1 + 0 6= 2
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
1 + 0 6= 4
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
1 + 0 = 1
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
1 + 0 6= 5
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
1 + 0 6= 3
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
1 + 0 6= 8
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
3 2 1 1
0 0 0 0
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1 5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
5 5
1 1 1 1
1 1 1 1
5 55
s
t
(D1, g1)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
s
t
D01
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
1s
t
D01
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
1s
t
D01
2
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
3 2
1s
t
D01
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
3 2
1s
t
D01
4
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
4 3 2
1s
t
D01
5
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
4 3 2
1s
t
D01
5
6
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
6
4 3 2
1s
t
D01
5
7
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
t
6
4 3 2
1s
D01
5
7
8
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
s
D01
t
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
s
D01
t
1
5
1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (0, 1)(0, 1)
s
t
(x0, g1)
(0, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (0, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
s
D01
t
1
5
1
ε1 = min{1, 5, 1}
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
s
D01
t
1
5
1
ε1 = min{1, 5, 1}
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
s
t
D11
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
s
t
D11
1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
s
t
D11
1
2
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
2
s
t
D11
1
3
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
3 2
s
t
D11
1
4
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
3 2
s
t
D11
1
4
5
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
5
3 2
s
t
D11
1
4
6
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
t
5
3 2
s
D11
1
4
6
7
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
t
5
3 2
s
D11
1
4
6
7
8
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
t
s
D11
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
t
s
D11
1
5
1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1) (0, 1) (1, 1)(0, 1)
s
t
(x1, g1)
(1, 1) (0, 1)(0, 1)(0, 1)
(0, 5) (0, 5)(0, 5) (1, 5)
(0, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
t
s
D11
1
5
1
ε2 = min{1, 5, 1}
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(x2, g1)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
t
s
D11
1
5
1
ε2 = min{1, 5, 1}
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(x2, g1)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
s
t
D21
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(x2, g1)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
s
t
D21
1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(x2, g1)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
s
t
D21
1
2
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(x2, g1)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
2
s
t
D21
1
3
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(x2, g1)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
2
s
t
D21
1
3
4
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(x2, g1)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
2
s
t
Z1
1
3
4
5
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
M1
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
2
s
t
Z1
1
3
4
5
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G1
M1,T1 = (U \ Z1) ∪ (V ∩ Z1)
U
V
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
M1
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5)
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
2
s
t
Z1
1
3
4
5
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
U \ T1
G − T1
V \ T1
ε1 = min{c(uv) − y1(u) − y1(v) : uv ∈ E (G − T1)}= min{6, 5, 4, 2, 3, 6, 4, 2, 7} = 2
5 38 4 57 82
9311 2
4 18
0 0 0 0
3 2 1 1
y1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
U \ T1
G − T1
V \ T1
ε1 = min{c(uv) − y1(u) − y1(v) : uv ∈ E (G − T1)}= min{6, 5, 4, 2, 3, 6, 4, 2, 7} = 2
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G2 5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G2
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(D2, x2, g2)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5) (0, 5)
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G2
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(D2, x2, g2)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5) (0, 5)
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
s
t
D22
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G2
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(D2, x2, g2)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5) (0, 5)
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
3 6
t
s
D22
1
2
45
7
8
9
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G2
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(D2, x2, g2)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5) (0, 5)
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
t
s
D22
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G2
(0, 1)(0, 1)
(1, 5)
(0, 1) (0, 1) (1, 1)(1, 1)
s
t
(D2, x2, g2)
(1, 1) (1, 1)
(0, 5) (0, 5)(0, 5)
(1, 5) (0, 5)
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
t
s
D22
1
15
1
5
ε2 = min{1, 5, 1, 5, 1}
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G2
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 5)
(0, 1) (1, 1)
s
t
(D2, x3, g2) (1, 5) (1, 5)
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
t
s
D22
1
15
1
5
ε2 = min{1, 5, 1, 5, 1}
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G2
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 5)
(0, 1) (1, 1)
s
t
(D2, x3, g2) (1, 5) (1, 5)
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
s
t
D32
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G2
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 5)
(0, 1) (1, 1)
s
t
(D2, x3, g2) (1, 5) (1, 5)
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
s
t
Z2
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G2
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 5)
(0, 1) (1, 1)
s
t
(D2, x3, g2) (1, 5) (1, 5)
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
s
t
Z2
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
U
G2
M2,T2 = (U \ Z2) ∪ (V ∩ Z2)
V
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 5)
(0, 1) (1, 1)
s
t
(D2, x3, g2) (1, 5) (1, 5)
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
s
t
Z2
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
U \ T2
G − T2
V \ T2
ε2 = min{c(uv) − y2(u) − y2(v) : uv ∈ E (G − T2)}= min{3, 2, 1, 4, 1, 3} = 1
5 38 4 57 82
9311 2
4 18
-2 0 0 0
5 4 1 3
y2
y2(u) = y1(u) + ε1 : u ∈ U \ T1
y2(v) = y1(v) − ε1 : v ∈ V ∩ T1
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
U \ T2
G − T2
V \ T2
ε2 = min{c(uv) − y2(u) − y2(v) : uv ∈ E (G − T2)}= min{3, 2, 1, 4, 1, 3} = 1
26
0-3
5 38 4 57 82
9311 2
4 18
-1 0
5 3
y2
y3(u) = y2(u) + ε2 : u ∈ U \ T2
y3(v) = y2(v) − ε2 : v ∈ V ∩ T2
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G3
26
0-3
5 38 4 57 82
9311 2
4 18
-1 0
5 3
y2
y3(u) = y2(u) + ε2 : u ∈ U \ T2
y3(v) = y2(v) − ε2 : v ∈ V ∩ T2
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G3
(0, 5)
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 1) (1, 1)
s
t
(D3, x3, g3) (1, 5) (1, 5)
(0, 5)
26
0-3
5 38 4 57 82
9311 2
4 18
-1 0
5 3
y2
y3(u) = y2(u) + ε2 : u ∈ U \ T2
y3(v) = y2(v) − ε2 : v ∈ V ∩ T2
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G3
(0, 5)
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 1) (1, 1)
s
t
(D3, x3, g3) (1, 5) (1, 5)
(0, 5)
26
0-3
5 38 4 57 82
9311 2
4 18
-1 0
5 3
y2
y3(u) = y2(u) + ε2 : u ∈ U \ T2
y3(v) = y2(v) − ε2 : v ∈ V ∩ T2
s
t
D33
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G3
(0, 5)
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 1) (1, 1)
s
t
(D3, x3, g3) (1, 5) (1, 5)
(0, 5)
26
0-3
5 38 4 57 82
9311 2
4 18
-1 0
5 3
y2
y3(u) = y2(u) + ε2 : u ∈ U \ T2
y3(v) = y2(v) − ε2 : v ∈ V ∩ T2
s
t
Z3
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G3
(0, 5)
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 1) (1, 1)
s
t
(D3, x3, g3) (1, 5) (1, 5)
(0, 5)
26
0-3
5 38 4 57 82
9311 2
4 18
-1 0
5 3
y2
y3(u) = y2(u) + ε2 : u ∈ U \ T2
y3(v) = y2(v) − ε2 : v ∈ V ∩ T2
s
t
Z3
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
U
G3
M3,T3 = (U \ Z3) ∪ (V ∩ Z3)
V
(0, 5)
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 1) (1, 1)
s
t
(D3, x3, g3) (1, 5) (1, 5)
(0, 5)
26
0-3
5 38 4 57 82
9311 2
4 18
-1 0
5 3
y2
y3(u) = y2(u) + ε2 : u ∈ U \ T2
y3(v) = y2(v) − ε2 : v ∈ V ∩ T2
s
t
Z3
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
V \ T3
U \ T3
G − T3
ε3 = min{c(uv) − y3(u) − y3(v) : uv ∈ E (G − T3)}= min{1, 3, 2, 5} = 1
26
0-3
5 38 4 57 82
9311 2
4 18
-1 0
5 3
y2
y3(u) = y2(u) + ε2 : u ∈ U \ T2
y3(v) = y2(v) − ε2 : v ∈ V ∩ T2
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
V \ T3
U \ T3
G − T3
ε3 = min{c(uv) − y3(u) − y3(v) : uv ∈ E (G − T3)}= min{1, 3, 2, 5} = 1
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G4
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G4
(0, 5)
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 1) (1, 1)
s
t
(D4, x4, g4) (1, 5) (1, 5)
(0, 5)(0, 5)
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G4
(0, 5)
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 1) (1, 1)
s
t
(D4, x4, g4) (1, 5) (1, 5)
(0, 5)(0, 5)
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
s
t
D44
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G4
(0, 5)
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 1) (1, 1)
s
t
(D4, x4, g4) (1, 5) (1, 5)
(0, 5)(0, 5)
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
t
s
D44
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G4
(0, 5)
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 1) (1, 1)
s
t
(D4, x4, g4) (1, 5) (1, 5)
(0, 5)(0, 5)
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
t
s
D44
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G4
(0, 5)
(0, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(0, 1) (1, 1)
s
t
(D4, x4, g4) (1, 5) (1, 5)
(0, 5)(0, 5)
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
t
s
D44
1
1
5
ǫ4 = min{1, 5, 1}
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G4
(0, 5)
(1, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(1, 1) (1, 1)
s
t
(D4, x5, g4) (1, 5) (1, 5)
(0, 5)(1, 5)
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
t
s
D44
1
1
5
ǫ4 = min{1, 5, 1}
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G4
(0, 5)
(1, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(1, 1) (1, 1)
s
t
(D4, x5, g4) (1, 5) (1, 5)
(0, 5)(1, 5)
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
s
t
D54
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G4
(0, 5)
(1, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(1, 1) (1, 1)
s
t
(D4, x5, g4) (1, 5) (1, 5)
(0, 5)(1, 5)
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
s
t
Z4
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
G4
(0, 5)
(1, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(1, 1) (1, 1)
s
t
(D4, x5, g4) (1, 5) (1, 5)
(0, 5)(1, 5)
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
s
t
Z4
Z. Szigeti OCG-ORCO 2 / 1
Execution of the Hungarian method
V
U
G4
M4,T4 = (U \ Z4) ∪ (V ∩ Z4)
perfect matching of minimum weight
(0, 5)
(1, 1)(1, 1) (1, 1)
(0, 5) (1, 5)(0, 5)
(1, 1)(1, 1)
(1, 1)
(1, 1) (1, 1)
s
t
(D4, x5, g4) (1, 5) (1, 5)
(0, 5)(1, 5)
0-2-4
467 3
-1
5 38 4 57 82
9311 2
4 18
y2
y4(u) = y3(u) + ε3 : u ∈ U \ T3
y4(v) = y3(v) − ε3 : v ∈ V ∩ T3
s
t
Z4
Z. Szigeti OCG-ORCO 2 / 1