Lecture topic-BruteForce

Find the shortest tour that passes through all the

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 3 47 Example 1: Traveling salesman Example problem problem a a a Given n cities with known distances between each Given pair, find the shortest tour that passes through all the cities exactly once before returning to the starting city. starting Alternatively: Find shortest Hamiltonian circuit in Alternatively: Hamiltonian a weighted connected graph. Example: 2 a b 5 3 8 c 7 4 d Design and Analysis of Algorithms – Chapter 3 48 Traveling salesman by exhaustive Traveling search search a Tour Tour a a a→b→c→d→a a→b→d→c→a a→c→b→d→a a→c→d→b→a a→d→b→c→a a→d→c→b→a a Efficiency: a a a a Cost . 2+3+7+5 = 17 2+4+7+8 = 21 8+3+4+5 = 20 8+7+4+2 = 21 5+4+3+8 = 20 5+7+3+2 = 17 Design and Analysis of Algorithms – Chapter 3 49 Traveling salesman by exhaustive Traveling search search a Tour Tour a a a→b→c→d→a a→b→d→c→a a→c→b→d→a a→c→d→b→a a→d→b→c→a a→d→c→b→a a Efficiency: (n-1)!/2 a a a a Cost . 2+3+7+5 = 17 2+4+7+8 = 21 8+3+4+5 = 20 8+7+4+2 = 21 5+4+3+8 = 20 5+7+3+2 = 17 Design and Analysis of Algorithms – Chapter 3 50 0-1 Knapsa...
View Full Document

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern