COMS 482: unofficial class blog


Lecture 26: The Travelling Salesman Problem

Posted in Class Notes by Elliott Back on March 30th, 2005. [Del.icio.us]

The Travelling Salesman Problem (TSP):

Given distances between n cities and a bound D, is there a tour (visit all cities and return home) of cost at most D? Note that using TSP to prove NP-completeness of other problems is quite hard.

Claim: “TSP is NP-complete”

Proof: TSP is in the set NP. Given a valid tour, we can check that it is valid and has a cost &lt= D in polynomial time. Then, we want to show that Hamiltonian Cycle reduces to TSP in polynomial time. Given an HC problem as a graph G, we can show how to build the travelling salesman problem. Using the same vertices, place an edge between each pair with cost 1 if the edge exists in G, otherwise place the edge with cost 2.

Claim: “G has a Hamiltonian Cycle if and only if G’ has a TSP tour of cost &lt= n (vertices)”

Proof (=>): Assume G has a HC. Then the cycle in G’ is a tour and its cost is <= n.

Proof (<=): Assume G’ has a TSP tour of cost <= n. Every node is visited, and each edge has cost 1. The corresponding cycle is a valid HC.

3D Matching:

Given disjoint sets X, Y, and Z each of size n and given a set of triples T is a subset of (X, Y, Z) is there a subset of T of size n that covers all X + Y + Z? We can show that 3-SAT reduces to 3D Matching in polynomial time, so 3D matching is NP-complete.

Graph Coloring:

A graph g is said to have a k-coloring if there is a way to assign colors to vertices such that all adjacent verticex do not share the same color. Given a graph g and a bound k, is G k-colorable? Graph coloring is NP-complete, but on planar graphs 2-coloring has a simple DFS algorithm, and >=4-coloring simply returns “yes.”

Subset Sum:

Given w1, … , wn in {Naturals} and a target wi is there a subset of w1, … , wn whose sum is exactly wi?

NP-Complete “Types”:

All the NP Complete problems we have covered so far can be grouped by similarity into the following categories:

  • Packing problems: Set Packing, Independent Set
  • Covering problems: Vertex & Set Cover
  • Partitioning problems: 3D Matching, Graph coloring
  • Sequencing problems: Hamiltonian Cycle, Hamiltonian Path, Travelling Salesman Problem
  • Numerical problems: Subset sum
  • Constraint problems: SAT, 3-SAT, and Circuit-SAT

This entry was posted on Wednesday, March 30th, 2005 at 5:44 pm and is tagged with , , , , , , , , , , , , , , , , , , , . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.

Leave a Reply

Please take time to enjoy the archives: May 2005 (1) April 2005 (11) March 2005 (11) February 2005 (15) January 2005 (7)

Fresh, related resources:

Supplied by Google Blog Search
  • Coding Horror: Your Favorite NP-Complete Cheat
    What do expert programmers do when faced by an intractable bproblem/b? They cheat. And so should you! Indeed, some of the modern approximations for bthe Travelling Salesman Problem/b are remarkably effective. Various approximation algorithms b.../b
  • Anittah Patrick » Blog Archive » A denominator bproblem/b
    After a conversation I had with fellow JE Spider Rudi Seitz this summer while visiting MIT (Rudi?s on leave from a computer science PhD there), I realized that my teenage self was trying to solve bthe travelling salesman problem/b. b.../b
  • Grandpa as bsalesman/b | London Korean Links
    Grandpa as bsalesman/b. The Image of the Elderly in British and Korean Contemporary Advertising? bLecture/b by Dr. Hyunsun Yoon Korean Cultural Centre, 24th June 2008. Report by Saharial, with photo by Matthew Jackson b.../b
  • RELIGION IN AMERICAN HISTORY: Where Have All the Bible bSalesmen/b Gone?
    I wonder if the whole idea of a "family Bible" has become less common, thus making the work of a btraveling salesman/b too unremunerative. I have no way of proving this guess but will speculate that perhaps it would have something to do b.../b
  • Stevey#39;s Blog Rants: Get that job at Google
    You should especially know about the most famous classes of NP-complete bproblems/b, such as btraveling salesman/b and the knapsack bproblem/b, and be able to recognize them when an interviewer asks you them in disguise. b.../b