Presentation is loading. Please wait.

Presentation is loading. Please wait.

Traveling-Salesman Problem Ch. 6. Hamilton Circuits Euler circuit/path => Visit each edge once and only once Hamilton circuit => Visit each vertex once.

Similar presentations


Presentation on theme: "Traveling-Salesman Problem Ch. 6. Hamilton Circuits Euler circuit/path => Visit each edge once and only once Hamilton circuit => Visit each vertex once."— Presentation transcript:

1 Traveling-Salesman Problem Ch. 6

2 Hamilton Circuits Euler circuit/path => Visit each edge once and only once Hamilton circuit => Visit each vertex once and only once (except at the end, where it returns to the starting vertex) Hamilton path => Visit each vertex once and only once Difference: Edge (Euler)  Vertex (Hamilton)

3 Examples of Hamilton circuits AB C D E Has many Hamilton circuits: 1)A, B, C, D, E, A 2)A, D, C, E, B, A Has many Hamilton paths: 1)A, B, C, D, E 2)A, D, C, E, B Has no Euler circuit, no Euler path => 4 vertices of odd degree Hamilton circuits can be shortened into a Hamilton path by removal of the last edge Graph 1

4 Examples of Hamilton circuits AB C D E Has no Hamilton circuits: What ever the starting point, we are going to have to pass through vertex E more than once to close the circuit. Has many Hamilton paths: A, B, E, C, D C, D, E, A, B Has Euler circuit => each vertex has even degree Graph 2

5 Examples of Hamilton circuits AB C D E Has many Hamilton circuits: 1)A, F, B, E, C, G, D, A 2)A, F, B, C, G, D, E, A Has many Hamilton paths: 1)A, F, B, E, C, G, D 2)A, F, B, C, G, D, E Has Euler circuit => Every vertex has even degree Graph 3 F G

6 Examples of Hamilton circuits AB CD E Has no Hamilton circuits: Has no Hamilton paths: Has no Euler circuit Has no Euler path => more than 2 vertices of odd degree Graph 4 F G H I

7 Complete graph A graph with N vertices in which every pair of vertices is joined by exactly one edge is called the complete graph. Total no. of edges = N(N-1)/2 AB C D In K 4, each vertex has degree 3 and the number of edges = 4 (3)/2 = 6

8 The six Hamilton circuits of K 4 AB C D A,B,C,D,AB,C,D,A,BC,D,A,B,CD,A,B,C,D A,B,D,C,AB,D,C,A,BC,A,B,D,CD,C,A,B, D A,C,B,D,AB,D,A,C,BC,B,D,A,CD,A,C,B,D A,C,D,B,AB,A,C,D,BC,D,B,A, CD,B,A,C,D A,D,B,C,AB,C,A,D,BC,A,D,B,CD,B,C,A,D A,D,C,B,AB,A,D,C,BC,B,A,D,CD,C,B,A,D Reference point A Reference point BReference point CReference point D Rows => 6 Hamilton circuits Cols=> same Hamilton circuit with different reference points Graph

9 Complete graph The number of Hamilton circuits in a complete graph can be computed by using factorials. N! (factorial of N) = 1x 2x3x4x … x(N-1)x N The complete graph with N vertices has (N-1)! Hamilton circuits. Example: The complete graph with 5 vertices has 4! = 1x2x3x4 = 24 Hamilton circuits

10 Factorial Which of the following is true? n! = n! x (n-1)! n! = n! + (n-1)! n! = n x (n-1)! n! = n + (n-1)!

11 No. of edges No of edges in K 10 is 10 10! 90 45

12 Complete graph In a complete graph with 14 vertices (A through N), the total number of Hamilton circuits (including mirror-image circuits) that start at vertex A is 14! (14x13)/2 15! 13!


Download ppt "Traveling-Salesman Problem Ch. 6. Hamilton Circuits Euler circuit/path => Visit each edge once and only once Hamilton circuit => Visit each vertex once."

Similar presentations


Ads by Google