TravelingSalesman Problems Ch 6 More examples of Complete
Traveling-Salesman Problems Ch 6
More examples of Complete Graphs A A B B F E C C D Graph 1 No. of edges with n=5 vertices = n(n-1)/2 = 5(5 -1)/2 = 10 E D Graph 2 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
Not a Complete graph A B E D C No edge between the pair of edges A, C No edge between the pair of edges B, D
Not a Complete graph A B E D C 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
Not a Complete graph A B D C We cannot apply the formula for number of edges for a graph which is not a complete graph E No edge between the pair of vertices A, E No edge between the pair of vertices B, E
Modifying the previous graph: Complete graph A B D C E We can apply the formula for number of edges for a graph which is a complete graph. # of edges = n(n-1) = 5 x 4/2 = 10 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
No of edges of a complete graph A B C No. of edges of the complete graph = n(n-1)/2 = 3(3 -1)/2 =3 n represents the number of vertices in a complete graph
No. of Hamilton circuits of a complete graph A B D C No. of Hamilton circuit of the Complete graph = (n-1)! = (4 -1)! = 3! = 1 x 2 x 3 =6 n represents the number of vertices in a complete graph
No. of Hamilton circuits of a complete graph A B E C D No. of Hamilton circuit of the Complete graph = (n-1)! = (5 -1)! = 4! = 1 x 2 x 3 x 4 = 24 n represents the number of vertices in a complete graph
No. of Hamilton circuits of a complete graph A B F C E D No. of Hamilton circuit of the Complete graph = (n-1)! = (6 -1)! = 5! = 1 x 2 x 3 x 4 x 5 = 120 n represents the number of vertices in a complete graph
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.
Simple Strategies for solving TSPs $185 33 50 99 $1 $1 $174 $121 $120 $152 $200 9 $11 $1
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.
Simple Strategies for solving TSPs The optimal circuit: A, E, C, B, D, A => Cost $676 (Method 1) A, C, E, D, B, A => cost $773 (Method 2)
- Slides: 15