Summary of Chapter 6


Section 6.1: Eulerian Paths and Circuits

Graphs: abstractions of real-world problems

Graphs represent abstraction of real-world problems. Our first problem involved the bridges of Konigsberg, and the real-world items we represented by a graph were of two sorts: landmasses, and the bridges which connected them. The mathematician is uninterested in the actual contours and magnitude of the landmasses, and so shrinks them down to points; similarly, she ignores the actual dimensions of the bridges, simply representing them as curve connectors of the point landmasses.

This process of abstraction is essential to the solution of many real-world problems. In another example, we considered the four-color mapping problem, in which the two items were states ("landmasses") and the borders between them ("bridges").

Important Definitions:
graph
points (vertices) and curves (edges) linking one vertex to another
graph theory
the study of graphs and their applications
odd vertex
a vertex with an odd number of edges attached to it
even vertex
a vertex with an even number of edges attached to it
loop
an edge connecting a vertex to itself
path
a route along the edges from one vertex to another (which doesn't repeat any edges)
circuit
a path beginning and ending at the same vertex
connected graph
there is at least one path connecting any two vertices (otherwise the graph is called disconnected)


Euler's Konigsberg Solution

The Konigsberg bridge problem inspired the great mathematician Euler to propose a theorem about special paths: those paths which pass over every edge of a graph exactly once (Eulerian paths and circuits).

Euler's Theorem
  1. A graph has an Eulerian circuit if and only if
    • it is connected, and
    • all of its vertices are even.
  2. A graph has an Eulerian path if and only
    • it is connected, and
    • all of its vertices are even or exactly two vertices are odd.

Strategy for finding an Eulerian path:
If there is an Eulerian path on a graph with two odd vertices, then the path begins on one odd vertex and ends at the other.


Eulerization

We saw, however, that many real-life graphs do not have either zero or exactly two odd vertices. In those cases we may still want to carry out the same sort of task as the citizens of Konigsberg: we want to pass over every bridge (or street, or sidewalk) with as little backtracking as possible. This is a typical problem in graph theory. In order to solve it, we use

Eulerization:
we create a new graph from the original graph by adding to it additional edges to turn all odd vertices into even vertices.

As we showed in exercise #32, p. 379, there is always an even number of odd vertices in a graph.

Strategy for finding an Eulerization:
  1. Circle all odd vertices in the graph.
  2. Pair each odd vertex with another close to it in the graph.
  3. For each pair, find the path with the fewest edges connecting them in the original graph, and duplicate the edges along this path.

For practical purposes, you might think of these new edges as backtracks along the original edges. Often the original edges represent something concrete (e.g. bridges, streets, sidewalks, circuit boards), whereas the edges we add in Eulerization simply reflect the fact that we need to travel over the existing edges more than once.


Section 6.2: The traveling salesman problem

In this section, we change the focus from the edges to the vertices. While Euler concerned himself with the edges, the great Irish mathematician Hamilton focused on the vertices. Euler's problem was to pass over every edge exactly once, whereas Hamilton worried about passing through each vertex exactly once (arriving back home after a circuit of all vertices was made).

Hamiltonian circuit
A circuit that begins at one vertex, goes through each other vertex exactly once, then returns to the starting vertex.

Often there is a penalty associated with travelling from one vertex to another. For example, the penalty may be the distance (and hence cost of moving) between the points, or the energy required to move from one position to another. Hence the edges have a value of some sort associated with them. This leads us to the concept of the

weighted graph:
a graph for which each edge is assigned a weight, representing perhaps the distance or time of travel between two vertices (which might represent cities).

Business is terribly interested in this type of problem, and especially in the general optimization problem of minimizing the cost (distance, time, etc.) of traveling between all points in the graph. This accounts for the importance mathematicians attribute to this problem.

We will consider only a special type of weighted graph in this section. Often it is possible to consider going directly from any vertex to any other vertex, which results in what is called a

complete graph:
a graph for which there is exactly one edge between every pair of vertices.
Working only with complete graphs, this optimization problem is discussed under the name of
the traveling salesman problem:
the problem of finding a Hamiltonian circuit in a complete weighted graph for which the sum of the weights of the edges is a minimum.
Several nice examples of real-life problems of this type are given in your text on page 383.

Sometimes a simple problem has no simple solution, and that's the case of the traveling salesman problem. The computational methods for solving large problems of this type require so much computer time that weeks, months, or years may go by while you wait for your solution. For that reason, we often consider methods which give only approximations to the actual solution. In this section we consider two such algorithms. The first is the

Nearest Neighbor Algorithm:
  1. Start at the vertex on which the circuit is to begin and end ("home").
  2. Move from each vertex to the "nearest" (in the sense of edge weight) unvisited vertex.
  3. When all the unvisited vertices have been visited, return home.

We saw that the solution obtained using the nearest neighbor algorithm was not necessarily optimal ("the best"): that is, by comparing all possible Hamiltonian circuits the nearest neighbor solution did not give the lowest total weight (e.g. #7, p. 396, discussed in class). The hope is always that the algorithms will give a solution which, while perhaps not the best, is still pretty good.

We considered a second algorithm, the

Greedy Algorithm:
  1. Select the edge of least weight.
  2. Continue selecting additional edges by choosing from the remaining edges the edge of least weight unless
    • choosing that edge forms a non-Hamiltonian circuit (not all vertices are visited), or
    • three edges come together in a single vertex (a vertex would be visited multiple times).
    In the event that one of these occurs, reject this edge and continue choosing from amongst the remaining edges.
  3. Continue until a Hamiltonian circuit is formed.
Again, as shown in #7, p. 396, this algorithm may fail to find the optimal solution. Too bad! We hope for just a pretty good solution.


Section 6.3: Efficient Networking: Minimal Spanning Trees

A different kind of problem that arises in graph theory is the problem of connecting vertices in a sensible way: we may want to connect all vertices to each other without making spurious connections (connections may be expensive, for example). Thus we want to be efficient in our connections, and not make any that are unnecessary.

Important Definitions:

subgraph of graph G:
A graph made up of some of the vertices and edges of the graph G.
tree:
A connected graph containing no circuits.
spanning tree of graph G:
A tree containing all the vertices of G.
Note: A spanning tree has the property that there is exactly one path between any two vertices.


Example:

As an example, I mentioned the "spoke and hub" networks that many airlines use: it may be expensive to connect minor cities with direct flights, so the airlines create networks that require customers to fly from a city to a hub (along a spoke), and then from the hub to the destination (along a separate hub).

Suppose that an airline wants to serve five cities using a "spoke and hub" system: if the airline wants to decide which city to turn into its hub, it might This is one sort of spanning tree problem.

Minimal Spanning Trees

In general, a business's problem can often be stated as a search for a

Minimal Spanning Tree for a weighted graph:
a spanning tree for which the sum of the weights of the edges is a minimum.

Once again, we have an algorithm, only this time the algorithm actually finds the solution! It's called

Prim's Algorithm:
  1. Pick any vertex (this is a tree - the "starting tree")
  2. Find the "nearest" vertex (in the sense of edge weight) not already contained in the current tree, and connect this vertex to the tree using this least-weight edge.
  3. Continue this process until a spanning tree results.

Website maintained by Andy Long. Comments appreciated.
aelon@sph.umich.edu