Section 6.2: Euler Paths and Hamiltonian Circuits

Abstract:

Graphs are useful for characterizing two interesting problems: the traveling salesman problem, and the highway inspector problem. The problem in each case is to traverse a network in an optimal way, whether the focus is on the nodes (Sir William Rowan Hamilton, 1805-1865) or the arcs (Leonhard Euler, 1707-1783).

Euler Paths

Definition: an Euler Path is a path in which each arc is used exactly once. Also known as the highway inspector problem, and the

Euler got interested in these arcs when he encountered the Königsberg bridge problem (p. 421/425); a game in which the object was to cross every bridge without crossing any bridge twice. Euler solved this problem by inventing and then using Graph Theory, basically!

The bridges are the arcs, and the land masses are nodes, turned into the graph of Figure 6.5, p. 421/426.

To do: Practice 7, p. 421/426

Theorem: in any graph, the number of odd nodes (nodes of odd degree) is even.

Outline of proof:

  1. Suppose that there are A arcs, and N nodes. Each arc contributes 2 ends; the number of ends is 2A, and the degrees tex2html_wrap_inline144 satisfy

    displaymath130

  2. displaymath131

    and the left hand side is even (call it 2m).

  3. The sum of two odd degrees is even, so assume (we proceed by contradiction) that there is an odd number of odd nodes. We can pair up all but one (say i=k), and then

    displaymath132

  4. From which we conclude that

    displaymath133

    which means that tex2html_wrap_inline144 was, in fact, even; but this is a contradiction. Hence, the number of odd nodes is even.

Theorem: an Euler path exists in a connected graph tex2html_wrap_inline152 there are either two or zero odd nodes.

To do: Practice 9, p. 423/428

EulerPath Algorithm

The EulerPath algorithm makes use of the adjacency matrix representation of a graph to check for Euler paths. It simply counts up elements in a row i of the matrix (the degree of node i), and checks whether that's even or odd; if in the end there are not zero or two even nodes, there's no Euler path!

To do: Exercise 11/12, p. 427/432

Hamiltonian Circuit Problem (the traveling salesman)

Definition: a Hamiltonian Circuit (or Cycle) is a cycle using every node of the graph.

``For example, consider a robot arm assigned to solder all the connections on a printed circuit board. The shortest tour that visits each solder point exactly once defines the most efficient path for the robot. A similar application arises in minimizing the amount of time taken by a graphics plotter to draw a given figure.'' (from http://www.cs.sunysb.edu/~algorith/files/traveling-salesman.shtml)

An example is a complete graph, like tex2html_wrap_inline158 : there is a path from each node to every other node, so no matter where you start, you can trace a cycle through every node (breaks down for tex2html_wrap_inline160 .

To do: Practice 11, p. 425/430

To do: Exercise 14/15, p. 427/432 (using trees, symmetry, and exhaustion!)

Unfortunately, there's no nice HamiltonCircuit algorithm for determining when there is a circuit (only very grungy, computationally intensive ones!). The traveling salesman problem (the optimal Hamiltonian Circuit on a weighted graph) is the poster child for the NP-complete problem.



LONG ANDREW E
Wed Oct 30 09:56:39 EST 2002