Download presentation
Presentation is loading. Please wait.
1
Traveling-Salesman Problems
Ch 6
2
More examples of Complete Graphs
B C D E A B C D E F Graph1 Graph 2 No. of edges with n=5 vertices = n(n-1)/2 = 5(5-1)/2 = 10 No. of edges with n=6 vertices = n(n-1)/2 = 6(6-1)/2 = 15 n represents the number of vertices in a complete graph
3
Not a Complete graph No edge between the pair of edges A, C
No edge between the pair of edges B, D
4
Not a Complete graph No edge between the pair of vertices A, D
No edge between the pair of vertices B, C No edge between the pair of vertices A, C No edge between the pair of vertices B, D
5
Not a Complete graph We cannot apply the formula for
B We cannot apply the formula for number of edges for a graph which is not a complete graph D C E No edge between the pair of vertices A, E No edge between the pair of vertices B, E
6
Modifying the previous graph: Complete graph
B We can apply the formula for number of edges for a graph which is a complete graph. # of edges = n(n-1) = 5x4/2 = 10 D C E Add an edge between the pair of vertices A, E Add an edge between the pair of vertices B, E n represents the number of vertices in a complete graph
7
No of edges of a complete graph
No. of edges of the complete graph = n(n-1)/2 = 3(3-1)/2 = 3 B C n represents the number of vertices in a complete graph
8
No. of Hamilton circuits of a complete graph
No. of Hamilton circuit of the Complete graph = (n-1)! = (4-1)! = 3! = 1x2x3 = 6 A B C D n represents the number of vertices in a complete graph
9
No. of Hamilton circuits of a complete graph
B C D E No. of Hamilton circuit of the Complete graph = (n-1)! = (5-1)! = 4! = 1x2x3x4 = 24 n represents the number of vertices in a complete graph
10
No. of Hamilton circuits of a complete graph
No. of Hamilton circuit of the Complete graph = (n-1)! = (6-1)! = 5! = 1x2x3x4x5 = 120 A B C D E F n represents the number of vertices in a complete graph
11
Simple Strategies for solving TSPs
Method 1: Make a list of all possible Hamilton circuits Calculate the total cost for each circuit. Select a circuit with least total cost for the answer.
12
Simple Strategies for solving TSPs
$185 $133 $200 $119 $152 $121 $120 $150 $199 $174
13
Simple Strategies for solving TSPs
Method 2: Start at home (A) From there go to the city to which the cost of travel is the cheapest. Then from there go to the next city to which the cost of travel is the cheapest, and so on. From the last city, return to A.
14
Simple Strategies for solving TSPs
The optimal circuit: A,E,C,B,D,A => Cost $676 (Method1) A,C,E, D,B, A => cost $773 (Method 2)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.