Numbers: Real, Imaginary, Complex, and beyond

Download Report

Transcript Numbers: Real, Imaginary, Complex, and beyond

Graph Theory: Solved and
Unsolved Problems
Roger House
Scientific Café
Coffee Catz
Sebastopol, CA
2010 April 22
Copyright © 2010 Roger House
1
What we're going to talk about
• Graphs
– What's a graph?
– What's a graph good for?
• Graph problems
– The Königsberg bridge problem
– The planarity problem
– The Traveling Salesman Problem (TSP)
2
What's a graph?
3
Remember these graphs?
4
And these?
5
And graphs you can eat
6
None of these graphs are the
kinds of graphs we're interested
in at the moment
7
A different kind of graph
We're going to deal with much different
kinds of graphs, namely, mathematical
graphs.
8
Definition of a graph
Definition: A graph G consists of a finite
nonempty set V of vertices together with a
set E of unordered pairs of distinct vertices
of V. The pair e = {u,v} of vertices in E is
called an edge of G.
9
There will be a quiz on the
definition
10
There will be a quiz on the
definition
But not on the one above
11
There will be a quiz on the
definition
But not on the one above
On the one below
12
A friendlier definition
A graph is dots connected by lines.
13
Fancy terminology

The dots are called vertices.

(Or points, or nodes, or ...)
14
Fancy terminology

The dots are called vertices.


(Or points, or nodes, or ...)
The lines are called edges.

(The graph above has 7 vertices and 9 edges.)
15
Fancy terminology

The dots are called vertices.


The lines are called edges.


(Or points, or nodes, or ...)
(The graph above has 7 vertices and 9 edges.)
Two vertices connected by an edge are
adjacent.
16
Fancy terminology

The dots are called vertices.


The lines are called edges.



(Or points, or nodes, or ...)
(The graph above has 7 vertices and 9 edges.)
Two vertices connected by an edge are
adjacent.
An edge is incident with its two vertices.
17
Fancy terminology

The dots are called vertices.


The lines are called edges.




(Or points, or nodes, or ...)
(The graph above has 7 vertices and 9 edges.)
Two vertices connected by an edge are
adjacent.
An edge is incident with its two vertices.
The degree of a vertex is the number of
edges incident with the vertex.
18
Complete graphs
19
Bipartite graphs
20
More graphs
21
Yet more graphs
22
What's a graph good for?
23
Road network graph
24
The vertices in G are intersections,
protection points, and entrance
points.
Modeling an electrical circuit
26
#include structure
27
Function call graph
28
Unix family tree
29
Are there enough graphs?
# vertices
1
2
3
# graphs
1
2
4
30
Are there enough graphs?
# vertices
1
2
3
4
#graphs
1
2
4
11
31
Are there enough graphs?
# vertices
1
2
3
4
5
#graphs
1
2
4
11
34
32
Are there enough graphs?
# vertices
1
2
3
4
5
6
#graphs
1
2
4
11
34
156
33
Are there enough graphs?
# vertices
1
2
3
4
5
6
7
#graphs
1
2
4
11
34
156
1044
34
Are there enough graphs?
# vertices
1
2
3
4
5
6
7
8
#graphs
1
2
4
11
34
156
1044
12,346
35
Are there enough graphs?
# vertices
1
2
3
4
5
6
7
8
9
#graphs
1
2
4
11
34
156
1044
12,346
274,668
36
Are there enough graphs?
# vertices
#graphs
1
1
2
2
3
4
4
11
5
34
6
156
7
1044
8
12,346
9
274,668
10
12,005,168
37
The Königsberg bridge problem
38
What's the problem?
Where: Königsberg, Prussia
(now Kaliningrad, Russia)
When: Early 1700's
What: How to start at one place, cross each
bridge exactly once, and end up back
where you started from
39
Abstracting a bit
40
More abstraction
41
The essence of the problem
42
A graph problem
Pick any vertex V as a start vertex.
43
A graph problem
Pick any vertex V as a start vertex.
Pick any edge incident to V which has not yet
been traveled, and travel along it to another
vertex, marking the edge as traveled.
44
A graph problem
Pick any vertex V as a start vertex.
Pick any edge incident to V which has not yet
been traveled, and travel along it to another
vertex, marking the edge as traveled.
Keep traveling from vertex to vertex along
untraveled edges, marking the edges as
traveled, until you return to V and all edges
have been traveled exactly once.
45
Euler to the rescue
Leonhard Euler (1707-1783), a Swiss
mathematician discovered everything.
46
Euler to the rescue
Leonhard Euler (1707-1783), a Swiss
mathematician discovered everything.
Well, almost everything.
47
Euler to the rescue
In 1735 Euler proved that the problem has no
solution.
48
Euler to the rescue
In 1735 Euler proved that the problem has no
solution.
He proved more: If a connected graph has a
closed eulerian circuit, then the degree of
every vertex is even.
49
Are the degrees all even?
50
Say we add a couple of bridges
51
Now is there an eulerian circuit?
The degree of each vertex is even
52
Now is there an eulerian circuit?
The degree of each vertex is even
So Euler's theorem tells us there is an
eulerian circuit, right?
53
Now is there an eulerian circuit?
The degree of each vertex is even
So Euler's theorem tells us there is an
eulerian circuit, right?
NO! NO! NO!
54
Avoid logical pitfalls
“A implies B” does NOT mean that
“B implies A”
So the fact that all the vertex degrees are
even does not tell us that an eulerian circuit
exists.
But one might exist anyway.
55
Can you find an eulerian circuit?
56
Here's one
3
7
4
6
5
8
9
1
2
57
Hierholzer to the rescue
Carl Hierholzer (1840-1871), a German
mathematician, published a paper in 1873
proving the converse of Euler's theorem:
58
Hierholzer to the rescue
Carl Hierholzer (1840-1871), a German
mathematician, published a paper in 1873
proving the converse of Euler's theorem:
If the degree of every vertex of a connected
graph is even, then the graph has a closed
eulerian circuit.
59
Hierholzer to the rescue
So now it's really easy to tell if a graph has a
closed eulerian circuit or not.
60
Hierholzer to the rescue
So now it's really easy to tell if a graph has a
closed eulerian circuit or not.
Just look at the degree of every vertex.
61
Hierholzer to the rescue
So now it's really easy to tell if a graph has a
closed eulerian circuit or not.
Just look at the degree of every vertex.
If all the degrees are even then a closed
eulerain circuit exists. If one or more
vertices has odd degree, then no eulerian
circuit exist.
62
You call that “rescue”?
So, once we know a closed eulerian circuit
exists, how do we find it?
63
You call that “rescue”?
So, once we know a closed eulerian circuit
exists, how do we find it?
Hierholzer's theorem tells us nothing about
how to find a closed eulerian circuit.
64
You call that “rescue”?
So, once we know a closed eulerian circuit
exists, how do we find it?
Hierholzer's theorem tells us nothing about
how to find a closed eulerian circuit.
We can be assured that at least one exists,
but we don't have a clue how to find one.
65
Some terminology
If more than one edge connects distinct
vertices u and v, then we have a
multigraph.
66
Some terminology
If more than one edge connects distinct
vertices u and v, then we have a
multigraph.
The Königsberg Bridges graph is a
multigraph.
67
Some terminology
If there is at most one edge between any two
distinct vertices, we have a simple graph.
68
Some terminology
If there is at most one edge between any two
distinct vertices, we have a simple graph.
From now we consider only simple graphs.
69
The planarity problem
Some graphs are planar, which means they
can be drawn in a “nice” way
70
Some planar graphs
71
Definition of a planar graph
A graph is planar if it can be drawn in the
plane in such a way that
72
Definition of a planar graph
A graph is planar if it can be drawn in the
plane in such a way that
–
Each vertex is a distinct point in the
plane
73
Definition of a planar graph
A graph is planar if it can be drawn in the
plane in such a way that
–
–
Each vertex is a distinct point in the
plane
Edges do not cross – in fact, two edges
touch if and only if they have a common
vertex, in which case they touch only at
that vertex
74
Definition of a planar graph
A graph is planar if it can be drawn in the
plane in such a way that
–
–
–
Each vertex is a distinct point in the
plane
Edges do not cross – in fact, two edges
touch if and only if they have a common
vertex, in which case they touch only at
that vertex
An edge does not touch any vertices
except the two at its endpoints
75
Some planar graphs again
76
Is this graph (K4) planar?
77
Yes, K4 is planar
78
A bit nicer drawing
79
Is this graph (K5-e) planar?
B
A
C
D
E
80
Redraw K5-e, swapping C and
D
B
B
A
C
D
E
A
D
C
E
81
Yes, K5-e is planar
B
B
A
D
C
E
A
D
C
E
82
Is this graph (K5) planar?
B
A
C
D
E
83
No, K5 is not planar
B
B
A
C
D
E
A
C
D
E
84
Not so fast
How do we know K5 is nonplanar?
85
Not so fast
How do we know K5 is nonplanar?
Just because we have nonplanar
drawings of it does not mean that no
planar drawing exists.
86
Not so fast
Maybe we just haven't been clever enough
to find a planar drawing.
87
Not so fast
Maybe we just haven't been clever enough
to find a planar drawing.
Trust me, K5 is nonplanar
88
Is this graph (K3,3) planar?
This graph is also called the Utility
Graph. Think of connecting three
utilities, gas, water, and electric,
to three houses without any of the
lines crossing. Can it be done?
89
No, K3,3 is not planar
90
Not so fast (again)
Again, you should be asking, “How do we
know K3,3 is nonplanar?”
91
Not so fast (again)
Again, you should be asking, “How do we
know K3,3 is nonplanar?”
Again, you'll just have to trust me on
this.
92
Not so fast (again)
Again, you should be asking, “How do we
know K3,3 is nonplanar?”
Again, you'll just have to trust me on
this.
Or, look at Dots and Lines by Richard J.
Trudeau.
93
How to tell if a graph is planar?
At this point we know that K5 and K3,3 are
nonplanar (that is, if you trust me)
But, in general, given any old graph,
how to tell if it is planar or nonplanar?
For example ...
94
Which of these is planar?
95
Which of these is planar?
None of these graphs is planar.
How do we know?
How can we be sure?
Let's carefully examine the first one ...
96
Petersen's graph
After Julius Petersen (1839-1910), a
Danish mathematician, who presented it in 1898 (although it had
already been published in 1886).
Donald Knuth says the Petersen
graph is "a remarkable configuration that serves as a counterexample to many optimistic
predictions about what might be
true for graphs in general."
97
K3,3 is hiding in Petersen's
graph
98
K3,3 is hiding in Petersen's
graph
99
K3,3 is hiding in Petersen's
graph
100
K3,3 is hiding in Petersen's
graph
101
K3,3 is hiding in Petersen's
graph
102
K3,3 is hiding in Petersen's
graph
103
K3,3 is hiding in Petersen's
graph
104
So?
We have shown that K3,3 is “contained” in
Petersen's graph.
105
So?
We have shown that K3,3 is “contained” in
Petersen's graph.
So what?
106
So?
We have shown that K3,3 is “contained” in
Petersen's graph.
So what?
So, that proves that Petersen's graph is
nonplanar.
107
How so?
Say that Petersen's graph is planar.
108
How so?
Say that Petersen's graph is planar.
Then we can draw it with no edge
crossings.
109
How so?
Say that Petersen's graph is planar.
Then we can draw it with no edge
crossings.
Now, remove the four vertices and six
edges as we did above, and what have
we got?
110
How so?
A planar drawing of K3,3.
111
How so?
A planar drawing of K3,3.
BUT, K3,3 is nonplanar, so a planar
drawing does not exist, so we have a
contra-diction.
112
How so?
A planar drawing of K3,3.
But, K3,3 is nonplanar, so a planar drawing
does not exist, so we have a contradiction.
Thus the original assumption that
Petersen's graph is planar is false.
113
A test for nonplanarity
We can generalize the above proof that
Petersen's graph is nonplanar:
114
A test for nonplanarity
We can generalize the above proof that
Petersen's graph is nonplanar:
If a graph G “contains” a nonplanar
graph, then G is nonplanar also.
115
A test for nonplanarity
We can generalize the above proof that
Petersen's graph is nonplanar:
If a graph G “contains” a nonplanar
graph, then G is nonplanar also.
But, it gets even better ...
116
Kuratowski to the rescue
In 1930 Kuratowski (1896-1980) proved:
A graph is planar if and only if it does not
“contain” K3,3 or K5.
117
Kuratowski to the rescue
So every nonplanar graph “contains” K3,3
or K5.
118
Kuratowski to the rescue
So every nonplanar graph “contains” K3,3
or K5.
And no planar graph contains K3,3 or K5.
119
K3,3 and K5
120
Now prove these are nonplanar
121
The Traveling Salesman
Problem
A salesman's territory covers the city he
lives in and 4 other cities.
122
The Traveling Salesman
Problem
A salesman's territory covers the city he
lives in and 4 other cities.
The salesman starts from his city and
visits one of the other cities, and from
that city he visits a third city, etc., until he
arrives back home, having visited each
of the 5 cities exacty once.
123
The Traveling Salesman
Problem
A salesman's territory covers the city he
lives in and 4 other cities.
The salesman starts from his city and
visits one of the other cities, and from
that city he visits a third city, etc., until he
arrives back home, having visited each
of the 5 cities exacty once.
How to pick a shortest tour?
124
What is the shortest tour?
D
44
7
E
25
C 0
632
250
608
403
47
2
447
640
A
300
B
125
Shortest tour = ABDCE (1855)
D
44
7
E
25
C 0
632
250
608
403
47
2
447
640
A
300
B
126
How to find the shortest tour?
Here's one way to do it:
list all possible tours
add up the edge distances for each tour
pick the tour with smallest total distance
127
Try ABCDE
D
44
7
E
300
472
25
C 0
250
632
447
250
608
447
403
1916
47
2
447
640
A
300
B
128
Lengths of all tours
ABCDE:
ABCED:
ABDCE:
ABDEC:
ABECD:
ABEDC:
1916
2101
1855
2009
2073
2041
ACBDE:
ACBED:
ADBCE:
ADBEC:
AEBCD:
AEBDC:
2378
2595
2410
2534
2442
2349
129
Tours sorted by length
ABDCE:
ABCDE:
ABDEC:
ABEDC:
ABECD:
ABCED:
1855
1916
2009
2041
2073
2101
AEBDC:
ACBDE:
ADBCE:
AEBCD:
ADBEC:
ACBED:
2349
2378
2410
2442
2534
2595
130
Longest tour = ACBED (2595)
D
44
7
E
25
C 0
632
250
608
403
47
2
447
640
A
300
B
131
How many tours are there?
n # edges = n(n-1)/2
# tours = (n-1)!/2
-----------------------------------------------------------5 10
12
6 15
60
7 21
360
8 28
2,520
9 36
20,160
10 45
181,440
15 105
43,589,145,600
20 190
60,822,550,204,416,000
25 300
310,224,200,866,619,719,680,000
132
How long to check all the tours?
Fastest computer today does 360*1012
operations per second.
133
How long to check all the tours?
Fastest computer today does 360*1012
operations per second.
Round this up to 1000*1012 = 1015
operations per second.
134
How long to check all the tours?
Fastest computer today does 360*1012
operations per second.
Round this up to 1000*1012 = 1015
operations per second.
Assume 1015 tours can be checked in 1
second.
135
How long to check all the tours?
How long will it take to check
310,224,200,866,619,719,680,000 tours?
136
How long to check all the tours?
How long will it take to check
310,224,200,866,619,719,680,000 tours?
310,224,200,866,619,719,680,000 / 1015
137
How long to check all the tours?
How long will it take to check
310,224,200,866,619,719,680,000 tours?
310,224,200,866,619,719,680,000 / 1015
= 310,224,201 seconds
138
How long to check all the tours?
How long will it take to check
310,224,200,866,619,719,680,000 tours?
310,224,200,866,619,719,680,000 / 1015
= 310,224,201 seconds
= 9.837 years
139
How long to check all the tours?
How long will it take to check
310,224,200,866,619,719,680,000 tours?
310,224,200,866,619,719,680,000 / 1015
= 310,224,201 seconds
= 9.837 years
= 9 years, 10 months
140
Bad news
•
Obviously the method we have used to
solve the TSP is no good at all for rather
small problems, e.g., 25 cities.
141
Bad news
•
•
Obviously the method we have used to
solve the TSP is no good at all for rather
small problems, e.g., 25 cities.
We want an efficient procedure, which
means a process that does not grow
exponentially with the number of cities.
142
Bad news
•
•
•
Obviously the method we have used to
solve the TSP is no good at all for rather
small problems, e.g., 25 cities.
We want an efficient procedure, which
means a process that does not grow
exponentially with the number of cities.
Here's the bad news: No such
procedure is known.
143
Bad news
•
•
•
•
Obviously the method we have used to
solve the TSP is no good at all for rather
small problems, e.g., 25 cities.
We want an efficient procedure, which
means a process that does not grow
exponentially with the number of cities.
Here's the bad news: No such
procedure is known.
Finding an efficient procedure for solving
TSP in general is an unsolved problem 144
Good news
•
However, this does not mean that we
can't handle 25 cities.
145
Good news
•
•
However, this does not mean that we
can't handle 25 cities.
There are clever algorithms which make
it possible to handle very large cases.
146
Good news
•
•
•
However, this does not mean that we
can't handle 25 cities.
There are clever algorithms which make
it possible to handle very large cases.
For example, consider this figure from a
book by David Applegate, Robert Bixby,
Vasek Chvatal and William Cook:
147
A large solved tour
13,509 towns in the US with pop. > 500
148
Bad news, again
•
Despite success on various practical
cases, from a mathematical point of
view, the problem of finding an efficient
process for solving the Traveling
Salesman Problem is unsolved.
149
Good news, again
According to David Hilbert (1862-1943):
“As long as a branch of science offers an
abundance of problems, so long is it
alive; a lack of problems foreshadows
extinction or the cessation of
independent development.”
150
Good news, again
According to David Hilbert (1862-1943):
“As long as a branch of science offers an
abundance of problems, so long is it
alive; a lack of problems foreshadows
extinction or the cessation of
independent development.”
According to the Everly Brothers:
“Problems, problems, problems all day long”
151