Lecture topic-BruteForce

Find the shortest tour that passes through all the

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

View Full Document Right Arrow Icon
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

This note was uploaded on 10/31/2013 for the course RAIK 283 taught by Professor Yinglu during the Fall '12 term at UNL.

Ask a homework question - tutors are online