MIT6_042JF10_rec09_sol

# MIT6_042JF10_rec09_sol - 6.042/18.062J Mathematics for...

This preview shows pages 1–2. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

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

Unformatted text preview: 6.042/18.062J Mathematics for Computer Science October 8, 2010 Tom Leighton and Marten van Dijk Notes for Recitation 9 1 Traveling Salesperson Problem Now we’re going to talk about a famous optimization problem known as the Traveling Sales- person Problem 1 (TSP). Given a number of cities and the costs of traveling from any city to any other city, what is the cheapest round-trip route that visits each city exactly once, and returns to the starting city? One special, though very natural, case of this problem is when the costs of traveling between cities obey the triangle inequality . That is, if a,b, and c are distinct cities, then d ( a,c ) ≤ d ( a,b ) + d ( b,c ). This corresponds to our intuitive notion that the distance of traveling to a from c should be no larger than that of first traveling to a from b , and then from b to c . The triangle inequality holds if the cities correspond to points in the plane, since in this case the line segments joining a to b , b to c , and a to c form a triangle, and in high school we learned that the sum of any two edges of a triangle is larger than the third edge. Let us abstract away the distractions and formulate the problem as follows. The cities will be vertices of a graph. We will then consider the complete graph on these vertices, and give edge ( a,b ) a weight of d ( a,b ). We want an ordering of the vertices ( v 1 ,...,v n ) that minimizes n − 1 COST = d ( v i ,v i +1 ) + d ( v n ,v 1 ) . i =1 Consider the following greedy algorithm for TSP. This might be the first thing you’d think of. It is called greedy since at each step we are choosing the locally-optimal best way to continue, though our overall actions may not be collectively optimal. 1. Start at an arbitrary city. 2. While there is still an unvisited city, go to the city with smallest distance from the current city. If there are no more unvisited cities, return to the starting city. Even when the cities are points in the plane, the greedy algorithm sometimes outputs a suboptimal solution....
View Full Document

## This note was uploaded on 01/19/2012 for the course CS 6.042J / 1 taught by Professor Tomleighton,dr.martenvandijk during the Fall '10 term at MIT.

### Page1 / 5

MIT6_042JF10_rec09_sol - 6.042/18.062J Mathematics for...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online