You are on page 1of 32

The Traveling Salesman

Problem for Cubic Graphs


Journal of Graph Algorithms and Applications vol.
11, no. 1, pp. 61–81 (2007)
David Eppstein
Adviser: Yue-Li Wang
As presented by Ying-Jhih Chen

1
Outline
• The TSP for cubic graph
• Special Rule
– Triangle
– 4-cycle
• Example
• Analysis
• Degree Four
• Hamiltonian Cycles
2
Traveling Salesman Problem
• Given a number of cities and the costs of
traveling from any city to any other city.
• What is the least-cost round-trip route that
visits each city exactly once and then
returns to the starting city?
2
1
4 3
1
1

3
Cubic
• 3-regular graph.
• E. g.

4
This Algorithm
• The solution of TSP in a graph of
degree at most three.
• n vertices, in time O(2n/3) ≈
1.260n.

5
Triangle (1/2)

6
Triangle (2/2)

7
4-cycle

8
Example
Case Case
2 1: 2 2: 2
1 1 1 1 1 1 1
1 1 2 2
2 2 2 2
3 3 3
3 3 1 3
1 1
5 4 5 4 5 4
2 2 2

9
Case 2 (1/2)

2 3
1 1 1
2 2 2 2
3 3
1 3 3
1
5 4
5
2 6

10
Case 2 (2/2)
Case 2-1: Case 2-2:
3 3
1 1
2 2 2
2
3 3
3 1 3
1
5 5
6 6

Cost : 21 Cost : 17

11
Case 1
Case 1-1: Case 1-2:
2
2
1 1 1
2 2 1 1 1
2 2
3
3
1 3
1 3
5 4
2 5 4
2

12
Case 1-1

2
1 1 1
2 2 2 4
3
1 3
5 4
2

Cost: 16

13
Case 1-2

2 2
1
1 1 1 1 1 1
2 2 16 2 2
18 3
3 3
1 1
5 4 5 4
2 2

Cost: 17

Solution: 16 ( case 1-1)

14
Algorithm Review
• TSP ( G, F):
• 1. Repeat the following steps until one of the steps returns or none of them
applies:
– (a)~(h)
– (i) If G contains a triangle xyz, …
– (j) If G contains a cycle of four unforced edges, …
• 2. If G \ F forms a collection of disjoint 4-cycles, perform the following steps.
• (a)~(e)
• 3. Choose an edge yz according to the following cases:
• (a)~(c)
• 4. TSP(G, F ∪ {yz})
• 5. TSP(G \ {yz}, F)
• 6. Return the minimum of the numbers returned by the two recursive calls.
(step 4, 5)

15
Analysis
• A nonstandard measure of the size of a
graph G: let s(G, F) = |(G)| − |F| − |C|
• C denotes the set of 4-cycles of G that
form connected components of G \ F.
• Clearly, s ≤ n,

16
Chain (1/2)

s(G1,F1) = s(G, F) - 2

17
Chain (2/2)

s(G2, F2) = s(G, F) - 5

18
Cycle Length is Six or More
(1/2)

s(G1, F1) = s(G, F) - 3

19
Cycle Length is Six or More
(2/2)

s( G2, F2) = s(G, F) -3

20
4-cycle (1/3)

s ( G1, F1) = s(G, F) - 3

21
4-cycle (2/3)

22
4-cycle (3/3)

(G) - 3

s (G2, F2) = s(G, F) - 3

23
Case

s(G1, F1) = s(G, F) -3 s(G2, F2) = s(G, F) -3

24
Time Complexity
• T(s) ≤ 1 + max{ sO(1), T(s − 1), 2T(s − 3),
T(s − 2) + T(s − 5)}.
• T(s) = O(2s/3).
• s is at most n.
• A bound of O(2n/3)

25
Degree Four
• Randomly splitting vertices

Let f denote the number of degree four vertices in G.


The algorithm has probability (2/3)f of finding the correct TSP solution.
There are (3/2)f repetitions.
26
Time for Degree Four

• O((3/2)f 2n/3) = O((3/2)n 2n/3) = O((3/2)3n/3


2n/3) = O((27/8)n/3 2n/3) = O((27/4)n/3) ≈
1.890n

27
Listing All Hamiltonian Cycles

To find a Hamiltonian cycle of a 400-vertex 3-regular graph, dual to a


triangulated torus model in approximately two seconds on an 800 MHz
PowerPC G4 computer.
28
Graphs with Many Hamiltonian
Cycles (1/2)

29
Graphs with Many Hamiltonian
Cycles (2/2)

Cubic graph with 2n/3 Hamiltonian cycles. (4n/6 =


2n/3 )
30
References (1/2)
• [1] E. M. Arkin, M. Held, J. S. B. Mitchell, and S. S. Skiena. Hamiltonian triangulations
for fast rendering. The Visual Computer, 12(9):429–444,1996.
• [2] R. Beigel. Finding maximum independent sets in sparse and general graphs. In Proc.
10th ACM-SIAM Symp. Discrete Algorithms, pages S856–S857, January 1999.
• [3] J. M. Byskov. Chromatic number in time O(2.4023n) using maximal independent
sets. Technical Report RS-02-45, BRICS, December 2002.
• [4] D. Eppstein. Quasiconvex analysis of backtracking algorithms. ACM Trans.
Algorithms. To appear.
• [5] D. Eppstein. Small maximal independent sets and faster exact graph coloring. J.
Graph Algorithms and Applications, 7(2):131–140, 2003.
• [6] D. Eppstein and M. Gopi. Single-strip triangulation of manifolds with arbitrary
topology. Eurographics Forum, 23(3):371–379, 2004.
• [7] M. R. Garey and D. S. Johnson. Computers and Intractability: a Guide to the Theory
of NP-Completeness. W. H. Freeman, 1979.
• [8] D. S. Johnson and L. A. McGeoch. The traveling salesman problem: a case study in
local optimization. In E. H. L. Aarts and J. K. Lenstra, editors, Local Search in
Combinatorial Optimization, pages 215–310. John Wiley and Sons, 1997.

31
References (2/2)
• [9] E. L. Lawler. A note on the complexity of the chromatic number problem.
Information Processing Letters, 5(3):66–67, August 1976.
• [10] B. D. McKay and G. F. Royle. Constructing the cubic graphs on up to 20 vertices.
Ars Combinatorica, 21(A):129–140, 1986.
• [11] J. M. Robson. Algorithms for maximum independent sets. J. Algorithms,
7(3):425–440, September 1986.
• [12] N. Schemenauer, T. Peters, and M. L. Hetland. Simple generators. Python
Enhancement Proposal 255, python.org, May 2001.
• [13] R. E. Tarjan and A. E. Trojanowski. Finding a maximum independent set. SIAM
J. Comput., 6(3):537–546, September 1977.
• [14] G. van Rossum et al. Python Language Website. http://www.python.org/.
• [15] B. Vandegriend. Finding Hamiltonian Cycles: Algorithms, Graphs and
Performance. Master’s thesis, Univ. of Alberta, Dept. of Computing Science, 1998.

32

You might also like