Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2014, 2010, 2007 Pearson Education, Inc. Section 4.2, Slide 1 4 Graph Theory (Networks) The Mathematics of Relationships 4.

Similar presentations


Presentation on theme: "Copyright © 2014, 2010, 2007 Pearson Education, Inc. Section 4.2, Slide 1 4 Graph Theory (Networks) The Mathematics of Relationships 4."— Presentation transcript:

1 Copyright © 2014, 2010, 2007 Pearson Education, Inc. Section 4.2, Slide 1 4 Graph Theory (Networks) The Mathematics of Relationships 4

2 Copyright © 2014, 2010, 2007 Pearson Education, Inc. Section 4.2, Slide 2 The Traveling Salesperson Problem 4.2 Understand how to solve the traveling salesperson problem using Hamilton circuits Determine all Hamilton circuits in a complete graph (continued on next slide)

3 Copyright © 2014, 2010, 2007 Pearson Education, Inc. Section 4.2, Slide 3 The Traveling Salesperson Problem 4.2 Solve the traveling salesperson problem using the brute force algorithm Solve the traveling salesperson problem using the best edge algorithm

4 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 4 The Traveling Salesperson Problem Danielle lives in Philadelphia and must make visits next week to branch offices in New York City, Cleveland, Atlanta, and Memphis. To determine which would be her cheapest trip, she has obtained prices of flights between each pair of cities. What sequence of visits minimizes the cost?

5 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 5 Hamilton Paths Before we tackle Danielle’s problem, we need some additional tools.

6 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 6 Hamilton Paths Example: Find a Hamiltonian path. (solution on next slide)

7 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 7 Hamilton Paths Solution: answers may vary.

8 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 8 Finding Hamilton Circuits Examples:

9 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 9 Finding Hamilton Circuits Often, we need to find all the Hamilton circuits in a graph. This is easy for complete graphs. Tree diagrams help us find Hamilton circuits systematically.

10 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 10 Finding Hamilton Circuits Example: Find all Hamilton circuits in K 4. Solution: Path ABCDA is a Hamilton circuit in K 4. We will consider path BCDAB to be the same path because it passes through the same vertices in the same order and the only difference is that we are beginning and ending at vertex B rather than vertex A. So, we will assume that all circuits begin at A. (continued on next slide)

11 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 11 Finding Hamilton Circuits Solution: Use a tree diagram to list all Hamilton circuits systematically. (continued on next slide)

12 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 12 Finding Hamilton Circuits Solution:

13 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 13 Finding Hamilton Circuits

14 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 14 Solving the TSP by Brute Force In solving a TSP problem by brute force, we consider all possible Hamiltonian circuits.

15 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 15 Solving the TSP by Brute Force Example: Use the weighted graph to find the sequence of cities for Danielle to visit that will minimize her total travel cost.

16 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 16 Solving the TSP by Brute Force Solution: Use brute force to explore all possible circuits:

17 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 17 Solving the TSP by Brute Force

18 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 18 The Nearest Neighbor Algorithm There are algorithms that give good approximations to the TSP.

19 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 19 The Nearest Neighbor Algorithm Example: Use the nearest neighbor algorithm to schedule Danielle’s trip. Solution:

20 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 20 The Best Edge Algorithm

21 Copyright © 2014, 2010, 2007 Pearson Education, Inc.Section 4.2, Slide 21 The Best Edge Algorithm Example: Use the best edge algorithm to schedule Danielle’s trip. Solution: 210 + 230 + 170 + 240 + 350 = 1200 Notice that this circuit has a weight of 1,200, which also makes it the best solution to Danielle’s problem.


Download ppt "Copyright © 2014, 2010, 2007 Pearson Education, Inc. Section 4.2, Slide 1 4 Graph Theory (Networks) The Mathematics of Relationships 4."

Similar presentations


Ads by Google