Maths Graph Theory
Maths Graph Theory
GRAPH THEORY
TEXTBOOKS in MATHEMATICS
Series Editors: Al Boggess and Ken Rosen
PUBLISHED TITLES
ABSTRACT ALGEBRA: A GENTLE INTRODUCTION
Gary L. Mullen and James A. Sellers
ABSTRACT ALGEBRA: AN INTERACTIVE APPROACH, SECOND EDITION
William Paulsen
ABSTRACT ALGEBRA: AN INQUIRY-BASED APPROACH
Jonathan K. Hodge, Steven Schlicker, and Ted Sundstrom
ADVANCED LINEAR ALGEBRA
Hugo Woerdeman
ADVANCED LINEAR ALGEBRA
Nicholas Loehr
ADVANCED LINEAR ALGEBRA, SECOND EDITION
Bruce Cooperstein
APPLIED ABSTRACT ALGEBRA WITH MAPLE™ AND MATLAB®, THIRD EDITION
Richard Klima, Neil Sigmon, and Ernest Stitzinger
APPLIED DIFFERENTIAL EQUATIONS: THE PRIMARY COURSE
Vladimir Dobrushkin
APPLIED DIFFERENTIAL EQUATIONS WITH BOUNDARY VALUE PROBLEMS
Vladimir Dobrushkin
APPLIED FUNCTIONAL ANALYSIS, THIRD EDITION
J. Tinsley Oden and Leszek Demkowicz
A BRIDGE TO HIGHER MATHEMATICS
Valentin Deaconu and Donald C. Pfaff
COMPUTATIONAL MATHEMATICS: MODELS, METHODS, AND ANALYSIS WITH MATLAB® AND MPI,
SECOND EDITION
Robert E. White
A COURSE IN DIFFERENTIAL EQUATIONS WITH BOUNDARY VALUE PROBLEMS, SECOND EDITION
Stephen A. Wirkus, Randall J. Swift, and Ryan Szypowski
A COURSE IN ORDINARY DIFFERENTIAL EQUATIONS, SECOND EDITION
Stephen A. Wirkus and Randall J. Swift
DIFFERENTIAL EQUATIONS: THEORY, TECHNIQUE, AND PRACTICE, SECOND EDITION
Steven G. Krantz
PUBLISHED TITLES CONTINUED
DIFFERENTIAL EQUATIONS: THEORY, TECHNIQUE, AND PRACTICE WITH BOUNDARY VALUE PROBLEMS
Steven G. Krantz
DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES, THIRD EDITION
George F. Simmons
DIFFERENTIAL EQUATIONS WITH MATLAB®: EXPLORATION, APPLICATIONS, AND THEORY
Mark A. McKibben and Micah D. Webster
DISCOVERING GROUP THEORY: A TRANSITION TO ADVANCED MATHEMATICS
Tony Barnard and Hugh Neill
DISCRETE MATHEMATICS, SECOND EDITION
Kevin Ferland
ELEMENTARY NUMBER THEORY
James S. Kraft and Lawrence C. Washington
ESSENTIALS OF MATHEMATICAL THINKING
Steven G. Krantz
EXPLORING CALCULUS: LABS AND PROJECTS WITH MATHEMATICA®
Crista Arangala and Karen A. Yokley
EXPLORING GEOMETRY, SECOND EDITION
Michael Hvidsten
EXPLORING LINEAR ALGEBRA: LABS AND PROJECTS WITH MATHEMATICA®
Crista Arangala
EXPLORING THE INFINITE: AN INTRODUCTION TO PROOF AND ANALYSIS
Jennifer Brooks
GRAPHS & DIGRAPHS, SIXTH EDITION
Gary Chartrand, Linda Lesniak, and Ping Zhang
INTRODUCTION TO ABSTRACT ALGEBRA, SECOND EDITION
Jonathan D. H. Smith
INTRODUCTION TO ANALYSIS
Corey M. Dunn
INTRODUCTION TO MATHEMATICAL PROOFS: A TRANSITION TO ADVANCED MATHEMATICS, SECOND EDITION
Charles E. Roberts, Jr.
INTRODUCTION TO NUMBER THEORY, SECOND EDITION
Marty Erickson, Anthony Vazzana, and David Garth
INVITATION TO LINEAR ALGEBRA
David C. Mello
PUBLISHED TITLES CONTINUED
A TOUR THROUGH
GRAPH THEORY
KARIN R. SAOUB
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been
made to publish reliable data and information, but the author and publisher cannot assume responsibility for the
validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the
copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to
publish in this form has not been obtained. If any copyright material has not been acknowledged please write and
let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or
utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including
photocopying, microfilming, and recording, or in any information storage or retrieval system, without written
permission from the publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.com
(http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive,
Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for
a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of
payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only
for identification and explanation without intent to infringe.
Preface xiii
1 Eulerian Tours 1
2 Hamiltonian Cycles 35
3 Paths 81
ix
x Contents
5 Matching 151
Appendix 285
Creating a Triangle . . . . . . . . . . . . . . . . . . . . . . . . 285
Finding Angle Measure . . . . . . . . . . . . . . . . . . . . . 285
Finding the Fermat Point . . . . . . . . . . . . . . . . . . . . 286
Other Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Bibliography 295
Index 301
Preface
Graph theory has been my passion since senior year of college. I was hooked
after just one week of my first course in graph theory. I completely changed
my plans post-graduation, choosing to apply to graduate schools and study
more mathematics. I found the interplay between rigorous proofs and simple
drawings both appealing and a nice break from my more computationally
heavy courses. Since becoming a teacher I have found a new appreciation for
graph theory, as a concept that can challenge students’ notions as to what
mathematics is and can be.
You might wonder why I chose to write this book, as there are numerous
texts devoted to the study of graph theory. Most books either focus on the
theory and the exploration of proof techniques, or contain a chapter or two on
the algorithmic aspect of a few topics from graph theory. This book is intended
to strike a balance between the two — focus on the accessible problems for
college students not majoring in mathematics, while also providing enough
material for a semester long course.
The goal for this textbook is to use graph theory as the vehicle for a
one-semester liberal arts course focusing on mathematical reasoning. Expla-
nations and logical reasoning for solutions, but no formal mathematical proofs,
are provided. There are discussions of both historical problems and modern
questions, with each chapter ending in a section detailing some more in-depth
problems. The final chapter also provides more rigorous graph theory and
additional topics that I personally find interesting but for which there is not
enough material to warrant an entire chapter. Each chapter will include prob-
lems to test understanding of the material and can be used for homework
or quiz problems. In addition, project ideas and items requiring research are
included at the end of each exercise section. Selected answers are available on
page 289.
xiii
xiv Preface
examples, draw graphs, and play around with the concepts. We learn by doing,
not passively reading or watching someone perform mathematics. This book
contains examples often posed in the form of a question. You should attempt to
find the solution before reading the one provided. In addition, some definitions
and concepts can get technical (as happens in mathematics) and the best way
to truly understand these is through working examples. At times, details of
an example, especially if it is the second or third of a type, will be left for the
reader or will appear in the exercises.
1.2
1.3
Thanks
I owe a huge debt to the many people who made this book possible.
To my colleagues Adam Childers, Chris Lee, Roland Minton, Maggie Rah-
moeller, Hannah Robbins, and David Taylor for their unwavering support. In
particular, David Taylor who provided a great sounding board for my ideas,
gave advice on formatting, and found the typos I could not.
To my sister-in-law, Leena Saoub Saunders, for her expertise in designing
the cover of this book.
To my parents, David and Pamela Steece, who always supported my
dreams and taught me the benefit of hard work.
To my husband Samer and children, Layla and Rami, who bring joy to my
life and endured my excitement and exasperation while writing this book.
To my CRC Press team, namely editor Bob Ross, editorial assistant Jose
Soto, copy editor Michele Dimont, and designer Kevin Craig, for their guidance
through the long process of writing a book.
Finally, a very special thanks goes to Ann Trenk, my graph theory professor
at Wellesley College. If not for her, I would not have discovered my life’s
passion and you would not be reading this book.
1
2 A Tour through Graph Theory
Without worrying about the technicalities, see if you can find a solution to
the Königsberg Bridge Problem! To aid in your analysis, note that Königsberg
contains seven brides and four distinct landmasses.
Definition 1.1 A graph G consists of two sets: V (G), called the vertex set,
and E(G), called the edge set. An edge, denoted xy, is an unordered pair of
vertices. We will often use G or G = (V, E) as short-hand.
e b
d c
Note that two lines were drawn between vertices c and d as the edge cd is
listed twice in the edge set. In addition, a circle was drawn at b to indicate an
edge (bb) that starts and ends at the same vertex.
It should be noted that the drawing of a graph can take many different
forms while still representing the same graph. The only requirement is to
faithfully record the information from the vertex set and edge set. We often
draw graphs with the vertices in a circular pattern (as shown in the example
Eulerian Tours 3
above), though in some instances other configurations better display the de-
sired information. The best configuration is the one that reduces complexity
or best illustrates the relationships arising from the vertex set and edge set.
Example 1.2 Consider the graph G from Example 1.1. Below are two
different drawings of G.
a c e
a b c d e
b d
To verify that these drawings represent the same graph from Example 1.1, we
should check the relationships arising from the vertex set and edge set. For
example, there are two edges between vertices c and d, a loop at b, and no
edges at e. You should verify the remaining edges.
– bb is a loop
• If there is more than one edge with the same endpoints, we call these
multi-edges.
– cd is a multi-edge
• If a graph has no multi-edges or loops, we call it simple.
• The degree of a vertex is the number of edges incident to that vertex,
with a loop adding two to the degree. Denote the degree of vertex v as
deg(v). If the degree is even, the vertex is called even; if the degree is
odd, then the vertex is odd.
– deg(a) = 2, deg(b) = 4, deg(c) = 3, deg(d) = 3, deg(e) = 0
Now that we have some basic graph terms, let’s look back at the
Königsberg Bridge Problem. Euler brilliantly reduced the map of Königsberg
to a simpler version where only the relationships between landmasses was of
importance. In graph form, the vertices represent the landmasses in the city
and the bridges are the edges. This is what we refer to as modeling — taking
a complex real-world problem and representing it mathematically.
Modeling is used in many branches of
mathematics, but often the phenomenon
in question is being translated into an
equation or experiment; here we are rep-
resenting a puzzle as a graph and using
properties of graphs to find a solution.
To the right is the drawing from Euler’s
original paper, and below it a graph c
model of Königsberg. You should see
how much simpler the graph is compared
to either the original map or Euler’s
drawing of the city. This is one bene-
fit of using a graph — only the relevant
information is displayed, which in this a d
case consists solely of bridges connect-
ing landmasses. The vertices represent
an island, a south bank, a north bank,
and a peninsula (a, b, c, and d, respec-
tively). The answer to the initial ques- b
tion becomes more evident when using
the graph: can you leave your home (vertex), travel across each of the bridges
(edges) in the city (graph) exactly once and then return home? If you have
not done so already, try it again on the graph. Do you have an answer?
Before we get too much further into answering the Königsberg Bridge
Eulerian Tours 5
Problem and its subsequent generalization, let’s go through a few more mod-
eling problems.
Example 1.3 Professor Minton needs to create a seating chart for his overly
chatty class. He wants students seated away from their friends whenever pos-
sible. He knows that Adam is friends with Betty, Carlos, Dave and Frank;
Betty is friends with Adam, Carlos, Dave and Emily; Dave is friends with
Adam, Betty, Carlos and Emily; and Frank is friends with Adam and Carlos.
Draw a graph that depicts these friendships.
Adam
Frank Betty
Emily Carlos
Dave
Note that since friendships are symmetric (e.g., Adam is friends with Betty
and so Betty is friends with Adam) we only draw one edge between the ver-
tices. In Chapter 2 we will explore asymmetric relationships where direction-
ality becomes important.
Note that edges do not occur between two organizations or between two rooms,
as these would be nonsensical in the context of the problem. The graph above
is an example of a bipartite graph. This type of graph is often used to model
interactions between two distinct types of groups and will appear later in
Chapters 5 and 6.
• A cycle is a closed path; that is, a path that starts and ends at the
same vertex. Thus cycles cannot repeat edges or vertices. Note: we do
not consider the starting and ending vertex as being repeated since each
vertex is entered and exited exactly once. A cycle on n vertices is denoted
Cn .
The length of any of these tours is defined in terms of the number of edges.
For example, Pn has length n − 1 and Cn has length n.
Example 1.5 Given the graph below, find a trail (that is not a path) from
a to c, a path from a to c, a circuit (that is not a cycle) starting at b, and a
cycle starting at b.
a b c
d
f
g e
8 A Tour through Graph Theory
Solution:
Trail from a to c
a b 7 c
6
1
3
d
f
4
5
2
g e
Path from a to c
a b c
1 5
d
f
2 3
4
g e
Circuit starting at b
a b 6 c
1
5
2
d
f
4 3
g e
Cycle starting at b
a b 4 c
1
3
2
d
f
g e
Eulerian Tours 9
Note that the trail from a to c is not a path since the vertex f is repeated
and the circuit starting at b is not a cycle since the vertex d is repeated.
Moreover, the examples given above are not the only solutions but rather an
option among many possible solutions.
This definition may seem overly technical when visually it is often easy to
determine if a graph is connected. The concept of connectedness is surprisingly
important in applications. The example below illustrates the importance of
connectedness for the Königsberg Bridge Problem.
Example 1.6 Island City has two islands, a peninsula, and left and right
banks, as shown on the left below. Modeling the relationship between the
landmasses and bridges of Island City gives us the graph below on the right.
r
p i1 i2
If the same puzzle were posed to the citizens of Island City as the one
for Königsberg, it would be impossible to travel every bridge and then return
home. In particular, there is no way to even travel from one side of the river
to the other! Thus, if we even have a hope of finding a solution, the resulting
graph must, at a minimum, be connected.
The Königsberg Bridge Problem is not just looking for a circuit, but rather
a special type that hits every edge. In honor of Leonhard Euler, these special
circuits are named for him. A similar term is used when allowing differing
starting and ending location of the tour.
10 A Tour through Graph Theory
Part of Euler’s brilliance was not only his ability to quickly solve a puzzle,
such as the Königsberg Bridge Problem, but also the foresight to expand on
that puzzle. What makes a graph Eulerian? Under what conditions will a city
have the proper tour? In his original paper, Euler laid out the conditions for
such a solution, though as was typical of the time, he only proved a portion
of the statement (see [2] or [14]).
The proof that the conditions above were indeed both necessary and suf-
ficient was not published until 1873. The work was completed by German
mathematician Carl Hierholzer, who unfortunately died too young to see his
work in print. His contribution was recognized through the naming of one
procedure for finding Eulerian circuits that is discussed in the next section.
Example 1.7 Look back at each of the graphs appearing so far in this chap-
ter. Which ones are Eulerian? semi-Eulerian? neither?
Solution:
• The graph representing Königsberg is neither Eulerian nor semi-Eulerian
since all four vertices are odd.
• The graph in Example 1.1 is neither Eulerian nor semi-Eulerian since it
is not connected.
• The graph in Example 1.3 is Eulerian since it is connected and all the
vertices have degree 2 or 4.
• The graph in Example 1.4 is semi-Eulerian since it is connected and
exactly two vertices are odd (namely, 372 and 271).
• Even though the graph in Example 1.5 is connected, it is neither Eule-
rian nor semi-Eulerian since it has more than two odd vertices (namely,
a, b, e, and f ).
Note that the solution discussed in the first bullet above definitively an-
swers the Königsberg Bridge Problem — there is no way to leave your home,
travel across every bridge in the city exactly once, and return home!
In addition to the result above, Euler also determined some basic properties
of graphs in his seminal paper. The most important of these is stated below.
If the sum total of a collection of integers is even, how many odd integers
could appear in the sum? If not immediately clear, try a few examples. If
we add an odd number of odd integers, will the sum be even? No! In graph
theoretic terms, we get the following corollary to the Handshaking Lemma.
Corollary 1.8 There must be an even number of odd vertices in any graph G.
Why is this true? Since the sum of the degrees in any graph is twice the
number of edges, we know that the sum of the degrees must be even. Based
on our discussion above, this implies the number of odd vertices must also be
even.
For our purposes, algorithms will be described in terms of the input, steps
to perform, and output, so it is clear how to apply the algorithm in various
scenarios. For the pseudo-code or more technical forms of the algorithms in
this book, the reader is encouraged to explore [4] or [24].
Fleury’s Algorithm
The first method for finding an Eulerian circuit that we discuss is Fleury’s
Algorithm. Although Fleury’s solution was not the first in print, it is one of the
easiest to walk through (no pun intended) [16]. As with all future algorithms
presented in this book, an example will immediately follow the description of
the algorithm and further examples are available in the exercises. Note that
Fleury’s Algorithm will produce either an Eulerian circuit or an Eulerian trail
depending on which solution is possible.
Eulerian Tours 13
Fleury’s Algorithm
Steps:
1. Choose a starting vertex, call it v. If G has no odd vertices, then any
vertex can be the starting point. If G has exactly two odd vertices, then
v must be one of the odd vertices.
The intention behind Fleury’s Algorithm is that you are prevented from
getting stuck at a vertex with no edges left to travel. In practice, it may be
helpful to use two copies of the graph — one to keep track of the route and
the other where labeled edges are removed. This second copy makes it easier
to see which edges are unavailable to be chosen. In the example below, the
vertex under consideration during a step of the algorithm will be highlighted
and edges will be labeled in the order in which they are chosen.
Example 1.8 Input: A connected graph (shown below) where every vertex
has even degree. We are looking for an Eulerian circuit.
v x
y z
u
w
Step 2: We can choose any edge incident to v. Here we chose vx. The labeled
graph is on the left and the unlabeled portions are shown on the right with
14 A Tour through Graph Theory
v 1 x v x
y z y z
u u
w w
Step 3: Looking at the graph to the right, we can choose any edge out of x.
Here we chose xy. The labeled and unlabeled graphs have been updated below.
v 1 x v x
y z y z
u u
w w
Step 4: At this point we cannot choose yv, as its removal would disconnect
the unlabeled graph shown above on the right. However, yx and yz are both
valid choices. Here we chose yx.
v 1 x v x
y z y z
u u
w w
v 1 x v
2
4
y z y z
u u
w w
v 1 x v
2
4
y 5 z y
u u
w w
v 1 x v
2
6 4
y 5 z
u u
w w
Step 8: Both vw and vu are valid choices for the next edge. Here we chose vw.
v 1 x v
2
6 4
7 3
y 5 z
u u
w w
16 A Tour through Graph Theory
v 1 x v
2
6 4
7 3
y 5 z
u u
8
w
v 1 x v
2
6 4
9 3
7
y 5 z
u
8
w
Output: The graph above on the left has an Eulerian circuit labeled, starting
and ending at vertex v.
Hierholzer’s Algorithm
As mentioned above, Hierholzer’s Algorithm is named for the German
mathematician whose paper inspired the procedure described below. This ef-
ficient algorithm begins by finding an arbitrary circuit originating from the
starting vertex. If this circuit contains all the edges of the graph, then an
Eulerian circuit has been found. If not, then we join another circuit to the
existing one.
Hierholzer’s Algorithm
Steps: