street-routing problems - lecture 29 sections...
TRANSCRIPT
Street-Routing ProblemsLecture 29
Sections 5.2
Robb T. Koether
Hampden-Sydney College
Mon, Apr 6, 2015
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 1 / 29
1 Street-Routing ProblemsThe Security Guard ProblemThe Mail Carrier ProblemThe Königsberg ProblemThe Bridges of Madison County Problem
2 Examples
3 Euler Paths and Circuits
4 Definitions
5 Euler’s Theorems
6 Assignment
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 2 / 29
Outline
1 Street-Routing ProblemsThe Security Guard ProblemThe Mail Carrier ProblemThe Königsberg ProblemThe Bridges of Madison County Problem
2 Examples
3 Euler Paths and Circuits
4 Definitions
5 Euler’s Theorems
6 Assignment
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 3 / 29
Street-Routing Problems
We have already considered the Traveling Salesman Problem.There are many other problems that would fall under the heading“Street-Routing Problems.”We will consider four of them.
The Security Guard ProblemThe Mail Carrier ProblemThe Königsberg Bridge ProblemThe Bridges of Madison County
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 4 / 29
Street-Routing Problems
We have already considered the Traveling Salesman Problem.There are many other problems that would fall under the heading“Street-Routing Problems.”We will consider four of them.
The Security Guard Problem
The Mail Carrier ProblemThe Königsberg Bridge ProblemThe Bridges of Madison County
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 4 / 29
Street-Routing Problems
We have already considered the Traveling Salesman Problem.There are many other problems that would fall under the heading“Street-Routing Problems.”We will consider four of them.
The Security Guard ProblemThe Mail Carrier Problem
The Königsberg Bridge ProblemThe Bridges of Madison County
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 4 / 29
Street-Routing Problems
We have already considered the Traveling Salesman Problem.There are many other problems that would fall under the heading“Street-Routing Problems.”We will consider four of them.
The Security Guard ProblemThe Mail Carrier ProblemThe Königsberg Bridge Problem
The Bridges of Madison County
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 4 / 29
Street-Routing Problems
We have already considered the Traveling Salesman Problem.There are many other problems that would fall under the heading“Street-Routing Problems.”We will consider four of them.
The Security Guard ProblemThe Mail Carrier ProblemThe Königsberg Bridge ProblemThe Bridges of Madison County
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 4 / 29
Outline
1 Street-Routing ProblemsThe Security Guard ProblemThe Mail Carrier ProblemThe Königsberg ProblemThe Bridges of Madison County Problem
2 Examples
3 Euler Paths and Circuits
4 Definitions
5 Euler’s Theorems
6 Assignment
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 5 / 29
The Security Guard Problem
Example (The Security Guard Problem)
A security guard must patrol every street of the neighborhood.What route should he follow to minimize the total distance?Must he walk some streets twice?
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 6 / 29
Outline
1 Street-Routing ProblemsThe Security Guard ProblemThe Mail Carrier ProblemThe Königsberg ProblemThe Bridges of Madison County Problem
2 Examples
3 Euler Paths and Circuits
4 Definitions
5 Euler’s Theorems
6 Assignment
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 7 / 29
The Mail Carrier Problem
Example (The Mail Carrier Problem)
A mail carrier must deliver mail to both sides of every street of theneighborhood, except the boundary.What route should he follow to minimize the total distance?Must he walk some streets twice?
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 8 / 29
Outline
1 Street-Routing ProblemsThe Security Guard ProblemThe Mail Carrier ProblemThe Königsberg ProblemThe Bridges of Madison County Problem
2 Examples
3 Euler Paths and Circuits
4 Definitions
5 Euler’s Theorems
6 Assignment
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 9 / 29
The Königsberg Problem
Example (The Königsberg Problem)
A Königsberger would like to take a stroll across the sevenbridges.Can it be done without ever crossing the same bridge twice?Does it matter where the stroller starts?
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 10 / 29
Outline
1 Street-Routing ProblemsThe Security Guard ProblemThe Mail Carrier ProblemThe Königsberg ProblemThe Bridges of Madison County Problem
2 Examples
3 Euler Paths and Circuits
4 Definitions
5 Euler’s Theorems
6 Assignment
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 11 / 29
The Bridges of Madison County Problem
Example (The Bridges of Madison County Problem)
A photographer wants to photograph each of the 11 bridges ofMadison County.He must cross the bridge to photograph it and each bridge has a$5 toll.What route will minimize the total cost?
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 12 / 29
The Bridges of Madison County Problem
Example (The Bridges of Madison County Problem)
8
7
9
6
10
5
1143
2
1
A photographer wants to photograph each of the 11 bridges ofMadison County.He must cross the bridge to photograph it and each bridge has a$5 toll.What route will minimize the total cost?
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 13 / 29
Outline
1 Street-Routing ProblemsThe Security Guard ProblemThe Mail Carrier ProblemThe Königsberg ProblemThe Bridges of Madison County Problem
2 Examples
3 Euler Paths and Circuits
4 Definitions
5 Euler’s Theorems
6 Assignment
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 14 / 29
Example
Example (The Security Guard Problem)
In the Security Guard Problem, we want a path that traversesevery edge at least once and has the minimal total length.
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 15 / 29
Example
Example (The Mail Carrier Problem)
In the Mail Carrier Problem, we want a path that traverses everyedge at least twice (except the boundary) and has the minimaltotal length.With the duplicated edges, the Mail Carrier Problem is the sameas the Security Guard Problem.
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 16 / 29
Example
Example (The Bridges of Königsberg Problem)
In the Bridges of Königsberg Problem, we want a circuit thattraverses each edge exactly once.
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 17 / 29
Example
Example (The Bridges of Königsberg Problem)
We draw a graph that shows only the relevant parts.
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 18 / 29
Example
Example (The Bridges of Madison County Problem)
In the Bridges of Madison County Problem, we want a circuit thattraverses each edge at least once and has the minimal totallength.This is the same as the Security Guard Problem.
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 19 / 29
Outline
1 Street-Routing ProblemsThe Security Guard ProblemThe Mail Carrier ProblemThe Königsberg ProblemThe Bridges of Madison County Problem
2 Examples
3 Euler Paths and Circuits
4 Definitions
5 Euler’s Theorems
6 Assignment
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 20 / 29
Euler Paths and Circuits
Definition (Euler Path)An Euler path (pronounced "oiler") is a path that traverses each edgeexactly once.
Definition (Euler Circuit)An Euler circuit is an Euler path that is a circuit.
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 21 / 29
Euler Paths and Circuits
8
7
9
6
10
5
1143
2
1
In the Bridges of Königsberg Problem, we seek an Euler path andan Euler circuit.
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 22 / 29
Outline
1 Street-Routing ProblemsThe Security Guard ProblemThe Mail Carrier ProblemThe Königsberg ProblemThe Bridges of Madison County Problem
2 Examples
3 Euler Paths and Circuits
4 Definitions
5 Euler’s Theorems
6 Assignment
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 23 / 29
Definitions
Definition (Connected)A graph is connected if, for any two vertices, there is a path from oneto the other.
Definition (Even and Odd Vertices)A vertex is even if an even number of edges emanate from it.Otherwise, it is odd.
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 24 / 29
Outline
1 Street-Routing ProblemsThe Security Guard ProblemThe Mail Carrier ProblemThe Königsberg ProblemThe Bridges of Madison County Problem
2 Examples
3 Euler Paths and Circuits
4 Definitions
5 Euler’s Theorems
6 Assignment
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 25 / 29
Euler’s Theorems
Theorem (Euler Circuits)If a graph is connected and every vertex is even, then it has an Eulercircuit. Otherwise, it does not have an Euler circuit.
Theorem (Euler Paths)If a graph is connected and it has exactly 2 odd vertices, then it has anEuler path. If it has more than 2 odd vertices, then it does not have anEuler path.
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 26 / 29
Connected and Disconnected
Connected Disconnected
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 27 / 29
Outline
1 Street-Routing ProblemsThe Security Guard ProblemThe Mail Carrier ProblemThe Königsberg ProblemThe Bridges of Madison County Problem
2 Examples
3 Euler Paths and Circuits
4 Definitions
5 Euler’s Theorems
6 Assignment
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 28 / 29
Assignment
AssignmentChapter 5: Exercises 19, 20, 21, 22, 27.
Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Mon, Apr 6, 2015 29 / 29