Академический Документы
Профессиональный Документы
Культура Документы
Graph Coloring
Malgorzata Marek-Sadowska
Electrical and Computer Engineering Department
Engineering I, room 4111
mms@ece.ucsb.edu. 3-colored 2-colored
256a 1 256a 2
256a 3 256a 4
Planar Graphs
(Heawood, 1890): A map can always be 5-colored.
A C
G H G H
B D
E
F I J I J
W
Reducible configurations
g W
V
V
X
X
Z Y
Z Y
256a 5 256a 6
1
10/5/2010
A C B
A
B D
D C
256a 7 256a 8
Y Z
256a 9 256a 10
T’
256a 11 256a 12
2
10/5/2010
B 10 Y
256a 13 256a 14
B 10 Y B 10 Y
V=min(9,4,7)=4 V=min(9-4,10,13)=5
Current flow F=4 Add new flow, V=8. Current flow F=4+8=12
256a 15 256a 16
B 10/5 Y B 10/5 Y
V=min(12-3,3,13-5)=3
V=min(12-6,10-3,4,10-5,13-8)=4
Add new flow, V=3. Current flow F=12+3=15 Add new flow, V=4. Current flow F=15+4=19
256a 17 256a 18
3
10/5/2010
Finding a flow (cont.) A cut is the set of edges connecting a set of vertices,VS
(including S) to the remaining vertices, VT (including T).
A cut
X
10/7
A
7/7
12/10 3/3
S T VS VT
source sink
9/9 4/0 13/12
B 10/9 Y cut
Max flow =19 The capacity of a cut is the sum of the capacities
of the edges fromVS to VT .
Total capacity of forward edges across the cut is 19.
Stop, the flow is best possible.
256a 19 256a 20
256a 21 256a 22
source 10/7
8/3 3/0 Stop when L(T) = i or no more vertices can be labeled.
7/4
3/0 sink
5/3
256a 23 256a 24
4
10/5/2010
5/3 Repeat.
256a 25 256a 26
F 1
Find maximum matching of workers to jobs 1 Z
1
256a 27 256a 28
U V W X Y Z A U U V W X Y Z A U
A 1 A 1
B V B V
B 1 1 1 S B 1 1 1 S
C 1 T C 1 T
C W C W
D 1 1 D 1 1
D D
E 1 1 X E 1 1 X
F 1 F 1
E E
Y Y
F F
Initial matching Z Improved matching Z
Augmenting path
256a 29 256a 30
5
10/5/2010
256a 31 256a 32
Kuhn’s Algorithm
Step 1. Subtract the smallest element in A from each aij. New matrix A1 Step 2. Find a minimum set Si of lines (rows and columns), ni, which
has all [aij] >=0 and at least one 0. cover all zeros of Ai.
Set i=1. If ni=n, Stop, there are n independent zeros, whose locations
determine final assignment. Calculate the value of assignment
using original costs aij for these locations.
4 3 1 2 6 5 3 4
A= -2 –1 6 8 A1= 0 1 8 10 Step 3. If ni < n, let let ki > 0 denote the smallest element of Ai which is
1 1 2 3 3 3 4 5 not in any line of Si. For each line in Si, add ki to every element
-1 -1 4 1 1 1 6 3 off that
h liline, andd subtract
b ki from
f every element
l off Ai. Call
C ll new
matrix Ai+1.
256a 33 256a 34
6 4 0 1 6 4 0 1
4 3 1 2 6 5 3 4 0 0 5 7
-2 –1 6 8 A3= A4= 0 0 5 7
A= A1= 0 1 8 10 3 2 1 2 2 1 0 1
1 1 2 3 3 3 4 5 1 0 3 0 1 0 3 0
-1 -1 4 1 1 1 6 3
Min aij = -2 n1 = 1, k1 = 1 n3 = 3, k3 = 1 n4 = 3, k4 = 1
5 3 0 0 6 4 0 1
6 4 2 3 6 4 0 1 A5= 0 0 6 7 0 0 5 7
0 0 7 9 A3= 0 0 5 7 1 0 0 0 2 1 0 1
A2=
3 2 3 4 3 2 1 2 1 0 4 0
1 0 5 2 1 0 3 0
n5 = 4
n2 = 2, k2 = 2 n3 = 3, k3 = 1
256a 35 256a 36
6
10/5/2010
Solution
Find 4 independent zeros.
5 3 0 0 6 4 0 51 3 0 0 6 4 0 1
A5= 0 0 6 7 A50= 0 5 0 7 0 6 7 0 0 5 7
1 0 0 0 2 1 0 11 0 0 0 2 1 0 1
1 0 4 0 1 0 4 0
256a 37