Graphs 4 Print PDF
Graphs 4 Print PDF
Graphs 4 Print PDF
V. Adamchik
Graph Theory
Victor Adamchik
Fall of 2005
Plan
1. The Chinese Postman Problem
2. The Traveling Salesman Problem
3. Graph Coloring
V. Adamchik
A
H
B
2
1
C
II
I
4
This picture immitates the mail delivery. A number assigned to an edge represents the time
needed to travel along the edge. Our job is to find a shortest route starting and ending at
vertex A.
The graph does not have an Euler cycle but an Euler path, because there are two vertices of
odd degrees. Therefore in order to cover all edges we will have to retrace edges IC and CF.
This will increrase the total time by 10.
3
A
H
B
2
1
C
II
I
4
49
Is there faster route? Yes, we do not retrace CF, but rather use FE+ED+DC which is shorter
by 1.
V. Adamchik
Generally, it might be not so simple to find a shortest path between two vertices. In this
case we might use Dijkstra's algorithm (15-211).
What if the graph has more than two vertices of odd degree?
In this graph there are four vertices of odd degree B, D, F, H. If we connect two pairs of
these four vertices by two edges, the new graph will have an Euler cycle. It follows that we
need to find the two paths (connecting chosen pairs) with total weight as small as possible.
First we need to list all the ways to put the four odd vertices in two pairs.
Pairing
Path
Weight
Path
Weight
BD && FH
B-A-D
F-E-H
10
BF && DH
B-E-F
D-E-H
12
BH && DF
B-E-H
D-E-F
10
Then, for each set of two pairs we find the shortest path joining the two vertices in each of
the two pairs. Thje first pairing has the samllest total time 18. To find a specific route,
take the given graph and add the retraced streets as multiple edges. Then, find an Euler
circuit for this multigraph.
V. Adamchik
One cycle is a b c f e d a that has a total weight 26. Is there a shorter cycle?
The approximation algorithm. This algorithm does not solve the problem but rather yeilds a
solution which is within a factor of 2 of optimal (in the worst-case).
Here is the alghorithm
Step 1: find a MST.
Step 2: do a DFS of the MST.
V. Adamchik
Graph Coloring
Your mission color the entire map of South America.
1. No country may touch another country of the same color.
2. You will be charged each time you use a color
3. You must color the map as cheaply as possible.
We start with the graph representation: vertices represent countries. Two vertices are adjacent if two countries have a common boarder. So we reduce a problem to vertex coloring.
Adjacent vertices must be colored in different colors.
Definition. The chromatic number of a graph is the least number of colors required to do a
coloring of a graph.
V. Adamchik
3V
6.
By means of this theorem we can prove that K5 is not planar. Indeed, K5 has 5 vertices and
10 edges. By the theorem 10
15
Proof.
a) If the graph has no cycles, E
E
V
E
1
V
V . Also, V
2V
3 or 2 V
E
3V
b) If the graph has a cycle. We will count the number of pairs (edge, face).
e1, F1 , e1, F2 , e2, F1 , e2, F2 , e3, F1 , e3, F2
V. Adamchik
3F
2E
edge, face
2E
or
3F
2E
3V
3F
3E
3V
2E
3E
3V
QED
Corollary
V, E has a vertex of degree less than 6.
3V
V. Adamchik
1
V
deg v
6V
12
V
v V
12
V
We have proved (see Corollary in the previous chapter) that any planar graph has at least
one vertex of degree less than 6. Let us call it v. Remove this vertex v from the graph. By
inductive hypothesis, that new graph G
adjacent vertices to v, there must be a color available to use. This completes the proof.
QED.
Theorem. (Heawood)
Every simple planar graph can be colored with less than or equal to 5 colors.
Proof.
We going to repeat the previous theorem proof to the point where it fails. The proof fails
when a picked vertex v has degree 5. In this case the proof goes as follows. Label the vertices adjacent to v as x1 , x2 , x3 , x4 and x5 . Assume that x4 and x5 are not adjacent to each
other. (the fact that not all xk joined by edges follows from the observation that if the are
then the graph of these 6 vertices will be K5 which is not planar).
V. Adamchik
We obtain a new graph H with two less vertices. By inductive hypothesis we can color it
with 5 colors.
Next we color vertices in our original graph G with the same coloring as for H, except
vertices v, x4 , x5 . We assign y's color to vertices x4 and x5 (remember they are not adjacent). We give v a color different from all colors used on the four vertices x1 , x2 , x3 and y
QED.