. Amanur Rahman Saiyed (Indiana State University) THE TRAVELING - - PowerPoint PPT Presentation

amanur rahman saiyed indiana state university the
SMART_READER_LITE
LIVE PREVIEW

. Amanur Rahman Saiyed (Indiana State University) THE TRAVELING - - PowerPoint PPT Presentation

. Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 1 / 21 THE TRAVELING SALESMAN PROBLEM Amanur Rahman Saiyed Indiana State University November 22, 2011 Amanur Rahman Saiyed (Indiana State


slide-1
SLIDE 1

.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 1 / 21

slide-2
SLIDE 2

THE TRAVELING SALESMAN PROBLEM

Amanur Rahman Saiyed

Indiana State University

November 22, 2011

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 1 / 21

slide-3
SLIDE 3

Definition

The Goal of the Traveling Salesman Problem (TSP) is to find the shortest tour of a select number of cities with the following restrictions: You must visit each city once and only once. You must return to the original starting point.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 2 / 21

slide-4
SLIDE 4

Problem Statement

Given a list of cities and their pair wise distances, the task is to find a shortest possible tour that visits each city exactly once. Applications Planning

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 3 / 21

slide-5
SLIDE 5

Problem Statement

Given a list of cities and their pair wise distances, the task is to find a shortest possible tour that visits each city exactly once. Applications Planning Logistics

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 3 / 21

slide-6
SLIDE 6

Problem Statement

Given a list of cities and their pair wise distances, the task is to find a shortest possible tour that visits each city exactly once. Applications Planning Logistics Microchips manufacture

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 3 / 21

slide-7
SLIDE 7

Why is the TSP difficult to solve?

5 cities: 5! = 5 ∗ 4 ∗ 3 ∗ 2 ∗ 1 = 120

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 4 / 21

slide-8
SLIDE 8

Why is the TSP difficult to solve?

5 cities: 5! = 5 ∗ 4 ∗ 3 ∗ 2 ∗ 1 = 120 25 cities: 25! = 25 ∗ 24 ∗ 23 ∗ 22 ∗ · · · ∗ 2 ∗ 1 = 15, 511, 210, 043, 330, 985, 984, 000, 000

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 4 / 21

slide-9
SLIDE 9

Why is the TSP difficult to solve?

5 cities: 5! = 5 ∗ 4 ∗ 3 ∗ 2 ∗ 1 = 120 25 cities: 25! = 25 ∗ 24 ∗ 23 ∗ 22 ∗ · · · ∗ 2 ∗ 1 = 15, 511, 210, 043, 330, 985, 984, 000, 000 100 cities: 100! = 100 ∗ 99 ∗ 98 ∗ · · · ∗ 3 ∗ 2 ∗ 1 = 93, 326, 215, 443, 944, 152, 681, 699, 238, 856, 266, 700, 490, 715, 968, 264, 381, 621, 468, 592, 963, 895, 217, 599, 992, 229, 915, 608, 941, 463, 976, 156, 518, 286, 253, 697, 920, 827, 223, 758, 251, 185, 210, 916, 864, 000, 000, 000, 000, 000, 000, 000, 000

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 4 / 21

slide-10
SLIDE 10

Exact Solutions

Brute-force Method Find all possible routes and their respective distances. The route with the least distance is selected. This method is convenient for relatively small number of nodes. Time complexity is O(n!)

Figure: A 4 city TSP

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 5 / 21

slide-11
SLIDE 11

Branch and Bound Method Branching recursively divides the domain into feasible sub domains.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 6 / 21

slide-12
SLIDE 12

Branch and Bound Method Branching recursively divides the domain into feasible sub domains. Bounding determines upper and lower bounds for the optimal solution in a feasible sub domain.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 6 / 21

slide-13
SLIDE 13

Branch and Bound Method Branching recursively divides the domain into feasible sub domains. Bounding determines upper and lower bounds for the optimal solution in a feasible sub domain. Can be used to process TSPs containing 40-60 cities.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 6 / 21

slide-14
SLIDE 14

Feasibility of Exact Solutions

Best for small number of cities.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 7 / 21

slide-15
SLIDE 15

Feasibility of Exact Solutions

Best for small number of cities. Time Complexity is very high.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 7 / 21

slide-16
SLIDE 16

Feasibility of Exact Solutions

Best for small number of cities. Time Complexity is very high. Not useful for large set of nodes.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 7 / 21

slide-17
SLIDE 17

Feasibility of Exact Solutions

Best for small number of cities. Time Complexity is very high. Not useful for large set of nodes. So, for large number of nodes, we use approximation techniques.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 7 / 21

slide-18
SLIDE 18

Approximate Solutions

Nearest Neighbour This is perhaps the simplest and most straight forward TSP heuristic. The key to this algorithm is to always visit the nearest city,then return to the starting city when all the other cities are visited. Nearest Neighbour,O(n2) Select a random city.

Figure: Network of 4 city TSP

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 8 / 21

slide-19
SLIDE 19

Approximate Solutions

Nearest Neighbour This is perhaps the simplest and most straight forward TSP heuristic. The key to this algorithm is to always visit the nearest city,then return to the starting city when all the other cities are visited. Nearest Neighbour,O(n2) Select a random city. Find the nearest unvisited city and go there.

Figure: Network of 4 city TSP

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 8 / 21

slide-20
SLIDE 20

Approximate Solutions

Nearest Neighbour This is perhaps the simplest and most straight forward TSP heuristic. The key to this algorithm is to always visit the nearest city,then return to the starting city when all the other cities are visited. Nearest Neighbour,O(n2) Select a random city. Find the nearest unvisited city and go there. Are there any unvisited cities left? If yes, repeat step 2.

Figure: Network of 4 city TSP

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 8 / 21

slide-21
SLIDE 21

Approximate Solutions

Nearest Neighbour This is perhaps the simplest and most straight forward TSP heuristic. The key to this algorithm is to always visit the nearest city,then return to the starting city when all the other cities are visited. Nearest Neighbour,O(n2) Select a random city. Find the nearest unvisited city and go there. Are there any unvisited cities left? If yes, repeat step 2. Return to the first city.

Figure: Network of 4 city TSP

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 8 / 21

slide-22
SLIDE 22

Greedy Greedy algorithm is the simplest improvement algorithm. It starts with the departure Node 1. Then the algorithm calculates all the distances to other n − 1 nodes. Go to the next closest node. Take the current node as the departing node, and select the next nearest node from the remaining n − 2

  • nodes. The process continues until all the nodes are visited once and only
  • nce then back to Node 1. When the algorithm is terminated, the

sequence is returned as the best tour. Greedy,O(n2log2(n))

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 9 / 21

slide-23
SLIDE 23

Iterative improvement Methods

k-opt heuristic Take a given tour and delete k mutually disjoint edges. Reassemble the remaining fragments into a tour, using exact algorithms which improve the tour. v-opt heuristic The variable-opt methods do not fix the size of the edge set to

  • remove. Instead they grow the set as the search process continues.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 10 / 21

slide-24
SLIDE 24

2-opt Heuristic

A special case of k-opt heuristic method. Iteratively remove two edges and replace them with two different edges which complete the tour. The sum of the sizes of the new edges has to be lesser than that of the existing ones. Then only, we can have an optimized tour.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 11 / 21

slide-25
SLIDE 25

Hybrid approach for TSP

An approximation technique to find an approximate solution. An enhancement technique applied on the approximate solution

  • btained from previous step.

This approach gives an approximate solution to TSP which is very close to the optimal solution.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 12 / 21

slide-26
SLIDE 26

Nearest neighbour with 2-opt improvement

An approximate solution is found using the Nearest Neighbor method. The approximate solution is then improved by using the 2-opt heuristic. The resultant improvised approximate solution to the TSP is found.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 13 / 21

slide-27
SLIDE 27

Prev X-coordinate Y-Coordinate Next Representation of a node

Generating the nodes randomly

1 We generate the nodes randomly, the values of x and y, and save

them as a linked list

2 We can input the number of nodes we want to have in the problem Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 14 / 21

slide-28
SLIDE 28

Nearest Neighbour method

1 We iteratively move through the unvisited nodes in the linked list and

save the nearest node. Visited Nodes Current Node ........ Unvisited Nodes Nearest Node When we find the nearest node, we move it to the the next node of the current node.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 15 / 21

slide-29
SLIDE 29

Visited Nodes ........ Unvisited Nodes Move the nearest node as the next visited node We then move the current node to the next node, which is nothing but the nearest node to the current node in the previous iteration

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 16 / 21

slide-30
SLIDE 30

Visited Nodes ........ Unvisited Nodes Current Node

1 The iterations are repeated till the end of the linked list 2 Finally, all the nodes are connected through nearest neighbor method Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 17 / 21

slide-31
SLIDE 31

2-Opt Optimization

Nearest Neighbor tour 2-opt optimal tour

1 The two costly edges are replaced by other two edges which make the

tour smaller, without affecting the tour properties

2 The final optimized tour is obtained Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 18 / 21

slide-32
SLIDE 32

Applying 2-opt heuristic in the program

We iteratively go through the edges of the tour in the linked list and go through all possible disjoint edges.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 19 / 21

slide-33
SLIDE 33

Applying 2-opt heuristic in the program

We iteratively go through the edges of the tour in the linked list and go through all possible disjoint edges. If there is any optimization possible, that is made by modifying the linked list.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 19 / 21

slide-34
SLIDE 34

Applying 2-opt heuristic in the program

We iteratively go through the edges of the tour in the linked list and go through all possible disjoint edges. If there is any optimization possible, that is made by modifying the linked list. The improved solution of the Traveling Salesman Problem is found.

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 19 / 21

slide-35
SLIDE 35

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 20 / 21

slide-36
SLIDE 36

References

David L.Applegate,Robert E.Bixby,Vasek Chvatal,William J.Cook ”The Traveling Salesman Problem”,year = 2001. D.S. Johnson and L.A. McGeoch, Experimental Analysis of Heuristics for the STSP, The Traveling Salesman Problem and its Variations,year = 2002. Cook, William., ”History of the TSP ” The Traveling Salesman Problem, year = 2009. http://en.wikipedia.org/wiki/Traveling salesman problem http://www.tsp.gatech.edu/

Amanur Rahman Saiyed (Indiana State University) THE TRAVELING SALESMAN PROBLEM November 22, 2011 21 / 21