You are on page 1of 5

Hamilton cycles

Hamilton cycles

VU Algorithmen auf Graphen


Part III Markus Leitner Mario Ruthmair Christian Schauer
Algorithms and Data Structures Group Institute of Computer Graphics and Algorithms Vienna University of Technology

Hamilton Cycles

WS 2010/11

VU Algorithmen auf Graphen

C. Schauer

VU Algorithmen auf Graphen

C. Schauer

Hamilton cycles

Hamilton cycles

Motivation (Euler tour / Hamilton cycle)


Seven bridges of Knigsberg o

Euler tours
Denition 112 (Euler tour)
A tour is said to be Eulerian in a graph G (V , E ), if every edge e E is traversed exactly once. An Euler tour can be found in O(|V | + |E |).

Denition 113 (Euler graph)


A graph is said to be Eulerian if it admits an Euler tour.

Denition 114 (Euler graph)


A nonempty connected graph is Eulerian if and only if it has no vertices of odd degree.

VU Algorithmen auf Graphen

C. Schauer

VU Algorithmen auf Graphen

C. Schauer

Hamilton cycles

Hamilton cycles

Hamilton Cycle
Denition 115 (Hamilton cycle)
A Hamilton cycle in a graph G (V , E ) is a cylce that contains each vertex v V exactly once.

Characterization of Hamilton graphs


Necessary conditions
G (V , E ) is connected (G ) 2 (G ) (G ) c, constant c > 2
n 2,

Sucient conditions
G (V , E ) is connected (G ) 2 (G ) c, constant c > 2 (G ) n , n 3 2 G is dense G is Eulerian

Denition 116 (Hamilton graph)


A graph is said to be Hamiltonian if it contains at least one Hamilton cycle.

G is dense

n3

Denition 117 (Hamilton path)


A Hamilton path in a graph G (V , E ) is a path containing each vertex v V exactly once.

G is Eulerian

(Remember: There is no simple characterization of Hamilton graphs.)

Theorem 118
A Hamilton graph G (V , E ) contains at least |V | Hamilton paths.
VU Algorithmen auf Graphen C. Schauer 6

Corollary 119
There is no (direct) relationship between Euler and Hamilton graphs.
VU Algorithmen auf Graphen C. Schauer 7

Hamilton cycles

Hamilton cycles

A rst glance at algorithmic approaches


Formulation as ILP
x{vi ,vj } = |V | for all vi V for all S V , S = (1) (2) (3) (4)

Practical Applications

{vi ,vj }E vj N(vi )

Traveling Salesman Problem (TSP) Car Sequencing Problem (CarSP / CSP) Reconstruction of Strip-Shredded Documents Networkdesign in general Drilling of Printed Circuit Boards

x{vi ,vj } = 2

{vi ,vj }E (S)

x{vi ,vj } = |S| 1

x{vi ,vj } {0, 1}

for all {vi , vj } E

N(vi ) . . . all nodes vj V adjacent to vi E (S) . . . edges {vi , vj } incident to nodes in S but not to nodes in V \ S
VU Algorithmen auf Graphen C. Schauer 8 VU Algorithmen auf Graphen C. Schauer 9

Hamilton cycles

Hamilton cycles

Traveling Salesman Problem (TSP)


Given
a graph G (V , E ) a weight function w : E R

TSP Versions

Searched
a Hamilton cycle HC with minimal weight
eHC

w (e)

Asymmetric TSP (undirected graph) Symmetric TSP (directed graph) Metric TSP (triangle inequality) Euclidean TSP (metric TSP with Euclidean distances)

complexity
this problem is known to be NP-hard

Generalized TSP (clusters of cities, visit one city of each cluster)

VU Algorithmen auf Graphen

C. Schauer

10

VU Algorithmen auf Graphen

C. Schauer

11

Hamilton cycles

Hamilton cycles

Approaches for the TSP

Digression: approximation algorithms


Assume
s (p). . . costs for optimal solution for a given optimization problem instance p s(p). . . costs for solution generated by algorithm A for a given optimization problem instance p

formulation as ILP (or other exact approaches)


not practicable (for large instances)

heuristics
no guarantee about the solution quality

approximation algorithms
general TSP cannot be approximated but the symmetric, metric TSP

Denition 120 (Approximation algorithm)


An algorithm A is called constant c-factor approximation algorithm for minimization problems, i for each problem instance p s(p) c s (p) holds, with c 1.

VU Algorithmen auf Graphen

C. Schauer

12

VU Algorithmen auf Graphen

C. Schauer

13

Hamilton cycles

Hamilton cycles

Euclidean TSP
Given
an euclidean graph G (V , E ) a weight function w : E R

MST-heuristic for the Euclidean TSP


Algorithm 1: MST-Heuristic(G (V , E ))

Searched
a Hamilton cycle HC with minimal weight
eHC

1 2

w (e)

3 4

compute an MST S duplicate all edges of S /* multigraph S D */ D and give this tour an orientation create an Euler tour F on S go along F and add all vertices when rst visited to nal TSP-tour T

Proposition 121
There are approximation algorithms for this variant of TSP.

Remark 122
To simplify matters assume G is complete. (1)
VU Algorithmen auf Graphen C. Schauer 14 VU Algorithmen auf Graphen

(2)
C. Schauer

(4)
15

Hamilton cycles

Hamilton cycles

Quality of MST-heuristic

Christodes-heuristic for the Euclidean TSP


Algorithm 2: Christofides(G (V , E ))
1 2

Theorem 123
The MST-heuristic is a 2-factor approximation algorithm for the euclidean TSP.
3 4

compute a MST S compute a perfect minimum weight matching M of all nodes with odd degree in S /* graph S M */ M and give this tour an orientation create an Euler tour F on S go along F and add all vertices when rst visited to nal TSP-tour T

Proof.
w (MST ) w (OPT ) w (HEU) 2 w (MST )

(1)
VU Algorithmen auf Graphen C. Schauer 16 VU Algorithmen auf Graphen

(2)
C. Schauer

(4)
17

Hamilton cycles

Quality of Christodes-heuristic
Theorem 124
The Christodes-heuristic is a 3 -factor approximation algorithm for the 2 euclidean TSP.

Proof.
w (MST ) w (OPT ) 1 w (M) 2 w (OPT ) w (HEU) = w (MST ) + w (M) 3 w (OPT ) 2

how to compute a perfect minimum weight matching?


VU Algorithmen auf Graphen C. Schauer 18

You might also like