Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Zeph Grunschlag
Agenda
Euler paths and cycles Hamilton paths and cycles Planar graphs
Graph Coloring
L25
L25
L25
L25
1 start 4 5
L25
2 3 6 finish
L25
L25
Implications to CS
Finding Hamilton paths is a very important problem in CS. EG: Visit every city (vertex) in a region using the least trips (edges) as possible. EG: Encode all bit strings of a certain length as economically as possible so that only change one bit at a time. (Gray codes).
L25 11
Implications to CS
Analyzing difficulty of Euler vs. Hamilton paths is a great CS case study. Finding Euler paths can be done in O (n) time Finding Hamilton paths is NPcomplete! Slight change in definition can result in dramatic algorithmic bifurcation!
L25 12
L25
14
L25
15
Since deg(v ) > 1 (all degrees are even), another edge e must be incident with v :
L25
17
L25
20
L25
21
L25
22
L25
23
L25
24
L25
25
L25
26
Amalgamate these cycles together from a point of intersection, and delete from graph:
L25 27
2 3
2 3
1 4
2 3
1 4 5
2 3
1 4 5
7
2 3 1 4 5 6
7
2 3 1 4 5 6
9 2 3 1 4
7
5 6
10
2 3 1 4 5
7
6
10
2 3 1 11 4 5
7
6
10
2 3 1 11 4 5
7
6
Amalgamate it to Euler cycle of deleted graph, and delete it. Need to insert cycle between former edges 10 & 11:
L25 39
10
2 3 1 ?? 4 5
7
6
10
2 3 1 ?? 4 11 5
7
6
10
2 3 1 ?? 4 11
12
7
5 6
10
2 3 1 ??
7
6
10
2 3 1 ?? 4
14 11
13 12
7
6
10
2 3 1 15 4
14 11
13 12
7
6
10
2 3 1 15 4
14 11
13 12
7
6
Amalgamate the triangle cycle between edges formerly labeled 9 & 10:
L25 46
??
2 3 1 ?? 4
?? ??
?? ??
7
6
Amalgamate the triangle cycle between edges formerly labeled 9 & 10:
L25 47
11
2
12
13
18 4
1 3
17 14
16 15
7
6
L25
48
L25
50
7
5
Generalize:
L25 55
L25
56
L25
57
Planar Graphs
Planar graphs are graphs that can be drawn
in the plane without edges having to cross. Understanding planar graph is important: Any graph representation of maps/ topographical information is planar.
L25
59
L25
60
L25
61
L25
62
L25
63
L25
64
L25
65
L25
66
L25
67
L25
68
Proving Planarity
To prove that a graph is planar amounts to redrawing the edges in a way that no edges will cross. May need to move vertices around and the edges may have to be drawn in a very indirect fashion. E.G. show that the 3-cube is planar:
L25 69
L25
70
Disproving Planarity
The book gives several methods. Ill describe one method that will always work in examples that youll get on the final. You may also use any of the methods that the book mentions. (One method Kuratowskis theorem in principle always works, though in practice can be quite unwieldy.)
L25 72
Disproving Planarity
The idea is to try to find some invariant quantities possessed by graphs which are constrained to certain values, for planar graphs. Then to show that a graph is non-planar, compute the quantities and show that they do not satisfy the constraints on planar graphs.
L25
73
Regions
The first invariant of a planar graph will be the number of regions that the graph defines in the plane. A region is a part of the plane completely disconnected off from other parts of the plane by the edges of the graph. EG: the car graph has 4 regions:
4
L25
3 1 2
74
Regions
Q: How many regions does the 3-cube have?
L25
75
Regions
A: 6 regions
3
4 1 5 2
L25
76
Regions
THM: The number of regions defined by a connected planar graph is invariant of how it is drawn in the plane and satisfies the formula involving edges and vertices: r = |E | - |V | + 2 EG: Verify formula for car and 3-cube:
4=6-4+2
L25
6=12-8+2
2
3
4 1 5
77
Euler Characteristic
The formula is proved by showing that the quantity (chi) c = r - |E | + |V | must equal 2 for planar graphs. c is called the Euler characteristic. The idea is that any connected planar graph can be built up from a vertex through a sequence of vertex and edge additions. For example, build 3-cube as follows:
L25 78
Euler Characteristic
L25
79
Euler Characteristic
Thus to prove that c is always 2 for planar graphs, one calculate c for the trivial vertex graph: c = 1-0+1 = 2 and then checks that each possible move does not change c .
L25
80
Euler Characteristic
Check that moves dont change c : EG: 1) Adding a degree 1 vertex: r is unchanged. |E | increases by 1. |V | increases by 1. c += (0-1+1) 2) Adding an edge between pre-existing vertices:
EG:
r increases by 1. |E | increases by 1. |V |
unchanged. c += (1-1+0)
L25 81
|V | 1
|E | 0
r
1
L25
82
|V | 2
|E | 1
r
1
L25
83
|V | 3
|E | 2
r
1
L25
84
|V | 4
|E | 3
r
1
L25
85
|V | 4
|E | 4
r
2
L25
86
|V | 5
|E | 5
r
2
L25
87
|V | 6
|E | 6
r
2
L25
88
|V | 7
|E | 7
r
2
L25
89
|V | 8
|E | 8
r
2
L25
90
|V | 8
|E | 9
r
3
L25
91
|V | 8
|E | 10
r
4
L25
92
|V | 8
|E | 11
r
5
L25
93
|V | 8
|E | 12
r
6
L25
94
Face-Edge Handshaking
For all graphs handshaking theorem relates degrees of vertices to number of edges. For planar graphs, can relate regions to edges in similar fashion: EG: There are two ways to count the number of edges in 3-cube: 1) Count directly: 12 2) Count no. of edges around each region; divide by 2: (4+4+4+4+4+4)/2 = 12 (2 triangles per edge)
Face-Edge Handshaking
DEF: The degree of a region F is the number of edges at its boundary, and is denoted by deg(F ). THM: Let G be a planar graph with region set R. Then:
1 | E | deg( F ) 2 FR
L25 96
Girth
The girth of a graph is the length of the smallest simple cycle in the graph. Q: What the girth of each of the following?
L25
97
Girth
A: g=2
g=4
g=4
Q: What the smallest possible girth for L25 simple bipartite graphs?
98
Girth
A: g = 4 is the smallest possible girth: Any cycle must start and end in the same color, so must have even length. Since simple, cannot have a 2-cycle, so 4-cycle is shortest possible.
L25
99
In our case, this give |E | 184=36 contradicting |E | = 32 ! Thus 4-cube cannot be planar. 101 L25
1 1 1 | E | deg( F ) g rg 2 FR 2 FR 2
1) K5 2) K3,3 3) Qn for n 4
L25
102
Graph Coloring
Consider a fictional continent.
L25
103
Map Coloring
Suppose removed all borders but still wanted to see all the countries. 1 color insufficient.
L25
104
Map Coloring
So add another color. Try to fill in every country with one of the two colors.
L25
105
Map Coloring
So add another color. Try to fill in every country with one of the two colors.
L25
106
Map Coloring
So add another color. Try to fill in every country with one of the two colors.
L25
107
Map Coloring
So add another color. Try to fill in every country with one of the two colors.
L25
108
Map Coloring
PROBLEM: Two adjacent countries forced to have same color. Border unseen.
L25
109
Map Coloring
So add another color:
L25
110
Map Coloring
Insufficient. Need 4 colors because of this country.
L25
111
Map Coloring
With 4 colors, could do it.
L25
112
4-Color Theorem
THM: Any planar map of regions can be depicted using 4 colors so that no two regions that share a positive-length border have the same color. Proof by Haaken and Appel used exhaustive computer search.
L25
113
L25
114
L25
115
L25
116
L25
117
Dual Graphs :
L25
118
Dual Graphs :
L25
119
Vertices of G ^: V (G ^ ) = R Edges of G ^: E (G ^ ) = set of edges of the form {F1,F2} where F1 and F2 share a common edge.
L25
120
L25
121
L25
122
Definition of Colorable
DEF: Let n be a positive number. A simple graph is n -colorable if the vertices can be colored using n colors so that no two adjacent vertices have the same color. The chromatic number of a graph is smallest number n for which it is n colorable. EG: A graph is bipartite iff it is 2-colorable.
L25 123
L25
124
L25
125
L25
126
L25
127
3261
4115
1007
3157
L25
4118
4156
129
L25
130
L25
131
L25
132
4118
L25
133
4118
L25
134
4118
L25
135
4118
L25
136
4118
L25
137
4118
L25
138
4118
L25
139
4118
L25
140
Slot 2
4115
Slot 1
1007 3157 4156
4118
Slot 3
141
L25