32
Street-Routing Problems Lecture 26 Sections 5.1 - 5.2 Robb T. Koether Hampden-Sydney College Wed, Oct 25, 2017 Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 1 / 21

Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Street-Routing ProblemsLecture 26

Sections 5.1 - 5.2

Robb T. Koether

Hampden-Sydney College

Wed, Oct 25, 2017

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 1 / 21

Page 2: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

1 Street-Routing Problems

2 Definitions

3 Examples

4 Assignment

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 2 / 21

Page 3: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Outline

1 Street-Routing Problems

2 Definitions

3 Examples

4 Assignment

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 3 / 21

Page 4: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Street-Routing Problems

There are many problems that fall under the heading“Street-Routing Problems.”We will consider five of them.

The Security Guard ProblemThe Mail Carrier ProblemThe Königsberg Bridge Problem (famous)The Bridges of Madison CountyThe Traveling Salesman Problem (famous)

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

Page 5: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Street-Routing Problems

There are many problems that fall under the heading“Street-Routing Problems.”We will consider five of them.

The Security Guard Problem

The Mail Carrier ProblemThe Königsberg Bridge Problem (famous)The Bridges of Madison CountyThe Traveling Salesman Problem (famous)

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

Page 6: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Street-Routing Problems

There are many problems that fall under the heading“Street-Routing Problems.”We will consider five of them.

The Security Guard ProblemThe Mail Carrier Problem

The Königsberg Bridge Problem (famous)The Bridges of Madison CountyThe Traveling Salesman Problem (famous)

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

Page 7: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Street-Routing Problems

There are many problems that fall under the heading“Street-Routing Problems.”We will consider five of them.

The Security Guard ProblemThe Mail Carrier ProblemThe Königsberg Bridge Problem (famous)

The Bridges of Madison CountyThe Traveling Salesman Problem (famous)

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

Page 8: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Street-Routing Problems

There are many problems that fall under the heading“Street-Routing Problems.”We will consider five of them.

The Security Guard ProblemThe Mail Carrier ProblemThe Königsberg Bridge Problem (famous)The Bridges of Madison County

The Traveling Salesman Problem (famous)

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

Page 9: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Street-Routing Problems

There are many problems that fall under the heading“Street-Routing Problems.”We will consider five of them.

The Security Guard ProblemThe Mail Carrier ProblemThe Königsberg Bridge Problem (famous)The Bridges of Madison CountyThe Traveling Salesman Problem (famous)

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 4 / 21

Page 10: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

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 Wed, Oct 25, 2017 5 / 21

Page 11: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

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 (same side) twice?

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 6 / 21

Page 12: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

The Königsberg Problem

Example (The Königsberg Problem)

A Königsberger would like to take a stroll across the seven bridgesof Königsberg.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 Wed, Oct 25, 2017 7 / 21

Page 13: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

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 Wed, Oct 25, 2017 8 / 21

Page 14: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

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 Wed, Oct 25, 2017 9 / 21

Page 15: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

The Traveling Salesman Problem

Example (The Traveling Salesman Problem)

3

10

1

10

8

11

9

10

44

2

2

7

63

7

8

7

9

3

9 6

A

B

C

D

E

F

GH

I

J

A salesman is located in a city.He must make a trip during which he visits each of a number ofother cities and return to his home city.He knows the distance from every city to every other city.What route will minimize the total distance traveled?

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 10 / 21

Page 16: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Outline

1 Street-Routing Problems

2 Definitions

3 Examples

4 Assignment

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 11 / 21

Page 17: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Definitions

DefinitionA graph is a collection of vertices and edges. We normally draw thevertices as dots and the edges as lines. Each edge connects a pair ofvertices.

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 12 / 21

Page 18: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Definitions

We can give the vertices labels, e.g., A, B, C, etc.Then use those labels to identify the edges, e.g., AB, AC, etc.

A

C

ED

B

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 12 / 21

Page 19: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Definitions

Definition (Path)A path is a sequence of edges, each edge adjacent to the next edge.We may denote a path by listing the vertices through which it passes.(E.g., DABC.)

A

C

ED

B

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 12 / 21

Page 20: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Definitions

Definition (Circuit)A circuit is a path that begins and ends at the same vertex. (E.g.,ABCA.)

A

C

ED

B

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 12 / 21

Page 21: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Definitions

Definition (Weighted Graph)A weighted graph is a graph in which every edge is assigned a value(its weight).

A

C

ED

B5

37

12

815

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 12 / 21

Page 22: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Outline

1 Street-Routing Problems

2 Definitions

3 Examples

4 Assignment

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 13 / 21

Page 23: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

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 Wed, Oct 25, 2017 14 / 21

Page 24: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

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 Wed, Oct 25, 2017 15 / 21

Page 25: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

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 Wed, Oct 25, 2017 16 / 21

Page 26: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

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 Wed, Oct 25, 2017 17 / 21

Page 27: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

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 Wed, Oct 25, 2017 18 / 21

Page 28: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

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 Wed, Oct 25, 2017 18 / 21

Page 29: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Example

Example (The Traveling Salesman Problem)

3

10

1

10

8

11

9

10

44

2

2

7

63

7

8

7

9

3

9 6

A

B

C

D

E

F

GH

I

J

In the Traveling Salesman Problem, we want a circuit that visitseach vertex at least once and has the minimal total length.

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 19 / 21

Page 30: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Example

Example (The Traveling Salesman Problem)

A

B

C

D

E

F

GH

I

J

8

10

79

11

6

7

11

8

9

9

10

14

11

11

1715

15

4

In the Traveling Salesman Problem, we want a circuit that visitseach vertex at least once and has the minimal total length.

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 19 / 21

Page 31: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Outline

1 Street-Routing Problems

2 Definitions

3 Examples

4 Assignment

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 20 / 21

Page 32: Street-Routing Problems - Lecture 26 Sections 5.1 - 5people.hsc.edu/faculty-staff/robbk/Math111/Lectures/Fall...Madison County. He must cross the bridge to photograph it and each bridge

Assignment

AssignmentChapter 5: Exercises 2, 3, 7, 13, 15, 19, 20, 21, 22, 27.

Robb T. Koether (Hampden-Sydney College) Street-Routing Problems Wed, Oct 25, 2017 21 / 21