1 / 5

Reducing Knapsack to TSP

Reducing Knapsack to TSP. Professor Pasi Franti. Step 1: Equivalent Graph Construction. Given Knapsack instance: KP={2,3,5,7,11} Draw A node in the plane for each item:. 2. 7. 5. 3. 11. Step 1: Equivalent Graph Construction. Given Knapsack instance: KP={2,3,5,7,11}

virgo
Download Presentation

Reducing Knapsack to TSP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Reducing Knapsack to TSP Professor Pasi Franti

  2. Step 1: Equivalent Graph Construction • Given Knapsack instance: • KP={2,3,5,7,11} • Draw A node in the plane for each item: 2 7 5 3 11

  3. Step 1: Equivalent Graph Construction • Given Knapsack instance: • KP={2,3,5,7,11} • Add starting node and ending node: 2 7 5 0 n+1 3 11 Note: total of n+2 nodes required for a Knapsack instance of n items

  4. Step 1: Equivalent Graph Construction • Given Knapsack instance: • KP={2,3,5,7,11} • Draw links from each smaller node to the bigger node with the weight w equal to destination node: 7 2 7 n+1 11 5 n+1 2 11 7 5 5 0 n+1 3 5 7 11 11 3 11

  5. Step 1: Equivalent Graph Construction • Given Knapsack instance: • KP={2,3,5,7,11} • Assume for each node that going back cost is 0 and going up cost is w: 7 2 7 7 5 7 7 2 0 7 0 5 0 5 0 n+1 0 3 0 5 7 11 11 11 3 11 11

More Related