Undergraduate Texts in Mathematics Editors
S. Axler K.A. Ribet
For other titles published in this series, go to http://www.springer.com/series/666
John M. Harris Jeffry L. Hirst Michael J. Mossinghoff •
•
Combinatorics and Graph Theory Second Edition
123
John M. Harris Department of Mathematics Furman University Greenville, SC 29613 USA [emailprotected]
Jeffry L. Hirst Mathematical Sciences Appalachian State University 121 Bodenheimer Dr. Boone, NC 28608 USA [emailprotected]
Michael J. Mossinghoff Department of Mathematics Davidson College Box 6996 Davidson, NC 28035-6996 USA [emailprotected]
Editorial Board S. Axler Mathematics Department San Francisco State University San Francisco, CA 94132 USA [emailprotected]
ISSN: 0172-6056 ISBN: 978-0-387-797710-6 DOI: 10.1007/978-0-387-79711-3
K.A. Ribet Department of Mathematics University of California at Berkeley Berkeley, CA 94720 USA [emailprotected]
e-ISBN: 978-0-387-79711-3
Library of Congress Control Number: 2008934034 Mathematics Subject Classification (2000): 05-01 03-01 c 2008 Springer Science+Business Media, LLC All rights reserved. This work may not be translated or copied in whole or in part without the written permission of the publisher (Springer Science+Business Media, LLC, 233 Spring Street, New York, NY 10013, USA), except for brief excerpts in connection with reviews or scholarly analysis. Use in connection with any form of information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed is forbidden. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. Printed on acid-free paper springer.com
To Priscilla, Sophie, and Will, Holly, Kristine, Amanda, and Alexandra
Preface to the Second Edition
There are certain rules that one must abide by in order to create a successful sequel. — Randy Meeks, from the trailer to Scream 2
While we may not follow the precise rules that Mr. Meeks had in mind for successful sequels, we have made a number of changes to the text in this second edition. In the new edition, we continue to introduce new topics with concrete examples, we provide complete proofs of almost every result, and we preserve the book’s friendly style and lively presentation, interspersing the text with occasional jokes and quotations. The first two chapters, on graph theory and combinatorics, remain largely independent, and may be covered in either order. Chapter 3, on infinite combinatorics and graphs, may also be studied independently, although many readers will want to investigate trees, matchings, and Ramsey theory for finite sets before exploring these topics for infinite sets in the third chapter. Like the first edition, this text is aimed at upper-division undergraduate students in mathematics, though others will find much of interest as well. It assumes only familiarity with basic proof techniques, and some experience with matrices and infinite series. The second edition offers many additional topics for use in the classroom or for independent study. Chapter 1 includes a new section covering distance and related notions in graphs, following an expanded introductory section. This new section also introduces the adjacency matrix of a graph, and describes its connection to important features of the graph. Another new section on trails, circuits, paths, and cycles treats several problems regarding Hamiltonian and Eulerian paths in
viii
Preface to the Second Edition
graphs, and describes some elementary open problems regarding paths in graphs, and graphs with forbidden subgraphs. Several topics were added to Chapter 2. The introductory section on basic counting principles has been expanded. Early in the chapter, a new section covers multinomial coefficients and their properties, following the development of the binomial coefficients. Another new section treats the pigeonhole principle, with applications to some problems in number theory. The material on P´olya’s theory of counting has now been expanded to cover de Bruijn’s more general method of counting arrangements in the presence of one symmetry group acting on the objects, and another acting on the set of allowed colors. A new section has also been added on partitions, and the treatment of Eulerian numbers has been significantly expanded. The topic of stable marriage is developed further as well, with three interesting variations on the basic problem now covered here. Finally, the end of the chapter features a new section on combinatorial geometry. Two principal problems serve to introduce this rich area: a nice problem of Sylvester’s regarding lines produced by a set of points in the plane, and the beautiful geometric approach to Ramsey theory pioneered by Erd˝os and Szekeres in a problem about the existence of convex polygons among finite sets of points in the plane. In Chapter 3, a new section develops the theory of matchings further by investigating marriage problems on infinite sets, both countable and uncountable. Another new section toward the end of this chapter describes a characterization of certain large infinite cardinals by using linear orderings. Many new exercises have also been added in each chapter, and the list of references has been completely updated. The second edition grew out of our experiences teaching courses in graph theory, combinatorics, and set theory at Appalachian State University, Davidson College, and Furman University, and we thank these institutions for their support, and our students for their comments. We also thank Mark Spencer at Springer-Verlag. Finally, we thank our families for their patience and constant good humor throughout this process. The first and third authors would also like to add that, since the original publication of this book, their families have both gained their own second additions! May 2008
John M. Harris Jeffry L. Hirst Michael J. Mossinghoff
Preface to the First Edition
Three things should be considered: problems, theorems, and applications. — Gottfried Wilhelm Leibniz, Dissertatio de Arte Combinatoria, 1666 This book grew out of several courses in combinatorics and graph theory given at Appalachian State University and UCLA in recent years. A one-semester course for juniors at Appalachian State University focusing on graph theory covered most of Chapter 1 and the first part of Chapter 2. A one-quarter course at UCLA on combinatorics for undergraduates concentrated on the topics in Chapter 2 and included some parts of Chapter 1. Another semester course at Appalachian State for advanced undergraduates and beginning graduate students covered most of the topics from all three chapters. There are rather few prerequisites for this text. We assume some familiarity with basic proof techniques, like induction. A few topics in Chapter 1 assume some prior exposure to elementary linear algebra. Chapter 2 assumes some familiarity with sequences and series, especially Maclaurin series, at the level typically covered in a first-year calculus course. The text requires no prior experience with more advanced subjects, such as group theory. While this book is primarily intended for upper-division undergraduate students, we believe that others will find it useful as well. Lower-division undergraduates with a penchant for proofs, and even talented high school students, will be able to follow much of the material, and graduate students looking for an introduction to topics in graph theory, combinatorics, and set theory may find several topics of interest.
x
Preface to the First Edition
Chapter 1 focuses on the theory of finite graphs. The first section serves as an introduction to basic terminology and concepts. Each of the following sections presents a specific branch of graph theory: trees, planarity, coloring, matchings, and Ramsey theory. These five topics were chosen for two reasons. First, they represent a broad range of the subfields of graph theory, and in turn they provide the reader with a sound introduction to the subject. Second, and just as important, these topics relate particularly well to topics in Chapters 2 and 3. Chapter 2 develops the central techniques of enumerative combinatorics: the principle of inclusion and exclusion, the theory and application of generating functions, the solution of recurrence relations, P´olya’s theory of counting arrangements in the presence of symmetry, and important classes of numbers, including the Fibonacci, Catalan, Stirling, Bell, and Eulerian numbers. The final section in the chapter continues the theme of matchings begun in Chapter 1 with a consideration of the stable marriage problem and the Gale–Shapley algorithm for solving it. Chapter 3 presents infinite pigeonhole principles, K¨onig’s Lemma, Ramsey’s Theorem, and their connections to set theory. The systems of distinct representatives of Chapter 1 reappear in infinite form, linked to the axiom of choice. Counting is recast as cardinal arithmetic, and a pigeonhole property for cardinals leads to discussions of incompleteness and large cardinals. The last sections connect large cardinals to finite combinatorics and describe supplementary material on computability. Following Leibniz’s advice, we focus on problems, theorems, and applications throughout the text. We supply proofs of almost every theorem presented. We try to introduce each topic with an application or a concrete interpretation, and we often introduce more applications in the exercises at the end of each section. In addition, we believe that mathematics is a fun and lively subject, so we have tried to enliven our presentation with an occasional joke or (we hope) interesting quotation. We would like to thank the Department of Mathematical Sciences at Appalachian State University and the Department of Mathematics at UCLA. We would especially like to thank our students (in particular, Jae-Il Shin at UCLA), whose questions and comments on preliminary versions of this text helped us to improve it. We would also like to thank the three anonymous reviewers, whose suggestions helped to shape this book into its present form. We also thank Sharon McPeake, a student at ASU, for her rendering of the K¨onigsberg bridges. In addition, the first author would like to thank Ron Gould, his graduate advisor at Emory University, for teaching him the methods and the joys of studying graphs, and for continuing to be his advisor even after graduation. He especially wants to thank his wife, Priscilla, for being his perfect match, and his daughter Sophie for adding color and brightness to each and every day. Their patience and support throughout this process have been immeasurable. The second author would like to thank Judith Roitman, who introduced him to set theory and Ramsey’s Theorem at the University of Kansas, using an early draft
Preface to the First Edition
xi
of her fine text. Also, he would like to thank his wife, Holly (the other Professor Hirst), for having the infinite tolerance that sets her apart from the norm. The third author would like to thank Bob Blakley, from whom he first learned about combinatorics as an undergraduate at Texas A & M University, and Donald Knuth, whose class Concrete Mathematics at Stanford University taught him much more about the subject. Most of all, he would like to thank his wife, Kristine, for her constant support and infinite patience throughout the gestation of this project, and for being someone he can always, well, count on. September 1999
John M. Harris Jeffry L. Hirst Michael J. Mossinghoff
Contents
Preface to the Second Edition
vii
Preface to the First Edition
ix
1
Graph Theory 1.1 Introductory Concepts . . . . . . . . . 1.1.1 Graphs and Their Relatives . . . 1.1.2 The Basics . . . . . . . . . . . 1.1.3 Special Types of Graphs . . . . 1.2 Distance in Graphs . . . . . . . . . . . 1.2.1 Definitions and a Few Properties 1.2.2 Graphs and Matrices . . . . . . 1.2.3 Graph Models and Distance . . 1.3 Trees . . . . . . . . . . . . . . . . . . . 1.3.1 Definitions and Examples . . . 1.3.2 Properties of Trees . . . . . . . 1.3.3 Spanning Trees . . . . . . . . . 1.3.4 Counting Trees . . . . . . . . . 1.4 Trails, Circuits, Paths, and Cycles . . . 1.4.1 The Bridges of K¨onigsberg . . . 1.4.2 Eulerian Trails and Circuits . . 1.4.3 Hamiltonian Paths and Cycles . 1.4.4 Three Open Problems . . . . . 1.5 Planarity . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
1 2 2 5 10 17 18 21 26 30 31 34 38 43 51 52 55 60 67 73
xiv
Contents
1.6
1.7
1.8
1.9 2
1.5.1 Definitions and Examples . . . . . 1.5.2 Euler’s Formula and Beyond . . . . 1.5.3 Regular Polyhedra . . . . . . . . . 1.5.4 Kuratowski’s Theorem . . . . . . . Colorings . . . . . . . . . . . . . . . . . . 1.6.1 Definitions . . . . . . . . . . . . . 1.6.2 Bounds on Chromatic Number . . . 1.6.3 The Four Color Problem . . . . . . 1.6.4 Chromatic Polynomials . . . . . . . Matchings . . . . . . . . . . . . . . . . . . 1.7.1 Definitions . . . . . . . . . . . . . 1.7.2 Hall’s Theorem and SDRs . . . . . 1.7.3 The K¨onig–Egerv´ary Theorem . . . 1.7.4 Perfect Matchings . . . . . . . . . Ramsey Theory . . . . . . . . . . . . . . . 1.8.1 Classical Ramsey Numbers . . . . . 1.8.2 Exact Ramsey Numbers and Bounds 1.8.3 Graph Ramsey Theory . . . . . . . References . . . . . . . . . . . . . . . . . .
Combinatorics 2.1 Some Essential Problems . . . . . . . . . 2.2 Binomial Coefficients . . . . . . . . . . . 2.3 Multinomial Coefficients . . . . . . . . . 2.4 The Pigeonhole Principle . . . . . . . . . 2.5 The Principle of Inclusion and Exclusion . 2.6 Generating Functions . . . . . . . . . . . 2.6.1 Double Decks . . . . . . . . . . . 2.6.2 Counting with Repetition . . . . . 2.6.3 Changing Money . . . . . . . . . 2.6.4 Fibonacci Numbers . . . . . . . . 2.6.5 Recurrence Relations . . . . . . . 2.6.6 Catalan Numbers . . . . . . . . . 2.7 P´olya’s Theory of Counting . . . . . . . . 2.7.1 Permutation Groups . . . . . . . 2.7.2 Burnside’s Lemma . . . . . . . . 2.7.3 The Cycle Index . . . . . . . . . 2.7.4 P´olya’s Enumeration Formula . . 2.7.5 de Bruijn’s Generalization . . . . 2.8 More Numbers . . . . . . . . . . . . . . 2.8.1 Partitions . . . . . . . . . . . . . 2.8.2 Stirling Cycle Numbers . . . . . 2.8.3 Stirling Set Numbers . . . . . . . 2.8.4 Bell Numbers . . . . . . . . . . . 2.8.5 Eulerian Numbers . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
74 78 80 83 85 86 88 93 97 101 102 104 109 111 116 116 118 124 126
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
129 130 137 144 150 156 164 166 168 171 177 181 185 190 191 196 200 202 209 217 218 227 231 237 242
Contents
2.9
Stable Marriage . . . . . . . . . . . . 2.9.1 The Gale–Shapley Algorithm 2.9.2 Variations on Stable Marriage 2.10 Combinatorial Geometry . . . . . . . 2.10.1 Sylvester’s Problem . . . . . 2.10.2 Convex Polygons . . . . . . . 2.11 References . . . . . . . . . . . . . . . 3
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
xv
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
248 250 255 264 265 270 277
Infinite Combinatorics and Graphs 3.1 Pigeons and Trees . . . . . . . . . . . . . . . . . 3.2 Ramsey Revisited . . . . . . . . . . . . . . . . . 3.3 ZFC . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 Language and Logical Axioms . . . . . . 3.3.2 Proper Axioms . . . . . . . . . . . . . . 3.3.3 Axiom of Choice . . . . . . . . . . . . . 3.4 The Return of der K¨onig . . . . . . . . . . . . . 3.5 Ordinals, Cardinals, and Many Pigeons . . . . . 3.5.1 Cardinality . . . . . . . . . . . . . . . . 3.5.2 Ordinals and Cardinals . . . . . . . . . . 3.5.3 Pigeons Finished Off . . . . . . . . . . . 3.6 Incompleteness and Cardinals . . . . . . . . . . 3.6.1 G¨odel’s Theorems for PA and ZFC . . . . 3.6.2 Inaccessible Cardinals . . . . . . . . . . 3.6.3 A Small Collage of Large Cardinals . . . 3.7 Weakly Compact Cardinals . . . . . . . . . . . . 3.8 Infinite Marriage Problems . . . . . . . . . . . . 3.8.1 Hall and Hall . . . . . . . . . . . . . . . 3.8.2 Countably Many Men . . . . . . . . . . 3.8.3 Uncountably Many Men . . . . . . . . . 3.8.4 Espousable Cardinals . . . . . . . . . . . 3.8.5 Perfect Matchings . . . . . . . . . . . . 3.9 Finite Combinatorics with Infinite Consequences 3.10 k-critical Linear Orderings . . . . . . . . . . . . 3.11 Points of Departure . . . . . . . . . . . . . . . . 3.12 References . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
281 282 285 290 290 292 297 301 304 304 308 312 318 318 320 322 324 327 328 330 336 340 343 344 347 348 352
References
355
Index
369
1 Graph Theory
“Begin at the beginning,” the King said, gravely, “and go on till you come to the end; then stop.” — Lewis Carroll, Alice in Wonderland The Pregolya River passes through a city once known as K¨onigsberg. In the 1700s seven bridges were situated across this river in a manner similar to what you see in Figure 1.1. The city’s residents enjoyed strolling on these bridges, but, as hard as they tried, no resident of the city was ever able to walk a route that crossed each of these bridges exactly once. The Swiss mathematician Leonhard Euler learned of this frustrating phenomenon, and in 1736 he wrote an article [98] about it. His work on the “K¨onigsberg Bridge Problem” is considered by many to be the beginning of the field of graph theory.
FIGURE 1.1. The bridges in K¨onigsberg.
J.M. Harris et al., Combinatorics and Graph Theory, DOI: 10.1007/978-0-387-79711-3 1, c Springer Science+Business Media, LLC 2008
2
1. Graph Theory
At first, the usefulness of Euler’s ideas and of “graph theory” itself was found only in solving puzzles and in analyzing games and other recreations. In the mid 1800s, however, people began to realize that graphs could be used to model many things that were of interest in society. For instance, the “Four Color Map Conjecture,” introduced by DeMorgan in 1852, was a famous problem that was seemingly unrelated to graph theory. The conjecture stated that four is the maximum number of colors required to color any map where bordering regions are colored differently. This conjecture can easily be phrased in terms of graph theory, and many researchers used this approach during the dozen decades that the problem remained unsolved. The field of graph theory began to blossom in the twentieth century as more and more modeling possibilities were recognized — and the growth continues. It is interesting to note that as specific applications have increased in number and in scope, the theory itself has developed beautifully as well. In Chapter 1 we investigate some of the major concepts and applications of graph theory. Keep your eyes open for the K¨onigsberg Bridge Problem and the Four Color Problem, for we will encounter them along the way.
1.1 Introductory Concepts A definition is the enclosing a wilderness of idea within a wall of words. — Samuel Butler, Higgledy-Piggledy
1.1.1 Graphs and Their Relatives A graph consists of two finite sets, V and E. Each element of V is called a vertex (plural vertices). The elements of E, called edges, are unordered pairs of vertices. For instance, the set V might be {a, b, c, d, e, f, g, h}, and E might be {{a, d}, {a, e}, {b, c}, {b, e}, {b, g}, {c, f }, {d, f }, {d, g}, {g, h}}. Together, V and E are a graph G. Graphs have natural visual representations. Look at the diagram in Figure 1.2. Notice that each element of V is represented by a small circle and that each element of E is represented by a line drawn between the corresponding two elements of V .
a
b
e
f
c
g
d
h
FIGURE 1.2. A visual representation of the graph G.
1.1 Introductory Concepts
3
As a matter of fact, we can just as easily define a graph to be a diagram consisting of small circles, called vertices, and curves, called edges, where each curve connects two of the circles together. When we speak of a graph in this chapter, we will almost always refer to such a diagram. We can obtain similar structures by altering our definition in various ways. Here are some examples. 1. By replacing our set E with a set of ordered pairs of vertices, we obtain a directed graph, or digraph (Figure 1.3). Each edge of a digraph has a specific orientation.
FIGURE 1.3. A digraph.
2. If we allow repeated elements in our set of edges, technically replacing our set E with a multiset, we obtain a multigraph (Figure 1.4).
FIGURE 1.4. A multigraph.
3. By allowing edges to connect a vertex to itself (“loops”), we obtain a pseudograph (Figure 1.5).
FIGURE 1.5. A pseudograph.
4
1. Graph Theory
4. Allowing our edges to be arbitrary subsets of vertices (rather than just pairs) gives us hypergraphs (Figure 1.6).
e5
e2 e1
e3
e4
FIGURE 1.6. A hypergraph with 7 vertices and 5 edges.
5. By allowing V or E to be an infinite set, we obtain infinite graphs. Infinite graphs are studied in Chapter 3. In this chapter we will focus on finite, simple graphs: those without loops or multiple edges. Exercises 1. Ten people are seated around a circular table. Each person shakes hands with everyone at the table except the person sitting directly across the table. Draw a graph that models this situation. 2. Six fraternity brothers (Adam, Bert, Chuck, Doug, Ernie, and Filthy Frank) need to pair off as roommates for the upcoming school year. Each person has compiled a list of the people with whom he would be willing to share a room. Adam’s list: Doug Bert’s list: Adam, Ernie Chuck’s list: Doug, Ernie Doug’s list: Chuck Ernie’s list: Ernie Frank’s list: Adam, Bert Draw a digraph that models this situation. 3. There are twelve women’s basketball teams in the Atlantic Coast Conference: Boston College (B), Clemson (C), Duke (D), Florida State (F), Georgia Tech (G), Miami (I), NC State (S), Univ. of Maryland (M), Univ. of North Carolina (N), Univ. of Virginia (V), Virginia Tech (T), and Wake Forest Univ. (W). At a certain point in midseason, B has played I, T*, W C has played D*, G
1.1 Introductory Concepts
5
D has played C*, S, W F has played N*, V G has played C, M I has played B, M, T S has played D, V* M has played G, I, N N has played F*, M, W V has played F, S* T has played B*, I W has played B, D, N The asterisk(*) indicates that these teams have played each other twice. Draw a multigraph that models this situation. 4. Can you explain why no resident of K¨onigsberg was ever able to walk a route that crossed each bridge exactly once? (We will encounter this question again in Section 1.4.1.)
1.1.2 The Basics Your first discipline is your vocabulary; — Robert Frost In this section we will introduce a number of basic graph theory terms and concepts. Study them carefully and pay special attention to the examples that are provided. Our work together in the sections that follow will be enriched by a solid understanding of these ideas. The Very Basics The vertex set of a graph G is denoted by V (G), and the edge set is denoted by E(G). We may refer to these sets simply as V and E if the context makes the particular graph clear. For notational convenience, instead of representing an edge as {u, v}, we denote this simply by uv. The order of a graph G is the cardinality of its vertex set, and the size of a graph is the cardinality of its edge set. Given two vertices u and v, if uv ∈ E, then u and v are said to be adjacent. In this case, u and v are said to be the end vertices of the edge uv. If uv ∈ E, then u and v are nonadjacent. Furthermore, if an edge e has a vertex v as an end vertex, we say that v is incident with e. The neighborhood (or open neighborhood) of a vertex v, denoted by N (v), is the set of vertices adjacent to v: N (v) = {x ∈ V | vx ∈ E}.
6
1. Graph Theory
The closed neighborhood of a vertex v, denoted by N [v], is simply the set {v} ∪ N (v). Given a set S of vertices, we define the neighborhood of S, denoted by N (S), to be the union of the neighborhoods of the vertices in S. Similarly, the closed neighborhood of S, denoted N [S], is defined to be S ∪ N (S). The degree of v, denoted by deg(v), is the number of edges incident with v. In simple graphs, this is the same as the cardinality of the (open) neighborhood of v. The maximum degree of a graph G, denoted by Δ(G), is defined to be Δ(G) = max{deg(v) | v ∈ V (G)}. Similarly, the minimum degree of a graph G, denoted by δ(G), is defined to be δ(G) = min{deg(v) | v ∈ V (G)}. The degree sequence of a graph of order n is the n-term sequence (usually written in descending order) of the vertex degrees. Let’s use the graph G in Figure 1.2 to illustrate some of these concepts: G has order 8 and size 9; vertices a and e are adjacent while vertices a and b are nonadjacent; N (d) = {a, f, g}, N [d] = {a, d, f, g}; Δ(G) = 3, δ(G) = 1; and the degree sequence is 3, 3, 3, 2, 2, 2, 2, 1. The following theorem is often referred to as the First Theorem of Graph Theory. Theorem 1.1. In a graph G, the sum of the degrees of the vertices is equal to twice the number of edges. Consequently, the number of vertices with odd degree is even. Proof. Let S = v∈V deg(v). Notice that in counting S, we count each edge exactly twice. Thus, S = 2|E| (the sum of the degrees is twice the number of edges). Since S is even, it must be that the number of vertices with odd degree is even. Perambulation and Connectivity A walk in a graph is a sequence of (not necessarily distinct) vertices v1 , v2 , . . . , vk such that vi vi+1 ∈ E for i = 1, 2, . . . , k − 1. Such a walk is sometimes called a v1 –vk walk, and v1 and vk are the end vertices of the walk. If the vertices in a walk are distinct, then the walk is called a path. If the edges in a walk are distinct, then the walk is called a trail. In this way, every path is a trail, but not every trail is a path. Got it? A closed path, or cycle, is a path v1 , . . . , vk (where k ≥ 3) together with the edge vk v1 . Similarly, a trail that begins and ends at the same vertex is called a closed trail, or circuit. The length of a walk (or path, or trail, or cycle, or circuit) is its number of edges, counting repetitions. Once again, let’s illustrate these definitions with an example. In the graph of Figure 1.7, a, c, f , c, b, d is a walk of length 5. The sequence b, a, c, b, d represents a trail of length 4, and the sequence d, g, b, a, c, f , e represents a path of length 6.
1.1 Introductory Concepts
7
a b
c d f
e g
FIGURE 1.7.
Also, g, d, b, c, a, b, g is a circuit, while e, d, b, a, c, f , e is a cycle. In general, it is possible for a walk, trail, or path to have length 0, but the least possible length of a circuit or cycle is 3. The following theorem is often referred to as the Second Theorem in this book. Theorem 1.2. In a graph G with vertices u and v, every u–v walk contains a u–v path. Proof. Let W be a u–v walk in G. We prove this theorem by induction on the length of W . If W is of length 1 or 2, then it is easy to see that W must be a path. For the induction hypothesis, suppose the result is true for all walks of length less than k, and suppose W has length k. Say that W is u = w0 , w1 , w2 , . . . , wk−1 , wk = v where the vertices are not necessarily distinct. If the vertices are in fact distinct, then W itself is the desired u–v path. If not, then let j be the smallest integer such that wj = wr for some r > j. Let W1 be the walk u = w0 , . . . , wj , wr+1 , . . . , wk = v. This walk has length strictly less than k, and therefore the induction hypothesis implies that W1 contains a u–v path. This means that W contains a u–v path, and the proof is complete. We now introduce two different operations on graphs: vertex deletion and edge deletion. Given a graph G and a vertex v ∈ V (G), we let G − v denote the graph obtained by removing v and all edges incident with v from G. If S is a set of vertices, we let G − S denote the graph obtained by removing each vertex of S and all associated incident edges. If e is an edge of G, then G − e is the graph obtained by removing only the edge e (its end vertices stay). If T is a set of edges, then G − T is the graph obtained by deleting each edge of T from G. Figure 1.8 gives examples of these operations. A graph is connected if every pair of vertices can be joined by a path. Informally, if one can pick up an entire graph by grabbing just one vertex, then the
8
1. Graph Theory
a
G
G-d
G - cd
G - { f, g}
G - { eg, fg}
c
b d e
f g FIGURE 1.8. Deletion operations.
G1
G2
G3
FIGURE 1.9. Connected and disconnected graphs.
graph is connected. In Figure 1.9, G1 is connected, and both G2 and G3 are not connected (or disconnected). Each maximal connected piece of a graph is called a connected component. In Figure 1.9, G1 has one component, G2 has three components, and G3 has two components. If the deletion of a vertex v from G causes the number of components to increase, then v is called a cut vertex. In the graph G of Figure 1.8, vertex d is a cut vertex and vertex c is not. Similarly, an edge e in G is said to be a bridge if the graph G − e has more components than G. In Figure 1.8, the edge ab is the only bridge. A proper subset S of vertices of a graph G is called a vertex cut set (or simply, a cut set) if the graph G − S is disconnected. A graph is said to be complete if every vertex is adjacent to every other vertex. Consequently, if a graph contains at least one nonadjacent pair of vertices, then that graph is not complete. Complete graphs do not have any cut sets, since G − S is connected for all proper subsets S of the vertex set. Every non-complete graph has a cut set, though, and this leads us to another definition. For a graph G which is not complete, the connectivity of G, denoted κ(G), is the minimum size of a cut set of G. If G is a connected, non-complete graph of order n, then 1 ≤ κ(G) ≤ n − 2. If G is disconnected, then κ(G) = 0. If G is complete of order n, then we say that κ(G) = n − 1.
1.1 Introductory Concepts
9
Further, for a positive integer k, we say that a graph is k-connected if k ≤ κ(G). You will note here that “1-connected” simply means “connected.” Here are several facts that follow from these definitions. You will get to prove a couple of them in the exercises. i. A graph is connected if and only if κ(G) ≥ 1. ii. κ(G) ≥ 2 if and only if G is connected and has no cut vertices. iii. Every 2-connected graph contains at least one cycle. iv. For every graph G, κ(G) ≤ δ(G). Exercises 1. If G is a graph of order n, what is the maximum number of edges in G? 2. Prove that for any graph G of order at least 2, the degree sequence has at least one pair of repeated entries. 3. Consider the graph shown in Figure 1.10. a b
e
d
c FIGURE 1.10.
(a) How many different paths have c as an end vertex? (b) How many different paths avoid vertex c altogether? (c) What is the maximum length of a circuit in this graph? Give an example of such a circuit. (d) What is the maximum length of a circuit that does not include vertex c? Give an example of such a circuit. 4. Is it true that a finite graph having exactly two vertices of odd degree must contain a path from one to the other? Give a proof or a counterexample. 5. Let G be a graph where δ(G) ≥ k. (a) Prove that G has a path of length at least k. (b) If k ≥ 2, prove that G has a cycle of length at least k + 1.
10
1. Graph Theory
6. Prove that every closed odd walk in a graph contains an odd cycle. 7. Draw a connected graph having at most 10 vertices that has at least one cycle of each length from 5 through 9, but has no cycles of any other length. 8. Let P1 and P2 be two paths of maximum length in a connected graph G. Prove that P1 and P2 have a common vertex. 9. Let G be a graph of order n that is not connected. What is the maximum size of G? 10. Let G be a graph of order n and size strictly less than n − 1. Prove that G is not connected. 11. Prove that an edge e is a bridge of G if and only if e lies on no cycle of G. 12. Prove or disprove each of the following statements. (a) If G has no bridges, then G has exactly one cycle. (b) If G has no cut vertices, then G has no bridges. (c) If G has no bridges, then G has no cut vertices. 13. Prove or disprove: If every vertex of a connected graph G lies on at least one cycle, then G is 2-connected. 14. Prove that every 2-connected graph contains at least one cycle. 15. Prove that for every graph G, (a) κ(G) ≤ δ(G); (b) if δ(G) ≥ n − 2, then κ(G) = δ(G). 16. Let G be a graph of order n. (a) If δ(G) ≥ (b) If δ(G) ≥
n−1 2 , n−2 2 ,
then prove that G is connected. then show that G need not be connected.
1.1.3 Special Types of Graphs until we meet again . . . — from An Irish Blessing In this section we describe several types of graphs. We will run into many of them later in the chapter. 1. Complete Graphs We introduced complete graphs in the previous section. A complete graph of order n is denoted by Kn , and there are several examples in Figure 1.11.
1.1 Introductory Concepts
K3
K5
11
K2
FIGURE 1.11. Examples of complete graphs.
2. Empty Graphs The empty graph on n vertices, denoted by En , is the graph of order n where E is the empty set (Figure 1.12).
E6
FIGURE 1.12. An empty graph.
3. Complements Given a graph G, the complement of G, denoted by G, is the graph whose vertex set is the same as that of G, and whose edge set consists of all the edges that are not present in G (Figure 1.13).
G
G
FIGURE 1.13. A graph and its complement.
4. Regular Graphs A graph G is regular if every vertex has the same degree. G is said to be regular of degree r (or r-regular) if deg(v) = r for all vertices v in G. Complete graphs of order n are regular of degree n − 1, and empty graphs are regular of degree 0. Two further examples are shown in Figure 1.14.
12
1. Graph Theory
FIGURE 1.14. Examples of regular graphs.
5. Cycles The graph Cn is simply a cycle on n vertices (Figure 1.15).
FIGURE 1.15. The graph C7 .
6. Paths The graph Pn is simply a path on n vertices (Figure 1.16).
FIGURE 1.16. The graph P6 .
7. Subgraphs A graph H is a subgraph of a graph G if V (H) ⊆ V (G) and E(H) ⊆ E(G). In this case we write H ⊆ G, and we say that G contains H. In a graph where the vertices and edges are unlabeled, we say that H ⊆ G if the vertices could be labeled in such a way that V (H) ⊆ V (G) and E(H) ⊆ E(G). In Figure 1.17, H1 and H2 are both subgraphs of G, but H3 is not. 8. Induced Subgraphs Given a graph G and a subset S of the vertex set, the subgraph of G induced by S, denoted S , is the subgraph with vertex set S and with edge set {uv | u, v ∈ S and uv ∈ E(G)}. So, S contains all vertices of S and all edges of G whose end vertices are both in S. A graph and two of its induced subgraphs are shown in Figure 1.18.
1.1 Introductory Concepts
13
H1 G H2
H3 FIGURE 1.17. H1 and H2 are subgraphs of G. b a
c g
f
b d
e
g
c
d
g
c
f
e
FIGURE 1.18. A graph and two of its induced subgraphs.
9. Bipartite Graphs A graph G is bipartite if its vertex set can be partitioned into two sets X and Y in such a way that every edge of G has one end vertex in X and the other in Y . In this case, X and Y are called the partite sets. The first two graphs in Figure 1.19 are bipartite. Since it is not possible to partition the vertices of the third graph into two such sets, the third graph is not bipartite.
X
Y
FIGURE 1.19. Two bipartite graphs and one non-bipartite graph.
A bipartite graph with partite sets X and Y is called a complete bipartite graph if its edge set is of the form E = {xy | x ∈ X, y ∈ Y } (that is, if
14
1. Graph Theory
every possible connection of a vertex of X with a vertex of Y is present in the graph). Such a graph is denoted by K|X|,|Y | . See Figure 1.20.
K2,3
K1,4
K4,4
FIGURE 1.20. A few complete bipartite graphs.
The next theorem gives an interesting characterization of bipartite graphs. Theorem 1.3. A graph with at least two vertices is bipartite if and only if it contains no odd cycles. Proof. Let G be a bipartite graph with partite sets X and Y . Let C be a cycle of G and say that C is v1 , v2 , . . . , vk , v1 . Assume without loss of generality that v1 ∈ X. The nature of bipartite graphs implies then that vi ∈ X for all odd i, and vi ∈ Y for all even i. Since vk is adjacent to v1 , it must be that k is even; and hence C is an even cycle. For the reverse direction of the theorem, let G be a graph of order at least two such that G contains no odd cycles. Without loss of generality, we can assume that G is connected, for if not, we could treat each of its connected components separately. Let v be a vertex of G, and define the set X to be X = {x ∈ V (G) | the shortest path from x to v has even length}, and let Y = V (G) \ X. Now let x and x be vertices of X, and suppose that x and x are adjacent. If x = v, then the shortest path from v to x has length one. But this implies that x ∈ Y , a contradiction. So, it must be that x = v, and by a similar argument, x = v. Let P1 be a path from v to x of shortest length (a shortest v–x path) and let P2 be a shortest v–x path. Say that P1 is v = v0 , v1 , . . . , v2k = x and that P2 is v = w0 , w1 , . . . , w2t = x . The paths P1 and P2 certainly have v in common. Let v be a vertex on both paths such that the v –x path, call it P1 , and the v –x path, call it P2 , have only the vertex v in common. Essentially, v is the “last” vertex common to P1 and P2 . It must be that P1 and P2 are shortest v –x and v –x paths, respectively, and it must be that v = vi = wi for some i. But since x and x are adjacent, vi , vi+1 , . . . , v2k , w2t , w2t−1 , . . . , wi is a cycle of length (2k − i) + (2t − i) + 1, which is odd, and that is a contradiction. Thus, no two vertices in X are adjacent to each other, and a similar argument shows that no two vertices in Y are adjacent to each other. Therefore, G is bipartite with partite sets X and Y .
1.1 Introductory Concepts
15
We conclude this section with a discussion of what it means for two graphs to be the same. Look closely at the graphs in Figure 1.21 and convince yourself that one could be re-drawn to look just like the other. Even though these graphs
a
1
b
2
c
d
8
3
e
f
7
4
h
g
6
5
FIGURE 1.21. Are these graphs the same?
have different vertex sets and are drawn differently, it is still quite natural to think of these graphs as being the same. The idea of isomorphism formalizes this phenomenon. Graphs G and H are said to be isomorphic to one another (or simply, isomorphic) if there exists a one-to-one correspondence f : V (G) → V (H) such that for each pair x,y of vertices of G, xy ∈ E(G) if and only if f (x)f (y) ∈ E(H). In other words, G and H are isomorphic if there exists a mapping from one vertex set to another that preserves adjacencies. The mapping itself is called an isomorphism. In our example, such an isomorphism could be described as follows: {(a, 1), (b, 2), (c, 8), (d, 3), (e, 7), (f, 4), (g, 6), (h, 5)} . When two graphs G and H are isomorphic, it is not uncommon to simply say that G = H or that “G is H.” As you will see, we will make use of this convention quite often in the sections that follow. Several facts about isomorphic graphs are immediate. First, if G and H are isomorphic, then |V (G)| = |V (H)| and |E(G)| = |E(H)|. The converse of this statement is not true, though, and you can see that in the graphs of Figure 1.22. The vertex and edge counts are the same, but the two graphs are clearly not iso-
G
H
FIGURE 1.22.
16
1. Graph Theory
morphic. A second necessary fact is that if G and H are isomorphic then the degree sequences must be identical. Again, the graphs in Figure 1.22 show that the converse of this statement is not true. A third fact, and one that you will prove in Exercise 8, is that if graphs G and H are isomorphic, then their complements G and H must also be isomorphic. In general, determining whether two graphs are isomorphic is a difficult problem. While the question is simple for small graphs and for pairs where the vertex counts, edge counts, or degree sequences differ, the general problem is often tricky to solve. A common strategy, and one you might find helpful in Exercises 9 and 10, is to compare subgraphs, complements, or the degrees of adjacent pairs of vertices. Exercises 1. For n ≥ 1, prove that Kn has n(n − 1)/2 edges. 2. If Kr1 ,r2 is regular, prove that r1 = r2 . 3. Determine whether K4 is a subgraph of K4,4 . If yes, then exhibit it. If no, then explain why not. 4. Determine whether P4 is an induced subgraph of K4,4 . If yes, then exhibit it. If no, then explain why not. 5. List all of the unlabeled connected subgraphs of C34 . 6. The concept of complete bipartite graphs can be generalized to define the complete multipartite graph Kr1 ,r2 ,...,rk . This graph consists of k sets of vertices A1 , A2 , . . . , Ak , with |Ai | = ri for each i, where all possible “interset edges” are present and no “intraset edges” are present. Find expressions for the order and size of Kr1 ,r2 ,...,rk . 7. The line graph L(G) of a graph G is defined in the following way: the vertices of L(G) are the edges of G, V (L(G)) = E(G), and two vertices in L(G) are adjacent if and only if the corresponding edges in G share a vertex. (a) Let G be the graph shown in Figure 1.23. Find L(G).
FIGURE 1.23.
1.2 Distance in Graphs
17
(b) Find the complement of L(K5 ). (c) Suppose G has n vertices, labeled v1 , . . . vn , and the degree of vertex vi is ri . Let m denote the size of G, so r1 + r2 + · · · + rn = 2m. Find formulas for the order and size of L(G) in terms of n, m, and the ri . 8. Prove that if graphs G and H are isomorphic, then their complements G and H are also isomorphic. 9. Prove that the two graphs in Figure 1.24 are not isomorphic.
FIGURE 1.24.
10. Two of the graphs in Figure 1.25 are isomorphic.
P
Q
R
FIGURE 1.25.
(a) For the pair that is isomorphic, give an appropriate one-to-one correspondence. (b) Prove that the remaining graph is not isomporhic to the other two.
1.2 Distance in Graphs ‘Tis distance lends enchantment to the view . . . — Thomas Campbell, The Pleasures of Hope How far is it from one vertex to another? In this section we define distance in graphs, and we consider several properties, interpretations, and applications. Distance functions, called metrics, are used in many different areas of mathematics, and they have three defining properties. If M is a metric, then
18
1. Graph Theory
i. M (x, y) ≥ 0 for all x, y, and M (x, y) = 0 if and only if x = y; ii. M (x, y) = M (y, x) for all x, y; iii. M (x, y) ≤ M (x, z) + M (z, y) for all x, y, z. As you encounter the distance concept in the graph sense, verify for yourself that the function is in fact a metric.
1.2.1 Definitions and a Few Properties I prefer the term ‘eccentric.’ — Brenda Bates, Urban Legend Distance in graphs is defined in a natural way: in a connected graph G, the distance from vertex u to vertex v is the length (number of edges) of a shortest u–v path in G. We denote this distance by d(u, v), and in situations where clarity of context is important, we may write dG (u, v). In Figure 1.26, d(b, k) = 4 and d(c, m) = 6.
e a
b
h
k i
f
l
n
g c
d
j
m
FIGURE 1.26.
For a given vertex v of a connected graph, the eccentricity of v, denoted ecc(v), is defined to be the greatest distance from v to any other vertex. That is, ecc(v) = max {d(v, x)} . x∈V (G)
In Figure 1.26, ecc(a) = 5 since the farthest vertices from a (namely k, m, n) are at a distance of 5 from a. Of the vertices in this graph, vertices c, k, m and n have the greatest eccentricity (6), and vertices e, f and g have the smallest eccentricity (3). These values and types of vertices are given special names. In a connected graph G, the radius of G, denoted rad(G), is the value of the smallest eccentricity. Similarly, the diameter of G, denoted diam(G), is the value of the greatest eccentricity. The center of the graph G is the set of vertices, v, such that ecc(v) = rad(G). The periphery of G is the set of vertices, u, such that ecc(u) = diam(G). In Figure 1.26, the radius is 3, the diameter is 6, and the center and periphery of the graph are, respectively, {e, f, g} and {c, k, m, n}.
1.2 Distance in Graphs
19
Surely these terms sound familiar to you. On a disk, the farthest one can travel from one point to another is the disk’s diameter. Points on the rim of a disk are on the periphery. The distance from the center of the disk to any other point on the disk is at most the radius. The terms for graphs have similar meanings. Do not be misled by this similarity, however. You may have noticed that the diameter of our graph G is twice the radius of G. While this does seem to be a natural relationship, such is not the case for all graphs. Take a quick look at a cycle or a complete graph. For either of these graphs, the radius and diameter are equal! The following theorem describes the proper relationship between the radii and diameters of graphs. While not as natural, tight, or “circle-like” as you might hope, this relationship does have the advantage of being correct. Theorem 1.4. For any connected graph G, rad(G) ≤ diam(G) ≤ 2 rad(G). Proof. By definition, rad(G) ≤ diam(G), so we just need to prove the second inequality. Let u and v be vertices in G such that d(u, v) = diam(G). Further, let c be a vertex in the center of G. Then, diam(G) = d(u, v) ≤ d(u, c) + d(c, v) ≤ 2 ecc(c) = 2 rad(G). The definitions in this section can also be extended to graphs that are not connected. In the context of a single connected component of a disconnected graph, these terms have their normal meanings. If two vertices are in different components, however, we say that the distance between them is infinity. We conclude this section with two interesting results. Choose your favorite graph. It can be large or small, dense with edges or sparse. Choose anything you like, as long as it is your favorite. Now, wouldn’t it be neat if there existed a graph in which your favorite graph was the “center” of attention? The next theorem (credited to Hedetneimi in [44]) makes your wish come true. Theorem 1.5. Every graph is (isomorphic to) the center of some graph. Proof. Let G be a graph (your favorite!). We now construct a new graph H (see Figure 1.27) by adding four vertices (w, x, y, z) to G, along with the following edges: {wx, yz} ∪ {xa | a ∈ V (G)} ∪ {yb | b ∈ V (G)}. Now, ecc(w) = ecc(z) = 4, ecc(y) = ecc(x) = 3, and for any vertex v ∈ V (G), w
x
G
y
FIGURE 1.27. G is the center.
ecc(v) = 2. Therefore, G is the center of H.
z
20
1. Graph Theory
Suppose you don’t like being the center of attention. Maybe you would rather your favorite graph avoid the spotlight and stay on the periphery. The next theorem (due to Bielak and Sysło, [25]) tells us when that can happen. Theorem 1.6. A graph G is (isomorphic to) the periphery of some graph if and only if either every vertex has eccentricity 1, or no vertex has eccentricity 1. Proof. Suppose that every vertex of G has eccentricity 1. Not only does this mean that G is complete, it also means that every vertex of G is in the periphery. G is the periphery of itself! On the other hand, suppose that no vertex of G has eccentricity 1. This means that for every vertex u of G, there is some vertex v of G such that uv ∈ E(G). Now, let H be a new graph, constructed by adding a single vertex, w, to G, together with the edges {wx | x ∈ V (G)}. In the graph H, the eccentricity of w is 1 (w is adjacent to everything). Further, for any vertex x ∈ V (G), the eccentricity of x in H is 2 (no vertex of G is adjacent to everything else in G, and everything in G is adjacent to w). Thus, the periphery of H is precisely the vertices of G. For the reverse direction, let us suppose that G has some vertices of eccentricity 1 and some vertices of eccentricity greater than 1. Suppose also (in anticipation of a contradiction) that G forms the periphery of some graph, say H. Since the eccentricities of the vertices in G are not all the same, it must be that V (G) is a proper subset of V (H). This means that H is not the periphery of itself and that diam(H) ≥ 2. Now, let v be a vertex of G whose eccentricity in G is 1 (v is therefore adjacent to all vertices of G). Since v ∈ V (G) and since G is the periphery of H, there exists a vertex w in H such that d(v, w) = diam(H) ≥ 2. The vertex w, then, is also a peripheral vertex (see Exercise 4) and therefore must be in G. This contradicts the fact that v is adjacent to everything in G. Exercises 1. Find the radius, diameter and center of the graph shown in Figure 1.28.
FIGURE 1.28.
2. Find the radius and diameter of each of the following graphs: P2k , P2k+1 , C2k , C2k+1 , Kn , Km,n . 3. For each graph in Exercise 2, find the number of vertices in the center. 4. If x is in the periphery of G and d(x, y) = ecc(x), then prove that y is in the periphery of G.
1.2 Distance in Graphs
21
5. If u and v are adjacent vertices in a graph, prove that their eccentricities differ by at most one. 6. A graph G is called self-centered if C(G) = V (G). Prove that every complete bipartite graph, every cycle, and every complete graph is self-centered. 7. Given a connected graph G and a positive integer k, the kth power of G, denoted Gk , is the graph with V (Gk ) = V (G) and where vertices u and v are adjacent in Gk if and only if dG (u, v) ≤ k. (a) Draw the 2nd and 3rd powers of P8 and C10 . (b) For a graph G of order n, what is Gdiam(G) ? 8.
(a) Find a graph of order 7 that has radius 3 and diameter 6. (b) Find a graph of order 7 that has radius 3 and diameter 5. (c) Find a graph of order 7 that has radius 3 and diameter 4. (d) Suppose r and d are positive integers and r ≤ d ≤ 2r. Describe a graph that has radius r and diameter d.
9. Suppose that u and v are vertices in a graph G, ecc(u) = m, ecc(v) = n, and m < n. Prove that d(u, v) ≥ n − m. Then draw a graph G1 where d(u, v) = n − m, and another graph G2 where d(u, v) > n − m. In each case, label the vertices u and v, and give the values of m and n. 10. Let G be a connected graph with at least one cycle. Prove that G has at least one cycle whose length is less than or equal to 2 diam(G) + 1. 11.
(a) Prove that if G is connected and diam(G) ≥ 3, then G is connected. (b) Prove that if diam(G) ≥ 3, then diam(G) ≤ 3. (c) Prove that if G is regular and diam(G) = 3, then diam(G) = 2.
1.2.2 Graphs and Matrices Unfortunately no one can be told what the Matrix is. You have to see it for yourself. — Morpheus, The Matrix What do matrices have to do with graphs? This is a natural question — nothing we have seen so far has suggested any possible relationship between these two types of mathematical objects. That is about to change! As we have seen, a graph is a very visual object. To this point, we have determined distances by looking at the diagram, pointing with our fingers, and counting edges. This sort of analysis works fairly well for small graphs, but it quickly breaks down as the graphs of interest get larger. Analysis of large graphs often requires computer assistance.
22
1. Graph Theory
Computers cannot just look and point at graphs like we can. Instead, they understand graphs via matrix representations. One such representation is an adjacency matrix. Let G be a graph with vertices v1 , v2 , . . . , vn . The adjacency matrix of G is the n × n matrix A whose (i, j) entry, denoted by [A]i,j , is defined by [A]i,j =
1 0
if vi and vj are adjacent, otherwise.
The graph in Figure 1.29 has six vertices. Its adjacency matrix, A, is ⎤ ⎡ 0 0 0 1 1 0 ⎢ 0 0 1 0 0 0 ⎥ ⎥ ⎢ ⎢ 0 1 0 0 0 1 ⎥ ⎥ A=⎢ ⎢ 1 0 0 0 1 1 ⎥. ⎥ ⎢ ⎣ 1 0 0 1 0 1 ⎦ 0 0 1 1 1 0
v1 v2 v6
v3
v5
v4 FIGURE 1.29.
Note that for simple graphs (where there are no loops) adjacency matrices have all zeros on the main diagonal. You can also see from the definition that these matrices are symmetric.1 A single graph can have multiple adjacency matrices — different orderings of the vertices will produce different matrices. If you think that these matrices ought to be related in some way, then you are correct! In fact, if A and B are two different adjacency matrices of the same graph G, then there must exist a permutation of the vertices such that when the permuation is applied to the corresponding rows and columns of A, you get B. This fact can be used in reverse to determine if two graphs are isomorphic, and the permutation mentioned here serves as an appropriate bijection: Given two graphs G1 and G2 with respective adjacency matrices A1 and A2 , if one can apply 1 Can you think of a context in which adjacency matrices might not be symmetric? Direct your attention to Figure 1.3 for a hint.
1.2 Distance in Graphs
23
a permutation to the rows and columns of A1 and produce A2 , then G1 and G2 are isomorphic. Let’s take a closer look at the previous example. The fact that the (1, 6) entry is 0 indicates that v1 and v6 are not adjacent. Consider now the (1, 6) entry of the matrix A2 . This entry is just the dot product of row one of A with column six of A: [A2 ]1,6 = (0, 0, 0, 1, 1, 0) · (0, 0, 1, 1, 1, 0) = (0 · 0) + (0 · 0) + (0 · 1) + (1 · 1) + (1 · 1) + (0 · 0) = 2. Think about what makes this dot product nonzero. It is the fact that there was at least one place (and here there were two places) where a 1 in row one corresponded with a 1 in column six. In our case, the 1 in the fourth position of row one (representing the edge v1 v4 ) matched up with the 1 in the fourth position of column six (representing the edge v4 v6 ). The same thing occurred in the fifth position of the row and column (where the edges represented were v1 v5 and v5 v6 ). Can you see what is happening here? The entry in position (1, 6) of A2 is equal to the number of two-edge walks from v1 to v6 in G. As the next theorem shows us, this is not a coincidence. Theorem 1.7. Let G be a graph with vertices labeled v1 , v2 , . . . , vn , and let A be its corresponding adjacency matrix. For any positive integer k, the (i, j) entry of Ak is equal to the number of walks from vi to vj that use exactly k edges. Proof. We prove this by induction on k. For k = 1, the result is true since [A]i,j = 1 exactly when there is a one-edge walk between vi and vj . Now suppose that for every i and j, the (i, j) entry of Ak−1 is the number of walks from vi to vj that use exactly k − 1 edges. For each k-edge walk from vi to vj , there exists an h such that the walk can be thought of as a (k − 1)-edge walk from vi to vh , combined with an edge from vh to vj . The total number of these k-edge walks, then, is
(number of (k − 1)-edge walks from vi to vh ). vh ∈N (vj )
By the induction hypothesis, we can rewrite this sum as
[Ak−1 ]i,h =
vh ∈N (vj )
n
[Ak−1 ]i,h [A]h,j = [Ak ]i,j ,
h=1
and this proves the result. This theorem has a straightforward corollary regarding distance between vertices. Corollary 1.8. Let G be a graph with vertices labeled v1 , v2 , . . . , vn , and let A be its corresponding adjacency matrix. If d(vi , vj ) = x, then [Ak ]i,j = 0 for 1 ≤ k < x.
24
1. Graph Theory
Let’s see if we can relate these matrices back to earlier distance concepts. Given a graph G of order n with adjacency matrix A, and given a positive integer k, define the matrix sum Sk to be Sk = I + A + A2 + · · · + Ak , where I is the n × n identity matrix. Since the entries of I and A are ones and zeros, the entries of Sk (for any k) are nonnegative integers. This implies that for every pair i, j, we have [Sk ]i,j ≤ [Sk+1 ]i,j . Theorem 1.9. Let G be a connected graph with vertices labeled v1 , v2 , . . . , vn , and let A be its corresponding adjacency matrix. 1. If k is the smallest positive integer such that row j of Sk contains no zeros, then ecc(vj ) = k. 2. If r is the smallest positive integer such that all entries of at least one row of Sr are positive, then rad(G) = r. 3. If m is the smallest positive integer such that all entries of Sm are positive, then diam(G) = m. Proof. We will prove the first part of the theorem. The proofs of the other parts are left for you as exercises.2 Suppose that k is the smallest positive integer such that row j of Sk contains no zeros. The fact that there are no zeros on row j of Sk implies that the distance from vj to any other vertex is at most k. If k = 1, the result follows immediately. For k > 1, the fact that there is at least one zero on row j of Sk−1 indicates that there is at least one vertex whose distance from vj is greater than k − 1. This implies that ecc(vj ) = k. We can use adjacency matrices to create other types of graph-related matrices. The steps given below describe the construction of a new matrix, using the matrix sums Sk defined earlier. Carefully read through the process, and (before you read the paragraph that follows!) see if you can recognize the matrix that is produced. Creating a New Matrix, M Given: A connected graph of order n, with adjacency matrix A, and with Sk as defined earlier. 1. For each i ∈ {1, 2, . . . , n}, let [M ]i,i = 0. 2. For each pair i, j where i = j, let [M ]i,j = k where k is the least positive integer such that [Sk ]i,j = 0. 2 You’re
welcome.
1.2 Distance in Graphs
25
Can you see what the entries of M will be? For each pair i, j, the (i, j) entry of M is the distance from vi to vj . That is, [M ]i,j = d(vi , vj ). The matrix M is called the distance matrix of the graph G. Exercises 1. Give the adjacency matrix for each of the following graphs. (a) P2k and P2k+1 , where the vertices are labeled from one end of the path to the other. (b) C2k and C2k+1 , where the vertices are labeled consecutively around the cycle. (c) Km,n , where the vertices in the first partite set are labeled v1 , . . . , vm . (d) Kn , where the vertices are labeled any way you please. 2. Without computing the matrix directly, find A3 where A is the adjacency matrix of K4 . 3. If A is the adjacency matrix for the graph G, show that the (j, j) entry of A2 is the degree of vj . 4. Let A be the adjacency matrix for the graph G. (a) Show that the number of triangles that contain vj is 12 [A3 ]j,j . (b) The trace of a square matrix M , denoted Tr(M ), is the sum of the entries on the main diagonal. Prove that the number of triangles in G is 16 Tr(A3 ). 5. Find the (1, 5) entry of A2009 where A is the adjacency matrix of C10 and where the vertices of C10 are labeled consecutively around the cycle. 6.
(a) Prove the second statement in Theorem 1.9. (b) Prove the third statement in Theorem 1.9.
7. Use Theorem 1.9 to design an algorithm for determining the center of a graph G. 8. The graph G has adjacency matrix A and distance matrix D. Prove that if A = D, then G is complete. 9. Give the distance matrices for the graphs in Exercise 1. You should create these matrices directly — it is not necessary to use the method described in the section.
26
1. Graph Theory
1.2.3 Graph Models and Distance Do I know you? — Kevin Bacon, in Flatliners We have already seen that graphs can serve as models for all sorts of situations. In this section we will discuss several models in which the idea of distance is significant. The Acquaintance Graph “Wow, what a small world!” This familiar expression often follows the discovery of a shared acquaintance between two people. Such discoveries are enjoyable, for sure, but perhaps the frequency with which they occur ought to keep us from being as surprised as we typically are when we experience them. We can get a better feel for this phenomenon by using a graph as a model. Define the Acquaintance Graph, A, to be the graph where each vertex represents a person, and an edge connects two vertices if the corresponding people know each other. The context here is flexible — one could create this graph for the people living in a certain neighborhood, or the people working in a certain office building, or the people populating a country or the planet. Since the smaller graphs are all subgraphs of the graphs for larger populations, most people think of A in the largest sense: The vertices represent the Earth’s human population.3 An interesting question is whether or not the graph A, in the large (Earth) sense, is connected. Might there be a person or a group of people with no connection (direct or indirect) at all to another group of people?4 While there is a possibility of this being the case, it is most certainly true that if A is in fact disconnected, there is one very large connected component. The graph A can be illuminating with regard to the “six degrees of separation” phenomenon. Made popular (at least in part) by a 1967 experiment by social psychologist Stanley Milgram [204] and a 1990 play by John Guare [142], the “six degrees theory” asserts that given any pair of people, there is a chain of no more than six acquaintance connections joining them. Translating into graph theorese, the assertion is that diam(A) ≤ 6. It is, of course, difficult (if not impossible) to confirm this. For one, A is enormous, and the kind of computation required for confirmation is nontrivial (to say the least!) for matrices with six billion rows. Further, the matrix A is not static — vertices and edges appear all of the time.5 Still, the graph model gives us a good way to visualize this intriguing phenomenon. Milgram’s experiment [204] was an interesting one. He randomly selected several hundred people from certain communities in the United States and sent a 3 The
graph could be made even larger by allowing the vertices to represent all people, living or dead. We will stick with the living people only — six billion vertices is large enough, don’t you think? 4 Wouldn’t it be interesting to meet such a person? Wait — it wouldn’t be interesting for long because as soon as you meet him, he is no longer disconnected! 5 Vertices will disappear if you limit A to living people. Edges disappear when amnesia strikes.
1.2 Distance in Graphs
27
packet to each. Inside each packet was the name and address of a single “target” person. If the recipient knew this target personally, the recipient was to mail the packet directly to him. If the recipient did not know the target personally, the recipient was to send the packet to the person he/she thought had the best chance of knowing the target personally (perhaps someone in the same state as the target, or something like that). The new recipient was to follow the same rules: Either send it directly to the target (if known personally) or send it to someone who has a good chance of knowing the target. Milgram tracked how many steps it took for the packets to reach the target. Of the packets that eventually returned, the median number of steps was 5! Wow, what a small world! The Hollywood Graph Is the actor Kevin Bacon the center of Hollywood? This question, first asked by a group of college students in 1993, was the beginning of what was soon to become a national craze: The Kevin Bacon Game. The object of the game is to connect actors to Bacon through appearances in movies. For example, the actress Emma Thompson can be linked to Bacon in two steps: Thompson costarred with Gary Oldman in Harry Potter and the Prisoner of Azkaban (among others), and Oldman appeared with Bacon in JFK. Since Thompson has not appeared with Bacon in a movie, two steps is the best we can do. We say that Thompson has a Bacon number of 2. Can you sense the underlying graph here?6 Let us define the Hollywood Graph, H, as follows: The vertices of H represent actors, and an edge exists between two vertices when the corresponding actors have appeared in a movie together. So, in H, Oldman is adjacent to both Bacon and Thompson, but Bacon and Thompson are not adjacent. Thompson has a Bacon number of 2 because the distance from her vertex to Bacon’s is 2. In general, an actor’s Bacon number is defined to be the distance from that actor’s vertex to Bacon’s vertex in H. If an actor cannot be linked to Bacon at all, then that actor’s Bacon number is infinity. As was the case with the Acquaintance Graph, if H is disconnected we can focus our attention on the single connected component that makes up most of H (Bacon’s component). The ease with which Kevin Bacon can be connected to other actors might lead one to conjecture that Bacon is the unique center of Hollywood. In terms of graph theory, that conjecture would be that the center of H consists only of Bacon’s vertex. Is this true? Is Bacon’s vertex even in the center at all? Like the Acquaintance Graph, the nature of H changes frequently, and answers to questions like these are elusive. The best we can do is to look at a snapshot of the graph and answer the questions based on that particular point in time. Let’s take a look at the graph as it appeared on December 25, 2007. On that day, the Internet Movie Database [165] had records for nearly 1.3 million actors. Patrick Reynolds maintains a website [234] that tracks Bacon numbers, among other things. According to Reynolds, of the 1.3 million actors in the database on 6 or,
“Can you smell the Bacon?”
28
1. Graph Theory
that day, 917,007 could be linked to Bacon in some way via chains of shared movie appearances. The maximum distance from Bacon to any of the actors in his component was 8 (and so Bacon’s eccentricity is 8). What about eccentricities of other actors? Are there any that are less than 8? According to Reynolds, the answer is no — 8 is the smallest eccentricity, and so Kevin Bacon is in the center of H. But it is very crowded there — thousands and thousands of other actors have eccentricity 8 as well. The Mathematical Collaboration Graph The Hungarian Paul Erd˝os (1913–1996) was one of the greatest and most prolific mathematicians of the twentieth century. Erd˝os authored or coauthored over 1500 mathematical papers covering topics in graph theory, combinatorics, set theory, geometry, number theory, and more. He collaborated with hundreds of other mathematicians, and this collaboration forms the basis of a Bacon-like ranking system. While not as widely popular as Bacon numbers, almost all mathematicians are familiar with the concept of Erd˝os numbers. Erd˝os himself is assigned Erd˝os number 0. Any mathematician who coauthored a paper with Erd˝os has Erd˝os number 1. If a person has coauthored a paper with someone who has an Erd˝os number of 1 (and if that person himself/herself doesn’t have Erd˝os number 1), then that person has an Erd˝os number of 2. Higher Erd˝os numbers are assigned in a similar manner. The underlying graph here should be clear. Define the Mathematical Collaboration Graph, C, to have vertices corresponding to researchers, and let an edge join two researchers if the two have coauthored a paper together. A researcher’s Erd˝os number, then, is the distance from the corresponding vertex to the vertex of Erd˝os. If a researcher is not in the same connected component of C as Erd˝os, then that researcher has an infinite Erd˝os number. As you might imagine, new vertices and edges are frequently added to C. Jerry Grossman maintains a website [140] that keeps track of Erd˝os numbers. At one point in 2007, there were over 500 researchers with Erd˝os number 1 and over 8100 with Erd˝os number 2. You might surmise that because Erd˝os died in 1996, the number of people with Erd˝os number 1 has stopped increasing. While this is surely to be true sometime in the near future, it hasn’t happened yet. A number of papers coauthored by Erd˝os have been published since his death. Erd˝os has not been communicating with collaborators from the great beyond (at least as far as we know) — it is simply the case that his collaborators continue to publish joint research that began years ago. Small World Networks As we saw earlier, the Acquaintance Graph provides a way to model the famous “small world phemomenon” — the sense that humans are connected via numerous recognized and unrecognized connections. The immense size and dynamic nature of that graph make it difficult to analyze carefully and completely, and so smaller models can prove to be more useful. In order for the more manageable graphs to
1.2 Distance in Graphs
29
be helpful, though, it is important that they enjoy some fundamental small world properties. So what makes a small world small? What properties should a graph have if it is to be a model of a small world? Let’s list a few. As you read through the list below, think about your own acquaintance network and see if these properties make sense to you. 1. There should be plenty of mutual acquaintances (shared neighbors). If this were the only property, then complete graphs would surely fit the bill — lots of mutual neighbors there. A complete graph, though, is not a realistic model of acquaintances in the world. 2. The graph should be sparse in edges. In a realistic model, there should be relatively few edges compared to the number of vertices in the graph. 3. Distances between pairs of vertices should be relatively small. The characteristic path length of a graph G, denoted LG , is the average distance between vertices, where the average is taken over all pairs of distinct vertices. In any graph of order n, there are |E(Kn )| distinct pairs of vertices, and in Exercise 1 of Section 1.1.3, you showed that |E(Kn )| = n(n−1)/2. So for a graph G of order n,
2 u,v∈V (G) d(u, v) LG = = d(u, v). |E(Kn )| n(n − 1) u,v∈V (G)
One way of obtaining this value for a graph is to find the mean of the nondiagonal entries in the distance matrix of the graph. 4. There should be a reasonable amount of clustering in a small world graph. In actual acquaintance networks, there are a number of factors (geography, for instance) that create little clusters of vertices — small groups of vertices among which a larger than typical portion of edges exists. For example, there are likely to be many edges among the vertices that represent the people that live in your neighborhood. Given a vertex v in a graph of order n, we define its clustering coefficient, denoted cc(v), as follows (recall that N [v] is the subgraph induced by the closed neighborhood of v). |E (N [v] )| 2 |E (N [v] )|
= cc(v) = . (1 + deg(v)) deg(v) E K1+deg(v) For each vertex v, this is the percentage of edges that exist among the vertices in the closed neighborhood of v. For a graph G of order n, we define the clustering coefficient of the graph G, denoted by CC(G) to be the average of the clustering coefficients of the vertices of G. That is, 1
CC(G) = cc(v). n v∈V (G)
30
1. Graph Theory
Small world networks have the property that characteristic path lengths are low and clustering coefficients are high. Graphs that have these properties can be used as models in the mathematical analyses of the small world phenomenon and its associated concepts. It is interesting to note that other well known networks have exhibited small world traits — the internet, electric power grids, and even neural networks are examples — and this increases even further the applicability of graph models. Exercises 1. Compute the characteristic path length for each of each of the following graphs: P2k , P2k+1 , C2k , C2k+1 , Kn , Km,n . 2. Compute the clustering coefficient for each of each of the following graphs: P2k , P2k+1 , C2k , C2k+1 , Kn , Km,n . 3.
(a) In the Acquaintance Graph, try to find a path from your vertex to the vertex of the President of the United States. (b) Your path from the previous question may not be your shortest such path. Prove that your actual distance from the President is at most one away from the shortest such distance to be found among your classmates.
Interesting Note: There are several contexts in which Bacon numbers can be calculuated. While Bacon purists only use movie connections, others include shared appearances on television and in documentaries as well. Under these more open guidelines, the mathematician Paul Erd˝os actually has a Bacon number of 3! Erd˝os was the focus of the 1993 documentary N is a Number [63]. British actor Alec Guinness made a (very) brief appearance near the beginning of that film, and Guinness has a Bacon number of 2 (can you find the connections?). As far as we know, Bacon has not coauthored a research article with anyone who is connected to Erd˝os, and so while Erd˝os’ Bacon number is 3, Bacon’s Erd˝os number is infinity.
1.3 Trees “O look at the trees!” they cried, “O look at the trees!” — Robert Bridges, London Snow In this section we will look at the trees—but not the ones that sway in the wind or catch the falling snow. We will talk about graph-theoretic trees. Before moving on, glance ahead at Figure 1.30, and try to pick out which graphs are trees.
1.3 Trees
31
1.3.1 Definitions and Examples Example, the surest method of instruction. — Pliny the Younger In Figure 1.30 graphs A, B, and E are trees, while graphs C and D are not. A
B
D
C
E
FIGURE 1.30. Which ones are trees?
A tree is a connected graph that contains no cycles. Graph-theoretic trees resemble the trees we see outside our windows. For example, graph-theoretic trees do not have cycles, just as the branches of trees in nature do not split and rejoin. The descriptive terminology does not stop here. Graph D in Figure 1.30 is not a tree; rather, it is a forest. A forest is a collection of one or more trees. A vertex of degree 1 in a tree is called a leaf. As in nature, graph-theoretic trees come in many shapes and sizes. They can be thin (P10 ) or thick (K1,1000 ), tall (P1000 ) or short (K1 and K2 ). Yes, even the graphs K1 and K2 are considered trees (they are certainly connected and acyclic). In the spirit of our arboreal terminology, perhaps we should call K1 a stump and K2 a twig! While we are on the subject of small trees, we should count a few of them. It is clear that K1 and K2 are the only trees of order 1 and 2, respectively. A moment’s thought will reveal that P3 is the only tree of order 3. Figure 1.31 shows the different trees of order 6 or less. Trees sprout up as effective models in a wide variety of applications. We mention a few brief examples. Examples 1. Trees are useful for modeling the possible outcomes of an experiment. For example, consider an experiment in which a coin is flipped and a 6-sided die is rolled. The leaves in the tree in Figure 1.32 correspond to the outcomes in the probability space for this experiment.
32
1. Graph Theory
1
2
3
4
5
6
FIGURE 1.31. Trees of order 6 or less.
heads
1
2
3
4
5
tails
6
1
2
3
4
5
6
FIGURE 1.32. Outcomes of a coin/die experiment.
2. Programmers often use tree structures to facilitate searches and sorts and to model the logic of algorithms. For instance, the logic for a program that finds the maximum of four numbers (w, x, y, z) can be represented by the tree shown in Figure 1.33. This type of tree is a binary decision tree. 3. Chemists can use trees to represent, among other things, saturated hydrocarbons—chemical compounds of the form Cn H2n+2 (propane, for example). The bonds between the carbon and hydrogen atoms are depicted in the trees of Figure 1.34. The vertices of degree 4 are the carbon atoms, and the leaves represent the hydrogen atoms. 4. College basketball fans will recognize the tree in Figure 1.35. It displays final results for the “Sweet 16” portion of the 2008 NCAA men’s basketball tournament. Each vertex represents a single game.
1.3 Trees
w
Y w
N
y?
x
Y
N
z?
w
x?
Y
N
y Y
y?
Y z? N
x Y
33
N
z?
y
N
z?
Y
N
w is a z is a y is a z is a x is a z is a y is a z is a max. max. max. max. max. max. max. max. FIGURE 1.33. Logic of a program.
ethane
propane
pentane
FIGURE 1.34. A few saturated hydrocarbons. UNC
Memphis
Wash. St.
UNC
Louisville
Louisville UNC
Tennessee Kansas
Kansas
Memphis Kansas
Memphis
Mich. St.
Texas
Stanford
Memphis
Texas UCLA
UCLA
Villanova
Kansas
UCLA
Wisconsin
Davidson
Xavier
W. Kentucky Xavier W. Virginia
Davidson
FIGURE 1.35. The 2008 Men’s Sweet 16.
Exercises 1. Draw all unlabeled trees of order 7. Hint: There are a prime number of them. 2. Draw all unlabeled forests of order 6. 3. Let T be a tree of order n ≥ 2. Prove that T is bipartite.
34
1. Graph Theory
4. Graphs of the form K1,n are called stars. Prove that if Kr,s is a tree, then it must be a star. 5. Match the graphs in Figure 1.36 with appropriate names: a palm tree, autumn, a path through a forest, tea leaves. A
B
D C
FIGURE 1.36. What would you name these graphs?
1.3.2 Properties of Trees And the tree was happy. — Shel Silverstein, The Giving Tree Let us try an experiment. On a piece of scratch paper, draw a tree of order 16. Got one? Now count the number of edges in the tree. We are going to go out on a limb here and predict that there are 15. Since there are nearly 20,000 different trees of order 16, it may seem surprising that our prediction was correct. The next theorem gives away our secret. Theorem 1.10. If T is a tree of order n, then T has n − 1 edges. Proof. We induct on the order of T . For n = 1 the only tree is the stump (K1 ), and it of course has 0 edges. Assume that the result is true for all trees of order less than k, and let T be a tree of order k. Choose some edge of T and call it e. Since T is a tree, it must be that T − e is disconnected (see Exercise 7) with two connected components that are trees themselves (see Figure 1.37). Say that these two components of T − e are T1 and T2 , with orders k1 and k2 , respectively. Thus, k1 and k2 are less than n and k1 + k2 = k. Since k1 < k, the theorem is true for T1 . Thus T1 has k1 − 1 edges. Similarly, T2 has k2 − 1 edges. Now, since E(T ) is the disjoint union of E(T1 ), E(T2 ), and {e}, we have |E(T )| = (k1 − 1) + (k2 − 1) + 1 = k1 + k2 − 1 = k − 1. This completes the induction.
1.3 Trees
T1
e
35
T2
FIGURE 1.37.
The next theorem extends the preceding result to forests. The proof is similar and appears as Exercise 4. Theorem 1.11. If F is a forest of order n containing k connected components, then F contains n − k edges. The next two theorems give alternative methods for defining trees. Two other methods are given in Exercises 5 and 6. Theorem 1.12. A graph of order n is a tree if and only if it is connected and contains n − 1 edges. Proof. The forward direction of this theorem is immediate from the definition of trees and Theorem 1.10. For the reverse direction, suppose a graph G of order n is connected and contains n − 1 edges. We need to show that G is acyclic. If G did have a cycle, we could remove an edge from the cycle and the resulting graph would still be connected. In fact, we could keep removing edges (one at a time) from existing cycles, each time maintaining connectivity. The resulting graph would be connected and acyclic and would thus be a tree. But this tree would have fewer than n − 1 edges, and this is impossible by Theorem 1.10. Therefore, G has no cycles, so G is a tree. Theorem 1.13. A graph of order n is a tree if and only if it is acyclic and contains n − 1 edges. Proof. Again the forward direction of this theorem follows from the definition of trees and from Theorem 1.10. So suppose that G is acyclic and has n − 1 edges. To show that G is a tree we need to show only that it is connected. Let us say that the connected components of G are G1 , G2 , . . . , Gk . Since G is acyclic, each of these components is a tree, and so G is a forest. Theorem 1.11 tells us that G has n − k edges, implying that k = 1. Thus G has only one connected component, implying that G is a tree. It is not uncommon to look out a window and see leafless trees. In graph theory, though, leafless trees are rare indeed. In fact, the stump (K1 ) is the only such tree, and every other tree has at least two leaves. Take note of the proof technique of the following theorem. It is a standard graph theory induction argument. Theorem 1.14. Let T be the tree of order n ≥ 2. Then T has at least two leaves. Proof. Again we induct on the order. The result is certainly true if n = 2, since T = K2 in this case. Suppose the result is true for all orders from 2 to n − 1, and consider a tree T of order n ≥ 3. We know that T has n − 1 edges, and since we can assume n ≥ 3, T has at least 2 edges. If every edge of T is incident with
36
1. Graph Theory
a leaf, then T has at least two leaves, and the proof is complete. So assume that there is some edge of T that is not incident with a leaf, and let us say that this edge is e = uv. The graph T − e is a pair of trees, T1 and T2 , each of order less than n. Let us say, without loss of generality, that u ∈ V (T1 ), v ∈ V (T2 ), |V (T1 )| = n1 , and |V (T2 )| = n2 (see Figure 1.38). Since e is not incident with any leaves of T ,
T1
T2 u
v
FIGURE 1.38.
we know that n1 and n2 are both at least 2, so the induction hypothesis applies to each of T1 and T2 . Thus, each of T1 and T2 has two leaves. This means that each of T1 and T2 has at least one leaf that is not incident with the edge e. Thus the graph (T − e) + e = T has at least two leaves. We saw in the previous section that the center of a graph is the set of vertices with minimum eccentricity. The next theorem, due to Jordan [170], shows that for trees, there are only two possibilities for the center. Theorem 1.15. In any tree, the center is either a single vertex or a pair of adjacent vertices. Proof. Given a tree T , we form a sequence of trees as follows. Let T0 = T . Let T1 be the graph obtained from T0 by deleting all of its leaves. Note here that T1 is also a tree. Let T2 be the tree obtained from T1 by deleting all of the leaves of T1 . In general, for as long as it is possible, let Tj be the tree obtained by deleting all of the leaves of Tj−1 . Since T is finite, there must be an integer r such that Tr is either K1 or K2 . Consider now a consecutive pair Ti , Ti+1 of trees from the sequence T = T0 , T1 , . . . , Tr . Let v be a non-leaf of Ti . In Ti , the vertices that are at the greatest distance from v are leaves (of Ti ). This means that the eccentricity of v in Ti+1 is one less than the eccentricity of v in Ti . Since this is true for all non-leaves of Ti , it must be that the center of Ti+1 is exactly the same as the center of Ti . Therefore, the center of Tr is the center of Tr−1 , which is the center of Tr−2 , . . . , which is the center of T0 = T . Since (the center of) Tr is either K1 or K2 , the proof is complete. We conclude this section with an interesting result about trees as subgraphs. Theorem 1.16. Let T be a tree with k edges. If G is a graph whose minimum degree satisfies δ(G) ≥ k, then G contains T as a subgraph. Alternatively, G contains every tree of order at most δ(G) + 1 as a subgraph.
1.3 Trees
37
Proof. We induct on k. If k = 0, then T = K1 , and it is clear that K1 is a subgraph of any graph. Further, if k = 1, then T = K2 , and K2 is a subgraph of any graph whose minimum degree is 1. Assume that the result is true for all trees with k − 1 edges (k ≥ 2), and consider a tree T with exactly k edges. We know from Theorem 1.14 that T contains at least two leaves. Let v be one of them, and let w be the vertex that is adjacent to v. Consider the graph T − v. Since T − v
u
w T-v FIGURE 1.39.
has k − 1 edges, the induction hypothesis applies, so T − v is a subgraph of G. We can think of T − v as actually sitting inside of G (meaning w is a vertex of G, too). Now, since G contains at least k + 1 vertices and T − v contains k vertices, there exist vertices of G that are not a part of the subgraph T − v. Further, since the degree in G of w is at least k, there must be a vertex u not in T − v that is adjacent to w (Figure 1.40). The subgraph T − v together with u forms the tree T
G u
w T-v
FIGURE 1.40. A copy of T inside G.
as a subgraph of G. Exercises 1. Draw each of the following, if you can. If you cannot, explain the reason. (a) A 10-vertex forest with exactly 12 edges (b) A 12-vertex forest with exactly 10 edges (c) A 14-vertex forest with exactly 14 edges (d) A 14-vertex forest with exactly 13 edges (e) A 14-vertex forest with exactly 12 edges 2. Suppose a tree T has an even number of edges. Show that at least one vertex must have even degree. 3. Let T be a tree with max degree Δ. Prove that T has at least Δ leaves.
38
1. Graph Theory
4. Let F be a forest of order n containing k connected components. Prove that F contains n − k edges. 5. Prove that a graph G is a tree if and only if for every pair of vertices u, v, there is exactly one path from u to v. 6. Prove that T is a tree if and only if T contains no cycles, and for any new edge e, the graph T + e has exactly one cycle. 7. Show that every edge in a tree is a bridge. 8. Show that every nonleaf in a tree is a cut vertex. 9. Find a shorter proof to Theorem 1.14. Hint: Start by considering a longest path in T . 10. Let T be a tree of order n > 1. Show that the number of leaves is
2+ (deg(vi ) − 2), deg(vi )≥3
where the sum is over all vertices of degree 3 or more. 11. For a graph G, define the average degree of G to be v∈V (G) deg(v) . avgdeg(G) = |V (G)| If T is a tree and avgdeg(T ) = a, then find an expression for the number of vertices in T in terms of a. 12. Let T be a tree such that every vertex adjacent to a leaf has degree at least 3. Prove that some pair of leaves in T has a common neighbor.
1.3.3 Spanning Trees Under the spreading chestnut tree . . . — Henry W. Longfellow, The Village Blacksmith The North Carolina Department of Transportation (NCDOT) has decided to implement a rapid rail system to serve eight cities in the western part of the state. Some of the cities are currently joined by roads or highways, and the state plans to lay the track right along these roads. Due to the mountainous terrain, some of the roads are steep and curvy; and so laying track along these roads would be difficult and expensive. The NCDOT hired a consultant to study the roads and to assign difficulty ratings to each one. The rating accounted for length, grade, and curviness of the roads; and higher ratings correspond to greater cost. The graph
1.3 Trees Jefferson
Boone Banner Elk 50
25 30
35
Blowing Rock
95
Linville
45 40
Lenoir
60 20 Marion
39
20 10
Hickory
FIGURE 1.41. The city graph.
in Figure 1.41, call it the “city graph,” shows the result of the consultant’s investigation. The number on each edge represents the difficulty rating assigned to the existing road. The state wants to be able to make each city accessible (but not necessarily directly accessible) from every other city. One obvious way to do this is to lay track along every one of the existing roads. But the state wants to minimize cost, so this solution is certainly not the best, since it would result in a large amount of unnecessary track. In fact, the best solution will not include a cycle of track anywhere, since a cycle would mean at least one segment of wasted track. The situation above motivates a definition. Given a graph G and a subgraph T , we say that T is a spanning tree of G if T is a tree that contains every vertex of G. So it looks as though the DOT just needs to find a spanning tree of the city graph, and they would like to find one whose overall rating is as small as possible. Figure 1.42 shows several attempts at a solution. Of the solutions in the figure, the one in the upper right has the least total weight—but is it the best one overall? Try to find a better one. We will come back to this problem soon. Given a graph G, a weight function is a function W that maps the edges of G to the nonnegative real numbers. The graph G together with a weight function is called a weighted graph . The graph in Figure 1.41 is a simple example of a weighted graph. Although one might encounter situations where negative valued weights would be appropriate, we will stick with nonnegative weights in our discussion. It should be fairly clear that every connected graph has at least one spanning tree. In fact, it is not uncommon for a graph to have many different spanning trees. Figure 1.42 displays three different spanning trees of the city graph. Given a connected, weighted graph G, a spanning tree T is called a minimum weight spanning tree if the sum of the weights of the edges of T is no more than the sum for any other spanning tree of G.
40
1. Graph Theory 25 50
25
35
30
50
95
45 40 60
60 20
20
10
Total Weight = 240
Total Weight = 325
25 50
60
30 95
20
10
Total Weight = 290
FIGURE 1.42. Several spanning trees.
There are a number of fairly simple algorithms for finding minimum weight spanning trees. Perhaps the best known is Kruskal’s algorithm. Kruskal’s Algorithm Given: A connected, weighted graph G. i. Find an edge of minimum weight and mark it. ii. Among all of the unmarked edges that do not form a cycle with any of the marked edges, choose an edge of minimum weight and mark it. iii. If the set of marked edges forms a spanning tree of G, then stop. If not, repeat step ii. Figure 1.43 demonstrates Kruskal’s algorithm applied to the city graph. The minimum weight is 210. It is certainly possible for different trees to result from two different applications of Kruskal’s algorithm. For instance, in the second step we could have chosen the edge between Marion and Lenoir instead of the one that was chosen. Even so, the total weight of resulting trees is the same, and each such tree is a minimum weight spanning tree.
1.3 Trees
50
35
41
25 30
95
45 40 20
60
20
50
35
25 30
95
10
45 40 20
60
20
10
50
50
35
95
25 30
60
35 95 40
25 30 45
20
50
20
35
95
45 60
40 20
25 30 45
10
20
60
TOTAL WEIGHT: 210
10
40 20
20
10
50
35
95
25 30
50
35
95
45 60
40 20 10
25 30 45
20
60
40 20
20
10
FIGURE 1.43. The stages of Kruskal’s algorithm.
It should be clear from the algorithm itself that the subgraph built is in fact a spanning tree of G. How can we be sure, though, that it has minimum total weight? The following theorem answers our question [183]. Theorem 1.17. Kruskal’s algorithm produces a spanning tree of minimum total weight. Proof. Let G be a connected, weighted graph of order n, and let T be a spanning tree obtained by applying Kruskal’s algorithm to G. As we have seen, Kruskal’s algorithm builds spanning trees by adding one edge at a time until a tree is formed. Let us say that the edges added for T were (in order) e1 , e2 , . . . , en−1 . Suppose T is not a minimum weight spanning tree. Among all minimum weight spanning trees of G, choose T to be a minimum weight spanning tree that agrees with the construction of T for the longest time (i.e., for the most initial steps). This
42
1. Graph Theory
means that there exists some k such that T contains e1 , . . . , ek , and no minimum weight spanning tree contains all of e1 , . . . , ek , ek+1 (notice that since T is not of minimum weight, k < n − 1). Since T is a spanning tree, it must be that T + ek+1 contains a cycle C, and since T contains no cycles, C must contain some edge, say e , that is not in T . If we remove the edge e from T + ek+1 , then the cycle C is broken and what remains is a spanning tree of G. Thus, T + ek+1 − e is a spanning tree of G, and it contains edges e1 , . . . , ek , ek+1 . Furthermore, since the edge e must have been available to be chosen when ek+1 was chosen by the algorithm, it must be that w(ek+1 ) ≤ w(e ). This means that T + ek+1 − e is a spanning tree with weight no more than T that contains edges e1 , . . . , ek+1 , contradicting our assumptions. Therefore, it must be that T is a minimum weight spanning tree.
Exercises 1. Prove that every connected graph contains at least one spanning tree. 2. Prove that a graph is a tree if and only if it is connected and has exactly one spanning tree. 3. Let G be a connected graph with n vertices and at least n edges. Let C be a cycle of G. Prove that if T is a spanning tree of G, then T , the complement of T , contains at least one edge of C. 4. Let G be connected, and let e be an edge of G. Prove that e is a bridge if and only if it is in every spanning tree of G. 5. Using Kruskal’s algorithm, find a minimum weight spanning tree of the graphs in Figure 1.44. In each case, determine (with proof) whether the minimum weight spanning tree is unique. 7 3
4
2
10
2
3
1
8 5
5
9
4
5
6
6
4
3
2
11 6
7 7
FIGURE 1.44. Two weighted graphs.
12
1.3 Trees
43
6. Prim’s algorithm (from [228]) provides another method for finding minimum weight spanning trees. Prim’s Algorithm Given: A connected, weighted graph G. i. Choose a vertex v, and mark it. ii. From among all edges that have one marked end vertex and one unmarked end vertex, choose an edge e of minimum weight. Mark the edge e, and also mark its unmarked end vertex. iii. If every vertex of G is marked, then the set of marked edges forms a minimum weight spanning tree. If not, repeat step ii. Use Prim’s algorithm to find minimum weight spanning trees for the graphs in Figure 1.44. As you work, compare the stages to those of Kruskal’s algorithm. 7. Give an example of a connected, weighted graph G having (i) a cycle with two identical weights, which is neither the smallest nor the largest weight in the graph, and (ii) a unique minimum weight spanning tree which contains exactly one of these two identical weights.
1.3.4 Counting Trees As for everything else, so for a mathematical theory: beauty can be perceived but not explained. — Arthur Cayley [214] In this section we discuss two beautiful results on counting the number of spanning trees in a graph. The next chapter studies general techniques for counting arrangements of objects, so these results are a sneak preview. Cayley’s Tree Formula Cayley’s Tree Formula gives us a way to count the number of different labeled trees on n vertices. In this problem we think of the vertices as being fixed, and we consider all the ways to draw a tree on those fixed vertices. Figure 1.45 shows three different labeled trees on three vertices, and in fact, these are the only three. There are 16 different labeled trees on four vertices, and they are shown in Figure 1.46. As an exercise, the ambitious student should try drawing all of the labeled trees on five vertices. The cautious ambitious student might wish to look ahead at Cayley’s formula before embarking on such a task.
44
1. Graph Theory a
a
b
c
a
b
c
b
c
FIGURE 1.45. Labeled trees on three vertices. a
b
a
b
a
b
a
b
c
d
c
d
c
d
c
d
a
b
a
b
a
b
a
b
c
d
c
d
c
d
c
d
a
b
a
b
a
b
a
b
c
d
c
d
c
d
c
d
a
b
a
b
a
b
a
b
c
d
c
d
c
d
c
d
FIGURE 1.46. Labeled trees on four vertices.
Cayley proved the following theorem in 1889 [50]. The proof technique that we will describe here is due to Pr¨ufer7 [229]. Pr¨ufer’s method is almost as noteworthy as the result itself. He counted the labeled trees by placing them in one-to-one correspondence with a set whose size is easy to determine—the set of all sequences of length n − 2 whose entries come from the set {1, . . . , n}. There are nn−2 such sequences. Theorem 1.18 (Cayley’s Tree Formula). There are nn−2 distinct labeled trees of order n. The algorithm below gives the steps that Pr¨ufer used to assign a particular sequence to a given tree, T , whose vertices are labeled 1, . . . , n. Each labeled tree is assigned a unique sequence. 7 With
a name like that he was destined for mathematical greatness!
1.3 Trees
45
Prufer’s ¨ Method for Assigning a Sequence to a Labeled Tree Given: A tree T , with vertices labeled 1, . . . , n. 1. Let i = 0, and let T0 = T . 2. Find the leaf on Ti with the smallest label and call it v. 3. Record in the sequence the label of v’s neighbor. 4. Remove v from Ti to create a new tree Ti+1 . 5. If Ti+1 = K2 , then stop. Otherwise, increment i by 1 and go back to step 2. Let us run through this algorithm with a particular graph. In Figure 1.47, tree T = T0 has 7 vertices, labeled as shown. The first step is finding the leaf with smallest label: This would be 2. The neighbor of vertex 2 is the vertex labeled 4. Therefore, 4 is the first entry in the sequence. Removing vertex 2 produces tree T1 . The leaf with smallest label in T1 is 4, and its neighbor is 3. Therefore, we put 3 in the sequence and delete 4 from T1 . Vertex 5 is the smallest leaf in tree T2 = T1 − {4}, and its neighbor is 1. So our sequence so far is 4, 3, 1. In T3 = T2 −{5} the smallest leaf is vertex 6, whose neighbor is 3. In T4 = T3 −{6}, the smallest leaf is vertex 3, whose neighbor is 1. Since T5 = K2 , we stop here. Our resulting sequence is 4, 3, 1, 3, 1. Notice that in the previous example, none of the leaves of the original tree T appears in the sequence. More generally, each vertex v appears in the sequence exactly deg(v) − 1 times. This is not a coincidence (see Exercise 1). We now present Pr¨ufer’s algorithm for assigning trees to sequences. Each sequence gets assigned a unique tree. Prufer’s ¨ Method for Assigning a Labeled Tree to a Sequence Given: A sequence σ = a1 , a2 , . . . , ak of entries from the set {1, . . . , k + 2}. 1. Draw k +2 vertices; label them v1 , v2 , . . . , vk+2 . Let S = {1, 2, . . . , k +2}. 2. Let i = 0, let σ0 = σ, and let S0 = S. 3. Let j be the smallest number in Si that does not appear in the sequence σi . 4. Place an edge between vertex vj and the vertex whose subscript appears first in the sequence σi . 5. Remove the first number in the sequence σi to create a new sequence σi+1 . Remove the element j from the set Si to create a new set Si+1 . 6. If the sequence σi+1 is empty, place an edge between the two vertices whose subscripts are in Si+1 , and stop. Otherwise, increment i by 1 and return to step 3.
46
1. Graph Theory 2
5 3
4
T = T0
1 7
6
T1
3
4
1
3
1
3
5 4, 3
1
4, 3, 1 7
6
T4
4
7
6
T3
Evolving Sequence
7
6
T2
5
3
1
4, 3, 1, 3 7
T5
1
4, 3, 1, 3, 1 7
FIGURE 1.47. Creating a Pr¨ufer sequence.
Let us apply this algorithm to a particular example. Let σ = 4, 3, 1, 3, 1 be our initial sequence to which we wish to assign a particular labeled tree. Since there are five terms in the sequence, our labels will come from the set S = {1, 2, 3, 4, 5, 6, 7}. After drawing the seven vertices, we look in the set S = S0 to find the smallest subscript that does not appear in the sequence σ = σ0 . Subscript 2 is the one, and so we place an edge between vertices v2 and v4 , the first subscript in the sequence. We now remove the first term from the sequence and the label v2 from the set, forming a new sequence σ1 = 3, 1, 3, 1 and a new set S1 = {1, 3, 4, 5, 6, 7}. The remaining steps in the process are shown in Figure 1.48.
1.3 Trees
47
v1 s = s0 = 4, 3, 1, 3, 1 S = S 0 = {1, 2, 3, 4, 5, 6, 7}
v7
v2
v6
v3 v5
v4 v1
s1 = 3, 1, 3, 1 S 1 = {1, 3, 4, 5, 6, 7}
v7
v2
v6
v3 v5
v4 v1
s2 = 1, 3, 1 S 2 = {1, 3, 5, 6, 7}
v7
v2
v6
v3 v5
v4 v1
s3 = 3, 1 S 3 = {1, 3, 6, 7}
v7
v2
v6
v3 v5
v4 v1
s4 = 1 S 4 = {1, 3, 7}
v7
v2
v6
v3 v5
v4 v1
s5 is empty S 5 = {1, 7}
v7
v2
v6
v3 v5
v4
FIGURE 1.48. Building a labeled tree.
You will notice that the tree that was created from the sequence σ in the second example is the very same tree that created the sequence σ in the first example. Score one for Pr¨ufer! Matrix Tree Theorem The second major result that we present in this section is the Matrix Tree Theorem, and like Cayley’s Theorem, it provides a way of counting spanning trees of labeled graphs. While Cayley’s Theorem in essence gives us a count on the number of spanning trees of complete labeled graphs, the Matrix Tree Theorem applies to labeled graphs in general. The theorem was proved in 1847 by Kirchhoff [175], and it demonstrates a wonderful connection between spanning trees and matrices.
48
1. Graph Theory
The theorem involves two special matrices. One is the adjacency matrix (defined back in Section 1.2.2), and the other is defined as follows. Let G be a graph with vertices v1 , v2 , . . . vn . The degree matrix of G is the n × n matrix D whose (i, j) entry, denoted by [D]i,j , is defined by deg(vi ) if i = j, [D]i,j = 0 otherwise. So, the diagonal entries of D are the vertex degrees, and the off-diagonal entries are all zero. Given an n × n matrix M , the i, j cofactor of M is defined to be (−1)i+j det(M (i|j)), where det(M (i|j)) represents the determinant of the (n − 1) × (n − 1) matrix formed by deleting row i and column j from M . We are now ready to state the Matrix Tree Theorem, due to Kirchhoff. The proof that we give imitates those presented in [148] and [52]. Theorem 1.19 (Matrix Tree Theorem). If G is a connected labeled graph with adjacency matrix A and degree matrix D, then the number of unique spanning trees of G is equal to the value of any cofactor of the matrix D − A. Proof. Suppose G has n vertices (v1 , . . . , vn ) and k edges (f1 , . . . , fk ). Since G is connected, we know that k is at least n − 1. Let N be the n × k matrix whose (i, j) entry is defined by 1 if vi and fj are incident, [N ]i,j = 0 otherwise. N is called the incidence matrix of G. Since every edge of G is incident with exactly two vertices of G, each column of N contains two 1’s and n − 2 zeros. Let M be the n × k matrix that results from changing the topmost 1 in each column to −1. To prove the result, we first need to establish two facts, which we call Claim A and Claim B. Claim A. M M T = D − A (where M T denotes the transpose of M ). First, notice that the (i, j) entry of D − A is ⎧ ⎨ deg(vi ) if i = j, −1 if i = j and vi vj ∈ E(G), [D − A]i,j = ⎩ 0 if i = j and vi vj ∈ E(G). Now, what about the (i, j) entry of M M T ? The rules of matrix multiplication tell us that this entry is the dot product of row i of M and column j of M T . That is,
[M M T ]i,j = ([M ]i,1 , [M ]i,2 , . . . , [M ]i,k ) · [M T ]1,j , [M T ]2,j , . . . , [M T ]k,j = ([M ]i,1 , [M ]i,2 , . . . , [M ]i,k ) · ([M ]j,1 , [M ]j,2 , . . . , [M ]j,k ) =
k
r=1
[M ]i,r [M ]j,r .
1.3 Trees
49
If i = j, then this sum counts one for every nonzero entry in row i; that is, it counts the degree of vi . If i = j and vi vj ∈ E(G), then there is no column of M in which both the row i and row j entries are nonzero. Hence the value of the sum in this case is 0. If i = j and vi vj ∈ E(G), then the only column in which both the row i and the row j entries are nonzero is the column that represents the edge vi vj . Since one of these entries is 1 and the other is −1, the value of the sum is −1. We have shown that the (i, j) entry of M M T is the same as the (i, j) entry of D − A, and thus Claim A is proved. Let H be a subgraph of G with n vertices and n − 1 edges. Let p be an arbitrary integer between 1 and n, and let M be the (n − 1) × (n − 1) submatrix of M formed by all rows of M except row p and the columns that correspond to the edges in H. Claim B. If H is a tree, then | det(M )| = 1. Otherwise, det(M ) = 0. First suppose that H is not a tree. Since H has n vertices and n−1 edges, we know from earlier work that H must be disconnected. Let H1 be a connected component of H that does not contain the vertex vp . Let M be the |V (H1 )| × (n − 1) submatrix of M formed by eliminating all rows other than the ones corresponding to vertices of H1 . Each column of M contains exactly two nonzero entries: 1 and −1. Therefore, the sum of all of the row vectors of M is the zero vector, so the rows of M are linearly dependent. Since these rows are also rows of M , we see that det(M ) = 0. Now suppose that H is a tree. Choose some leaf of H that is not vp (Theorem 1.14 lets us know that we can do this), and call it u1 . Let us also say that e1 is the edge of H that is incident with u1 . In the tree H − u1 , choose u2 to be some leaf other than vp . Let e2 be the edge of H − u1 incident with u2 . Keep removing leaves in this fashion until vp is the only vertex left. Having established the list of vertices u1 , u2 , . . . , un−1 , we now create a new (n − 1) × (n − 1) matrix M ∗ by rearranging the rows of M in the following way: row i of M ∗ will be the row of M that corresponds to the vertex ui . An important (i.e., useful!) property of the matrix M ∗ is that it is lower triangular (we know this because for each i, vertex ui is not incident with any of ei+1 , ei+2 , . . . , en−1 ). Thus, the determinant of M ∗ is equal to the product of the main diagonal entries, which are either 1 or −1, since every ui is incident with ei . Thus, | det(M ∗ )| = 1, and so | det(M )| = 1. This proves Claim B. We are now ready to investigate the cofactors of D − A = M M T . It is a fact from matrix theory that if the row sums and column sums of a matrix are all 0, then the cofactors all have the same value. (It would be a nice exercise—and a nice review of matrix skills—for you to try to prove this.) Since the matrix M M T satisfies this condition, we need to consider only one of its cofactors. We might as well choose i and j such that i + j is even—let us choose i = 1 and j = 1. So, the (1, 1) cofactor of D − A is
det ((D − A)(1|1)) = det M M T (1|1) = det(M1 M1T )
50
1. Graph Theory
where M1 is the matrix obtained by deleting the first row of D − A. At this point we make use of the Cauchy–Binet Formula, which says that the determinant above is equal to the sum of the determinants of (n − 1) × (n − 1) submatrices of M1 (for a more thorough discussion of the Cauchy–Binet Formula, see [40]). We have already seen (in Claim B) that any (n − 1) × (n − 1) submatrix that corresponds to a spanning tree of G will contribute 1 to the sum, while all others contribute 0. This tells us that the value of det(D − A) = det(M M T ) is precisely the number of spanning trees of G. Figure 1.49 shows a labeled graph G and each of its eight spanning trees. v1
v2
v3
v4
FIGURE 1.49. A labeled graph and its spanning trees.
The degree matrix D and adjacency matrix A are ⎤ ⎡ ⎡ 0 2 0 0 0 ⎢ 0 ⎢ 0 2 0 0 ⎥ ⎥ A=⎢ D=⎢ ⎣ 1 ⎣ 0 0 3 0 ⎦, 1 0 0 0 3 and so
0 0 1 1
1 1 0 1
⎤ 2 0 −1 −1 ⎢ 0 2 −1 −1 ⎥ ⎥ D−A=⎢ ⎣ −1 −1 3 −1 ⎦ . −1 −1 −1 3 ⎡
The (1, 1) cofactor of D − A is ⎤ ⎡ 2 −1 −1 det ⎣ −1 3 −1 ⎦ = 8. −1 −1 3 Score one for Kirchhoff!
⎤ 1 1 ⎥ ⎥, 1 ⎦ 0
1.4 Trails, Circuits, Paths, and Cycles
51
Exercises 1. Let T be a labeled tree. Prove that the Pr¨ufer sequence of T will not contain any of the leaves’ labels. Also prove that each vertex v will appear in the sequence exactly deg(v) − 1 times. 2. Determine the Pr¨ufer sequence for the trees in Figure 1.50. 1 4 2 6
3 7
8
4
5
9
10 11
1
9 3
5 6
8
2
7
FIGURE 1.50. Two labeled trees.
3. Draw and label a tree whose Pr¨ufer sequence is 5, 4, 3, 5, 4, 3, 5, 4, 3. 4. Which trees have constant Pr¨ufer sequences? 5. Which trees have Pr¨ufer sequences with distinct terms? 6. Let e be an edge of Kn . Use Cayley’s Theorem to prove that Kn − e has (n − 2)nn−3 spanning trees. 7. Use the Matrix Tree Theorem to prove Cayley’s Theorem. Hint: Look back at the discussion prior to the statement of the Matrix Tree Theorem.
1.4 Trails, Circuits, Paths, and Cycles Takes a real salesman, I can tell you that. Anvils have a limited appeal, you know. — Charlie Cowell, anvil salesman, The Music Man Charlie Cowell was a door to door anvil salesman, and he dragged his heavy wares down every single street in each town he visited. Not surprisingly, Charlie became quite proficient at designing routes that did not repeat many streets. He certainly did not want to drag the anvils any farther than necessary, and he especially liked it when he could cover every street in the town without repeating a single one. After several years of unsuccessful sales (he saw more closed doors than closed deals), the Acme Anvil Company did the natural thing — they promoted him. Charlie moved from salesman to regional supplier. This meant that Charlie would
52
1. Graph Theory
be in charge of driving the anvil truck from town to town, delivering each town’s supply of anvils. Still efficiency-minded, he wanted to plan driving routes that did not repeat any town along the way. He had been very good at route planning during his door to door days, and avoiding the repetition of towns was basically the same as avoiding the repetition of streets, right? As you read through this section, see if you can answer that question for yourself.
1.4.1 The Bridges of K¨onigsberg One should make a serious study of a pastime. — Alexander the Great At the very beginning of this chapter, we referred to the legendary K¨onigsberg Bridge Problem. As you will recall, this problem concerned the existence (or nonexistence) of a certain type of route across a group of bridges (Figure 1.1). Could one design a route that crossed each bridge exactly once? The residents of seventeenth and eighteenth century K¨onigsberg passed the time making valiant efforts, but no route could be found. In 1736, the Swiss mathematician Euler addressed the problem ([98], translated in [26]). Near the beginning of his article, Euler described his thoughts as he embarked on the search for a solution. As far as the problem of the seven bridges of K¨onigsberg is concerned, it can be solved by making an exhaustive list of all possible routes, and then finding whether or not any route satisfies the conditions of the problem. Because of the number of possibilities, this method of solution would be too difficult and laborious, and in other problems with more bridges it would be impossible . . . Hence I rejected it, and looked for another method concerned only with the problem of whether or not the specified route could be found; I considered that such a method would be much simpler. [26] This passage is enlightening on several levels. For one, it gives us a glimpse of the teacher/expositor side of the master mathematician Euler. It is doubtful that he would have seriously considered listing all possible routes in search of a satisfactory one. His mention of the possibility, though, does help the reader progress along a natural arc of thought regarding the solution. The passage also gives a clue as to what Euler is really after — not just a solution to the problem in K¨onigsberg, but a general solution that could be applied in other land/bridge formations. Using a figure similar to Figure 1.51, he used sequences of letters to describe routes — routes where no bridges were repeated. For instance, the sequence ABDACAB represented a route that started at A, crossed a bridge to B, crossed a bridge to D, crossed a bridge back to A, crossed a bridge to C, crossed a bridge back to A, and then crossed a bridge to B. This seven letter sequence includes
1.4 Trails, Circuits, Paths, and Cycles
53
C A
D B
FIGURE 1.51. Layout of the bridges in K¨onigsberg.
six of the seven bridges in K¨onigsberg, and these bridges can be identified by the consecutive pairs in the sequence: AB, BD, DA, AC, CA, AB. For Euler the K¨onigsberg Bridge Problem boiled down to finding a certain sequence of letters. He described it in this way: The problem is therefore reduced to finding a sequence of eight letters, formed from the four letters A, B, C, and D, in which the various pairs of letters occur the required number of times. Before I turn to the problem of finding such a sequence, it would be useful to find out whether or not it is even possible to arrange the letters in this way, for if it were possible to show that there is no such arrangement, then any work directed towards finding it would be wasted. I have therefore tried to find a rule which will be useful in this case, and in others, for determining whether or not such an arrangement can exist. [26] Euler argued that since land area D is connected to three bridges, then D must appear in the sequence two times. (If it appeared only once, this would not account for all of the bridges; if it appeared more than twice, this would represent multiple crossing of at least one bridge.) Similarly, Euler argued, B and C must each appear twice in the eight letter sequence. Further, since land area A is connected to five bridges, the letter A must appear three times in the sequence (you will verify this in Exercise 1a). This means that the necessary eight letter sequence would have three As, two Bs, two Cs and two Ds. In Euler’s words, It follows that such a journey cannot be undertaken across the seven bridges of K¨onigsberg. [26] Once he had settled the problem of the K¨onigsberg bridges, Euler used the same ideas and methods to present a more general result, and we will see that result in the next section. As you see, Euler did not use terms like graph, vertex or edge. Today’s graph terminology did not appear until many years later. Still, this article by Euler was the seed from which the field of graph theory grew. Euler himself recognized that he was working in relatively uncharted territory. We close this section with the passage with which Euler opened his seminal article. See if you can read “graph theory” between the lines.
54
1. Graph Theory
In addition to that branch of geometry which is concerned with magnitudes, and which has always received the greatest attention, there is another branch, previously almost unknown, which Leibniz first mentioned, calling it the geometry of position. This branch is concerned only with the determination of position and its properties; it does not involve measurements, nor calculations made with them. It has not yet been satisfactorily determined what kind of problems are relevant to this geometry of position, or what methods whould be used in solving them. Hence, when a problem was recently mentioned [the K¨onigsberg problem!], which seemed geometrical but was so constructed that it did not require the measurement of distances, nor did calculation help at all, I had no doubt that it was concerned with the geometry of position — especially as its solution involved only position, and no calculation was of any use. I have therefore decided to give here the method which I have found for solving this kind of problem, as an example of the geometry of position. [26] Mathematics is richer because Euler took up the problem of the K¨onigsberg bridges. We are grateful, but perhaps not as grateful as the residents of K¨onigsberg whose feet had grown tired from the search for a route that did not exist. Exercises 1. In the context of Euler’s letter sequences, prove that . . . (a) if a land mass L is connected to 5 bridges, then L will occur 3 times in any representation of a route that crosses all of the bridges once. (b) if a land mass L is connected to n bridges, where n is odd, then L will occur n+1 2 times in any representation of a route that crosses all of the bridges once. 2. An eighth bridge was built in K¨onigsberg — an additional bridge joining land masses B and C. Did this addition make the desired route possible? Prove your answer. 3. Euler’s 1736 article included a second example of a land/bridge system (see Figure 1.52). Does a route exist that crosses each bridge exactly once? If so, give one. If not, prove it. 4. The streets in River City are shown in Figure 1.53. Is it possible for Charlie the anvil salesman to plan a route that covers every street exactly once? If so, give one. If not, prove it.
1.4 Trails, Circuits, Paths, and Cycles
D
C
55
E
B
A
F FIGURE 1.52.
FIGURE 1.53.
1.4.2 Eulerian Trails and Circuits If only part of the line-system has been traversed, then every node in the remaining part remains even or odd, just as it was in the original system. — Carl Hierholzer [159], translated in [26] Recall from Section 1.1.2 that a trail in a graph is a walk that does not repeat any edges, and that a closed trail (one that begins and ends at the same vertex) is called a circuit. If a trail in a graph G includes every edge of G, then that trail is said to be an Eulerian trail. Similarly, an Eulerian circuit in a graph is a circuit that includes every edge of the graph. A graph that contains an Eulerian circuit is said to be an Eulerian graph. What are some examples of Eulerian graphs? The cycles, Cn , have prominent Eulerian circuits. The paths, Pn , have no circuits at all, and so they are certainly not Eulerian. Look at the graphs in Figure 1.54 and try to determine which ones, if any, are Eulerian. There are two well-known characterizations of Eulerian graphs. One involves vertex degrees, and the other concerns the existence of a special collection of cycles. The following theorem establishes both of these characterizations by asserting the logical equivalence of three statements. The theorem represents work by Euler [98], Hierholzer [159], and Veblen [274].
56
1. Graph Theory
FIGURE 1.54. Are any of these Eulerian?
Theorem 1.20. For a connected graph G, the following statements are equivalent. 1. G is Eulerian. 2. Every vertex of G has even degree. 3. The edges of G can be partitioned into (edge-disjoint) cycles. Proof. To prove the logical equivalence of these statements, we prove that the first statement implies the second, the second implies the third, and the third implies the first. For the first implication, suppose that G contains an Eulerian circuit C. Let v be an arbitrary vertex of G. Every time the circuit enters v on an edge, it must leave on a different edge. Since C never repeats an edge, there must be an even number of edges incident with v and hence the degree of v is even. For the second implication, suppose that every vertex of G has even degree. We use induction on the number of cycles in G. Since G is connected and has no vertices of degree 1, G is not a tree, and therefore G must have at least one cycle. If G has exactly one cycle, the G must be a cycle graph Cn for some n, and so the desired partition contains just the one cycle itself. Suppose now (using strong induction) that the implication is valid for graphs containing at most k cycles, and suppose G has k + 1 cycles. Let C be one of the cycles of G, and let G be the graph obtained from G by deleting the edges of C. With this deletion, each vertex of C loses exactly two edges, and hence the vertices of G all have even degree. Further, the graph G (which is possibly disconnected) has connected components that have no more than k cycles each. Each component, then, satisfies the induction hypothesis and has edges that can be partitioned into cycles. These cycles, together with the cycle C, partition the edges of G into cycles. The induction is complete, and the implication is established. For the third implication, suppose that the edges of G can be partitioned into cycles. Call these cycles S1 , S2 , . . . , Sk . Let C be the largest circuit in G such that the set of edges of C is exactly E(Sj1 ) ∪ E(Sj2 ) ∪ · · · ∪ E(Sjm ) for some collection of the cycles Sj1 , Sj2 , . . . , Sjm . (We note here that this implies that for each cycle Si (1 ≤ i ≤ k), either all of the edges of Si are on C or none
1.4 Trails, Circuits, Paths, and Cycles
57
of them are.) Now, suppose e is an edge of G that is (a) not an edge of C, and (b) incident with a vertex, say v, that is on C. Since e is not an edge of C, it must be that e is an edge of cycle Si , for some i, where no edge of Si is on C. The vertex v must also be on Si . Let C be the circuit in G obtained by patching Si into C at the vertex v (since no edge of Si is a member of C, there is no repetition of edges caused by this patching). Since the edges of C consist of the edges of C together with the edges of Si , we have contradicted the maximality of C . This means that no such edge e can exist and therefore that C is an Eulerian circuit of G. The final implication is established. So, Eulerian circuits exist in connected graphs precisely when the degrees of these graphs are all even. What about Eulerian trails? Certainly if an Eulerian circuit exists, then so does an Eulerian trail (the circuit is just a closed trail). But are there graphs which are not Eulerian but which do contain an Eulerian trail? The following corollary gives the complete answer. Its proof is left for you as an exercise. Corollary 1.21. The connected graph G contains an Eulerian trail if and only if there are at most two vertices of odd degree. Now that we know precisely when Eulerian circuits and trails exist, how easy is it to find them? The algorithm given below, named for nineteenth century mathematician Carl Hierholzer [159], gives a simple way of identifying such routes. While not identical, you may notice a similarity between this algorithm and the method used to prove the third implication in the proof of Theorem 1.20. Before reading on, take a look back at the quotation given at the beginning of this section. It describes the primary reason for the success of Hierholzer’s algorithm. Hierholzer’s Algorithm for Identifying Eulerian Circuits Given: An Eulerian graph G. i. Identify a circuit in G and call it R1 . Mark the edges of R1 . Let i = 1. ii. If Ri contains all edges of G, then stop (since Ri is an Eulerian circuit). iii. If Ri does not contain all edges of G, then let vi be a vertex on Ri that is incident with an unmarked edge, ei . iv. Build a circuit, Qi , starting at vertex vi and using edge ei . Mark the edges of Qi . v. Create a new circuit, Ri+1 , by patching the circuit Qi into Ri at vi . vi. Increment i by 1, and go to step ii. An example of this process is shown in Figure 1.55. You should note that the
58
1. Graph Theory a
a
b
c
c
d f
e
d f
e
h
h
g
g
i
j
i
j
R1: e, g, h, j, e
R2: e, g, h, d, c, h, j, e
Q1: h, d, c, h
Q2: d, b, a, c, e, d
a
e
a
b
c
b
c
d f
e
h g
i
b
d f h g
j
R4: e, g, h, f, e, i, h, d, b, a, c, e, d, c, h, j, e
i
j
R3 : e, g, h, d, b, a, c, e, d, c, h, j, e Q3: h, f, e, i, h
FIGURE 1.55. The stages of Hierholzer’s algorithm.
process will succeed no matter what the initial circuit, R1 , is chosen to be. Another algorithm for finding Eulerian circuits is given in Exercise 3. The even degree characterization of Eulerian graphs is really quite nice. All one needs to do to determine if a graph is Eulerian is simply look at the degrees of the vertices. Once we know a graph is Eulerian, Hierholzer’s algorithm will give us an Eulerian circuit. Maybe Charlie Cowell, our anvil salesman, used these ideas to plan his door to door routes! Exercises 1. For each of the following, draw an Eulerian graph that satisfies the conditions, or prove that no such graph exists. (a) An even number of vertices, an even number of edges.
1.4 Trails, Circuits, Paths, and Cycles
59
(b) An even number of vertices, an odd number of edges. (c) An odd number of vertices, an even number of edges. (d) An odd number of vertices, an odd number of edges. 2. Use Hierholzer’s algorithm to find an Eulerian circuit in the graph of Figure 1.56. Use R1 : a, b, c, g, f, j, i, e, a as your initial circuit. b
a e i
m
c
d
f
g
j
k n
o
h l
p
FIGURE 1.56.
3. What follows is another algorithm (from [195]) for finding Eulerian circuits. The method used here is to build the circuit, one edge at a time, making sure to make good choices along the way. Fleury’s Algorithm for Identifying Eulerian Circuits Given: An Eulerian graph G, with all of its edges unmarked. i. Choose a vertex v, and call it the “lead vertex.” ii. If all edges of G have been marked, then stop. Otherwise continue to step iii. iii. Among all edges incident with the lead vertex, choose, if possible, one that is not a bridge of the subgraph formed by the unmarked edges. If this is not possible, choose any edge incident with the lead. Mark this edge and let its other end vertex be the new lead vertex. iv. Go to step ii. Use Fleury’s algorithm to find an Eulerian circuit for the graph in Figure 1.57. Let a be your initial vertex. 4. Prove Corollary 1.21. 5. Prove that if every edge of a graph G lies on an odd number of cycles, then G is Eulerian. 6. Let G be a connected graph which is regular of degree r. Prove that the line graph of G, L(G), is Eulerian.
60
1. Graph Theory
b
a
f
d
c
e
g
FIGURE 1.57.
7. Let G = Kn1 ,n2 . (a) Find conditions on n1 and n2 that characterize when G will have an Eulerian trail. (b) Find conditions that characterize when G will be Eulerian. 8. Let G = Kn1 ,...,nk , where k ≥ 3. (a) Find conditions on n1 , . . . , nk that characterize when G will have an Eulerian trail. (b) Find conditions that characterize when G will be Eulerian.
1.4.3 Hamiltonian Paths and Cycles In this new Game (. . . named Icosian, from a Greek work signifying ‘twenty’) a player is to place the whole or part of a set of twenty numbered pieces or men upon the points or in the holes of a board . . . in such a manner as always to proceed along the lines of the figure . . . — from the instructions which accompanied The Icosian Game [26] In 1859 the English game company Jaques and Son bought the rights to manufacture and market “The Icosian Game.” The game involved twenty pegs (numbered 1 through 20) and a gameboard with holes (see Figure 1.58). Players were required to place the pegs in the holes in such a way that every pair of consecutive integers, along with the pair (1, 20), were directly connected by one of the lines on the board. As intriguing and action-packed as the game sounds, it did not sell well.8 Another version of the game had the board design situated on the exterior of a dodecahedron, a 12-sided solid. The object here was to find a round-trip route around the solid, traveling only on the edges and touching each vertex once. This version was named “A Voyage Round the World” since the vertices represented important cities of the time. Like its twin “The Icosian Game,” this game’s voyage was short lived. 8 Jaques
and Son managed to get over this particular setback. The company, still in business today, had much better success in popularizing Tiddledy Winks (now Tiddly Winks), Snakes and Ladders (now Chutes and Ladders), and Whiff Whaff (now Table Tennis).
1.4 Trails, Circuits, Paths, and Cycles
61
FIGURE 1.58. The Icosian Game board.
The inventor who sold the game to Jaques and Son was the prominent mathematician Sir William Rowan Hamilton. Even though his ideas did not take root in a recreational sense, they did become the seed for what would become a major branch of inquiry within the field of graph theory. Let’s take a look at some of these ideas. If a path P spans the vertices of G (that is, if V (P ) = V (G)), then P is said to be a Hamiltonian path of G. Any graph containing a Hamiltonian path is called traceable. If a cycle C spans the vertices of a graph G, such a cycle is called a Hamiltonian cycle, and any graph containing a Hamiltonian cycle is called, simply, a Hamiltonian graph. Hamiltonian graphs are clearly traceable, but the reverse is not always true. Look at the graphs in Figure 1.59 and try to determine which ones are traceable, Hamiltonian, or neither.
G1
G2
G3
FIGURE 1.59. Which ones are Hamiltonian? Which are traceable?
We saw in the previous section that whether or not a connected graph was Eulerian depended completely on degree parity. Unfortunately, this is not the case for Hamiltonicity. Hamiltonian graphs can have all even degrees (C10 ), all odd degrees (K10 ), or a mixture (G1 in Figure 1.59). Similarly, non-Hamiltonian graphs can have varying degree parities: all even (G2 in Figure 1.59), all odd (K5,7 ), or mixed (P9 ).
62
1. Graph Theory
If degree parity does not have much to do with Hamiltonicity, then what does? Researchers have worked for decades on this question, and their efforts have produced many interesting results. A complete summary of these developments would require many pages,9 and we do not attempt to give a thorough treatment here. Rather, we present several of the classic ideas and results. The first result that we examine is due to Dirac [77]. It does concern degrees in a graph — but their magnitude rather than their parity. Recall that δ(G) is the minimum degree of G. Theorem 1.22. Let G be a graph of order n ≥ 3. If δ(G) ≥ n/2, then G is Hamiltonian. Proof. Let G be a graph satisfying the given conditions, and suppose that G is not Hamiltonian. Let P be a path in G with maximum length, and say the vertices of P , in order, are v1 , v2 , . . . , vp . Because of the maximality of P , we know that all of the neighbors of v1 and of vp are on P . And since δ(G) ≥ n/2, each of v1 and vp has at least n/2 neighbors on P . We now claim that there must exist some j (1 ≤ j ≤ p − 1) such that vj ∈ N (vp ) and vj+1 ∈ N (v1 ). Suppose for the moment that this was not the case. Then for every neighbor vi of vp on P (and there are at least n/2 of them), vi+1 is not a neighbor of v1 . This means that deg(v1 ) ≤ p − 1 −
n n n α(G). This means that some pair of vertices in S must be adjacent. Our third observation implies that di must be adjacent to dj for some i < j. If R is a path from hi to hj in H, then the cycle ci , [hi , hj ]R , [cj , di ]C − , [dj , ci ]C + is a longer cycle than C (see Figure 1.62). Our assumption that C was not a Hamil-
C
ci di
dj
R
cj
hi
H
hj
FIGURE 1.62.
tonian cycle has led to a contradiction. Therefore G is Hamiltonian. As was the case for Dirac’s theorem, the inequality in this theorem is sharp. That is, graphs G where κ(G) ≥ α(G) − 1 are not necessarily Hamiltonian. The complete bipartite graphs Kr,r+1 provide proof of this. The Petersen graph, shown in Figure 1.63, is another example.10 10 The Petersen graph is well known among graph theorists for its surprising connections to many areas of the field, and for its penchant for being a counterexample to many conjectures. You have seen this graph already — it is the graph you should have obtained as the complement of the line graph of K5 in Exercise 7b of Section 1.1.3.
1.4 Trails, Circuits, Paths, and Cycles
65
FIGURE 1.63. The Petersen Graph.
The next theorem belongs to a category of results that relate Hamiltonicity to forbidden subgraphs. Given graphs G and H, if G does not contain a copy of H as an induced subgraph, then we say that G is H-free. If S is a collection of graphs, and if G does not contain any of the graphs in S as induced subgraphs, then we say that G is S-free. In 1974, Goodman and Hedetniemi [127] noticed something regarding two of the graphs shown in Figure 1.64.
K 1,3
Z1
N FIGURE 1.64. Three special graphs.
Theorem 1.25. If G is a 2-connected, {K1,3 , Z1 }-free graph, then G is Hamiltonian. Proof. Suppose G is 2-connected and {K1,3 , Z1 }-free, and let C be a longest cycle in G (we know that G contains at least one cycle — see Exercise 14 in Section 1.1.2). If C is not a Hamiltonian cycle, then there must exist a vertex v, not on C, which is adjacent to a vertex, say w, on C. Let a and b be the immediate predecessor and successor of w on C. A longer cycle would exist if either a or b were adjacent to v, and so it must be that both a and b are nonadjacent to v. Now, if a is not adjacent to b, then
66
1. Graph Theory
the subgraph induced by the vertices {w, v, a, b} is K1,3 , and we know that G is K1,3 -free. So it must be that ab ∈ E(G). But if this is the case, then the subgraph induced by {w, v, a, b} is Z1 , a contradiction. Therefore, it must be that C is a Hamiltonian cycle. The fact that this result requires 2-connectivity should not be surprising, for 2-connectivity is required for all Hamiltonian graphs. As you will prove in Exercise 2, graphs G where κ(G) = 1 cannot have a spanning cycle. Another classic forbidden subgraph theorem involves K1,3 and the third graph shown in Figure 1.64. This is a result of Duffus, Gould, and Jacobson [81]. Theorem 1.26. Let G be a {K1,3 , N }-free graph. 1. If G is connected, then G is traceable. 2. If G is 2-connected, then G is Hamiltonian. It is interesting to note that the graph K1,3 is involved in both of these theorems. This graph, affectionately referred to as the “claw,” appears in many forbidden subgraph results. Claw-free graphs have received a great deal of attention in recent years, especially within the context of Hamiltonicity problems. The claw will bare itself again in the next section in the context of unsolved problems. Exercises 1. Give a solution to The Icosian Game. 2. Prove that if G is Hamiltonian, then G is 2-connected. 3. Prove Theorem 1.23. 4. Give the connectivity and independence number of the Petersen graph. 5. Prove or disprove: The independence number of a bipartite graph is equal to the cardinality of one of its partite sets. 6. Prove that if G is of order n and is regular, then α(G) ≤ n/2. 7. Prove that each of the 18-vertex graphs in Figure 1.65 is 2-connected, clawfree and nontraceable.11 8. For any graph G, prove that the line graph L(G) is claw-free. 9. Let G be a K3 -free graph. Prove that its complement, G, is claw-free. 10. Let G be a graph and let S be a nonempty subset of V (G). 11 In
[154] the authors show that 2-connected, claw-free graphs of order less than 18 are traceable. They also show that the graphs in Figure 1.65 are the only 2-connected, claw-free, nontraceable graphs with order 18 and size at most 24.
1.4 Trails, Circuits, Paths, and Cycles
67
FIGURE 1.65.
(a) Prove that if G is Hamiltonian, then G − S has at most |S| connected components. (b) Prove that if G is traceable, then G − S has at most |S| + 1 connected components. 11. Prove that if G is Eulerian, then L(G) is Hamiltonian. 12. Let G = Kn1 ,n2 . (a) Find conditions on n1 and n2 that characterize the traceability of G. (b) Find conditions that characterize the Hamiltonicity of G. 13. Let n be a positive integer. (a) Prove that Kn,2n,3n is Hamiltonian. (b) Prove that Kn,2n,3n+1 is not Hamiltonian.
1.4.4 Three Open Problems Nothing can stop the claw! — Fletcher Reede, Liar, Liar We close our discussion of paths and cycles with several questions. These problems were posed years ago, and they have received a great deal of attention. While there has been progress on each of them, the original questions remain unanswered. Intersecting Detour Paths Given a graph G, the detour order of G, denoted τ (G), is the number of vertices in a longest path in G. If a path P in G has τ (G) vertices, then we call P a detour path in G. In Exercise 8 of Section 1.1.2, you proved that if G is a connected graph and if P1 and P2 are detour paths, then the interesection V (P1 ) ∩ V (P2 ) must be nonempty. As you (hopefully!) saw, this result is not terribly difficult to prove. Consider the following question.
68
1. Graph Theory
Question A: If G is connected and P1 , P2 , and P3 are detour paths in G, then must the intersection V (P1 ) ∩ V (P2 ) ∩ V (P3 ) be nonempty? As you see, the only difference between this question and the earlier exercise is that this one involves three paths rather than two. But this difference makes all the difference, because Question A remains unsolved! The origin of this question can be traced to a related question asked by Gallai [118] in 1966: Is it true that in every connected graph there is at least one vertex that lies on every detour path? In 1969, Walther [278] gave a negative answer to the question in the form of the graph in Figure 1.66. The detour order of this graph
FIGURE 1.66. Walther’s example.
is 21, and every vertex is missed by at least one of the detour paths. Within the next several years, Walther and Zamfirescu, working independently (see [141], [279], [290]), had produced a smaller example, the graph in Figure 1.67. This
FIGURE 1.67. A smaller example, given by Walther and Zamfirescu.
graph has 12 vertices, has detour order 10, and every vertex is missed by at least one of the detour paths. The graph in Figure 1.67 is the smallest known graph where the detour paths have an empty intersection. Consider the following more general version of Question A.
1.4 Trails, Circuits, Paths, and Cycles
69
Question B: If G is connected and P1 , . . . , Pn are distinct detour n paths in G, then must the intersection V (Pi ) be nonempty? i=1
The graph of Figure 1.67 demonstrates that for n = 12, the answer to Question B is no. In 1975, Schmitz [250] presented the graph in Figure 1.68. The detour order
FIGURE 1.68. Example given by Schmitz.
of this graph is 13. There are exactly seven detour paths, and every vertex of the graph is missed by at least one of these paths. This tells us that for n = 7, the answer to Question B is no. We have already mentioned that for n = 3, the answer to Question B is unknown. The same is true for n = 4, 5 and 6. When asked, most researchers would probably lean toward believing the result to be true for n = 3, although no proof is known as of yet. For now, it is simply a conjecture. Conjecture 1. If G is connected, then the intersection of any three distinct detour paths in G is nonempty. Matthews and Sumner’s Conjecture We met the claw, K1,3 , in the previous section. We saw two results in which the claw, when forbidden with another graph, implied Hamiltonicity in 2-connected graphs. There are other such pairs. In [20], [39], and [130], the respective authors showed that the pairs {K1,3 , W }, {K1,3 , P6 }, and {K1,3 , Z2 } (see Figure 1.69) all imply Hamiltonicity when forbidden in 2-connected graphs. Do you see a pat-
W
Z2
FIGURE 1.69. Two additional forbidden subgraphs.
tern here? The claw seems to be prominent in results like this. In 1997, Faudree and Gould [102] showed that this was no coincidence. The graph N appears in Figure 1.64.
70
1. Graph Theory
Theorem 1.27. If being {R, S}-free (where R, S are connected and neither is P3 ) implies that 2-connected graphs are Hamiltonian, then one of R, S is the claw, and the other is an induced subgraph of P6 , Z2 , W , or N . Is the claw powerful enough to imply Hamiltonicity when forbidden by itself? Well, as you will prove in the exercises, the graph P3 is the only connected graph that, when forbidden, implies Hamiltonicity in 2-connected graphs. But what if the level of connectivity is increased? Question C: If G is claw-free and k-connected (k ≥ 3), must G be Hamiltonian? The graph in Figure 1.70 is 3-connected, claw-free and non-Hamiltonian,12 and so the answer to Question C for k = 3 is no.
FIGURE 1.70. A lovely example.
In 1984 Matthews and Sumner [199] made the following, still unresolved, conjecture. Conjecture 2. If G is 4-connected and claw-free, then G is Hamiltonian. There has been some progress with regard to this conjecture. Most notably, in 1997 Ryj´acˇ ek [245] proved the following theorem. Theorem 1.28. If G is 7-connected and claw-free, then G is Hamiltonian. At this time, Question C for k = 4, 5 and 6 is still unanswered. 12 This
graph, demonstrated by Matthews ([198], see also [199]) in 1982, is the smallest such graph, and it is the line graph of the graph obtained from the Petersen graph (what else?) by replacing each of the five “spoke” edges with a P3 .
1.4 Trails, Circuits, Paths, and Cycles
71
The Path Partition Conjecture Recall that τ (G), the detour order of G, is the number of vertices in a longest path of G. Recall also that given a subset S of V (G), the notation S represents the subgraph of G induced by S. Given a graph G and positive integers a and b, if the vertices of G can be partitioned into two sets A and B in such a way that τ (A ) ≤ a and τ (B ) ≤ b, then we say that G has an (a, b)-partition. As an example, consider the graph G in Figure 1.71. The partition (A1 , B1 ), a b c
d
e
f
g k
A1 = {a, b, c, d, h, i} B1 = {e, f, g, j, k, l}
j h
i
l
A2 = {c, d, h, i} B2 = {a, b, e, f, g, j, k, l}
FIGURE 1.71. Partitioning the vertex set.
where A1 = {a, b, c, d, h, i} and B1 = {e, f, g, j, k, l}, is not a valid (4, 7)partition. This is because every longest path in both A1 and B1 has 6 vertices. On the other hand, the partition (A2 , B2 ), where A2 = {c, d, h, i}, B2 = {a, b, e, f, g, j, k, l} is a valid (4, 7)-partition, since τ (A2 ) ≤ 4 and τ (B2 ) ≤ 7. If a graph G has an (a, b)-partition for every pair (a, b) of positive integers such that a + b = τ (G), then we say that G is τ -partitionable. In order to show that the graph in Figure 1.71 is τ -partitionable (since its detour order is 11), we would also need to show that the graph had (1, 10)-, (2, 9)-, (3, 8)-, and (5, 6)-partitions. Another way to demonstrate this would be to prove the following, still unresolved, conjecture. The Path Partition Conjecture. Every graph is τ -partitionable.
72
1. Graph Theory
The Path Partition Conjecture was first mentioned by Lov´asz and Mih´ok in 1981, and it has received a great deal of attention since then. Much of the progress has been the establishment that certain families of graphs are τ -partitionable. The following theorem gives a small sampling of these results. Theorem 1.29. The graph G is τ -partitionable if any one of the following is true: 1. Δ(G) ≤ 3; (follows from [189]) 2. Δ(G) ≥ |V (G)| − 8; (follows from [38]) 3. τ (G) ≤ 13; [83] 4. τ (G) ≥ |V (G)| − 1. [38] So, if the max degree of a graph G is either very small or relatively large, or if the longest path in a graph is either rather short or relatively long, then G is τ -partitionable. In 2007, Dunbar and Frick [84] proved the following interesting result. Theorem 1.30. If G is claw-free, then G is τ -partitionable. There is the claw again! In the same article, the authors prove that in order to prove that the Path Partition Conjecture is true, it is sufficient to prove that every 2-connected graph is τ -partitionable. With each new result, researchers add to the arsenal of weapons that can be used to attack the Path Partition Conjecture. So far, though, the conjecture is holding strong. With all of this era’s computing power, how can it be that the Path Partition Conjecture and the other conjectures in this section remain unsolved? Computers are now doing more things than ever, faster than ever, so why can’t we just get a computer cranking away at these problems? These are reasonable questions to ask. But the conjectures here are not really questions of computation. These are problems that will require a combination of insight, cleverness and patience. Exercises 1. If the word “connected” were removed from Conjecture 1, could you settle the resulting conjecture? 2. Show that every vertex of the graph in Figure 1.67 is missed by at least one detour path in the graph. 3. In the graph of Figure 1.68, find the seven distinct detour paths and show that they have an empty intersection. 4. Show that if G is 2-connected and P3 -free, then G is Hamiltonian. 5. Show that if being H-free implies Hamiltonicity in 2-connected graphs (where H is connected), then H is P3 .
1.5 Planarity
73
6. Verify that the graph in Figure 1.70 is actually the line graph of the graph obtained from the Petersen graph by replacing each of the five “spoke” edges with a P3 . 7. Prove that the graph in Figure 1.67 is τ -partitionable by listing all necessary partitions. 8. Prove that all bipartite graphs are τ -partitionable. 9. Prove that all traceable graphs are τ -partitionable. 10. Prove that every graph G has a (1, τ (G) − 1) partition. 11. Prove that if a graph is (1, 1)-partitionable, then it is (a, b)-partitionable for all positive integers a and b. 12. Show that all graphs are (a, b)-partitionable when a ≤ 3. 13. EXTRA CREDIT: Settle any of the conjectures in this section.
1.5 Planarity Three civil brawls, bred of an airy word By thee, old Capulet, and Montague, Have thrice disturb’d the quiet of our streets . . . — William Shakespeare, Romeo and Juliet The feud between the Montagues and the Capulets of Verona has been well documented, discussed, and studied. A fact that is lesser known, though, is that long before Romeo and Juliet’s time, the feud actually involved a third family—the Hatfields.13 The families’ houses were fairly close together, and chance meetings on the street were common and quite disruptive. The townspeople of Verona became very annoyed at the feuding families. They devised a plan to create separate, nonintersecting routes from each of the houses to each of three popular places in town: the square, the tavern, and the amphitheater. They hoped that if each family had its own route to each of these places, then the fighting in the streets might stop. Figure 1.72 shows the original layout of the routes. Try to rearrange them so that no route crosses another route. We will come back to this shortly. 13 The
Hatfields eventually grew tired of feuding, and they left Verona in search of friendlier territory. They found a nice spot in the mountains of West Virginia, right across the river from a really nice family named McCoy.
74
1. Graph Theory
Capulet
Montague
Hatfield
Square
Amphitheater
Tavern
FIGURE 1.72. Original routes.
1.5.1 Definitions and Examples Define, define, well-educated infant. — William Shakespeare, Love’s Labour’s Lost A graph G is said to be planar if it can be drawn in the plane in such a way that pairs of edges intersect only at vertices, if at all. If G has no such representation, G is called nonplanar. A drawing of a planar graph G in the plane in which edges intersect only at vertices is called a planar representation (or a planar embedding) of G. Figure 1.73 shows examples of planar graphs. Notice that one of the drawings
FIGURE 1.73. Examples of planar graphs.
is not a planar representation—try to visualize untangling it. Proving a graph to be planar is in some cases very simple—all that is required is to exhibit a planar representation of the graph. This is certainly quite easy to do with paths, cycles, and trees. What about complete graphs? K1 , K2 , and K3 are clearly planar; Figure 1.74 shows a planar representation of K4 . We will consider K5 shortly.
FIGURE 1.74. A planar representation of K4 .
1.5 Planarity
75
The Montague/Capulet/Hatfield problem essentially amounts to finding a planar representation of K3,3 . Unfortunately, the townspeople of Verona just had to learn to deal with the feuding families, for K3,3 is nonplanar, and we will see an explanation shortly. What is involved in showing that a graph G is nonplanar? In theory, one would have to show that every possible drawing of G is not a planar representation. Since considering every individual drawing is out of the question, we need some other tools. Given a planar representation of a graph G, a region is a maximal section of the plane in which any two points can be joined by a curve that does not intersect any part of G. Informally, if a cookie cutter has the shape of a planar representation of G, then the cookies are the regions (see Figure 1.75). The big region, R7 , is called the exterior (or outer) region.
R1
R7 R2
R3 R4
R5
R6
FIGURE 1.75. Six small cookies and one very large cookie.
It is quite natural to think of the regions as being bounded by the edges. A single edge can come into contact with either one or two regions. In Figure 1.76, edge e1 is only in contact with one region, S1 , and edges e2 and e3 are only in contact with S2 . Each of the other edges in Figure 1.76 is in contact with two regions. Let us say that an edge e bounds a region R if e comes into contact with e1 e2 S1 S2
e3 S3
FIGURE 1.76. Edges e1 , e2 , and e3 touch one region only.
76
1. Graph Theory
R and with a region different from R. Define the bound degree of R, denoted by b(R), to be the number of edges that bound region R. For example, in Figure 1.75, b(R1 ) = b(R4 ) = 4, b(R2 ) = b(R3 ) = b(R5 ) = b(R6 ) = 3, and b(R7 ) = 12. In Figure 1.76, b(S1 ) = b(S3 ) = 3 and b(S2 ) = 6. Note that in this graph, the edges e1 , e2 , and e3 do not contribute to the bound degree of any region. Figure 1.77 displays six planar graphs along with the numbers of vertices, edges, and regions. Before continuing to the next section, study these numbers and try to find a pattern. You might also notice that two of drawings are actually the same graph. This brings up an important point: The number of regions in a planar representation of a graph does not depend on the representation itself! n =4 q =4 r =2
n =7 q =9 r =4
n =5 q =7 r =4
n =8 q = 12 r =6
n =8 q = 12 r =6
n = 10 q =9 r =1
FIGURE 1.77. Is there a pattern?
Exercises 1. Find planar representations for each of the planar graphs in Figure 1.78. 2. Give planar representations of the graph in Figure 1.79 such that each of the following is the exterior region. (a) R1 (b) R2 (c) R3 (d) R4 (e) R5
1.5 Planarity
a
77
b
x v
h
c
g
d
y w z
f
e
FIGURE 1.78.
R1
R2
R4
R3
R6
R5
FIGURE 1.79.
3. Explain why embedding a graph in a plane is essentially the same as embedding a graph on a sphere. 4. Write a nice proof of the fact that every tree is planar. 5. Draw a planar graph in which every vertex has degree exactly 5. 6. Suppose that e is a bridge of a planar graph G. Prove that e does not bound a region in any planar representation of G. 7. In [101] and [277], F´ary and Wagner proved independently that every planar graph has a planar representation in which every edge is a straight line segment. Find such a representation for the graph in Figure 1.80.
a
b
c
d
e
f
g
FIGURE 1.80.
8. If planar graphs G1 and G2 each have n vertices, q edges, and r regions, must the graphs be isomorphic? Justify your answer with a proof or a counterexample.
78
1. Graph Theory
1.5.2 Euler’s Formula and Beyond Now I will have less distraction. — Leonard Euler, upon losing sight in his right eye [100] Euler discovered a relationship between the numbers of vertices, edges, and regions of a graph, and his discovery is often called Euler’s Formula [99]. Theorem 1.31 (Euler’s Formula). If G is a connected planar graph with n vertices, q edges, and r regions, then n − q + r = 2. Proof. We induct on q, the number of edges. If q = 0, then G must be K1 , a graph with 1 vertex and 1 region. The result holds in this case. Assume that the result is true for all connected planar graphs with fewer than q edges, and assume that G has q edges. Case 1. Suppose G is a tree. We know from our work with trees that q = n − 1; and of course, r = 1, since a planar representation of a tree has only one region. Thus n − q + r = n − (n − 1) + 1 = 2, and the result holds. Case 2. Suppose G is not a tree. Let C be a cycle in G, let e be an edge of C, and consider the graph G − e. Compared to G, this graph has the same number of vertices, one edge fewer, and one region fewer, since removing e coalesces two regions in G into one in G − e. Thus the induction hypothesis applies, and in G − e, n − (q − 1) + (r − 1) = 2, implying that n − q + r = 2. The result holds in both cases, and the induction is complete. Euler’s Formula is useful for establishing that a graph is nonplanar. Theorem 1.32. K3,3 is nonplanar. Proof. Suppose that K3,3 were planar and that we had a planar representation. Since n = 6 and q = 9, Euler’s Formula implies that such a planar representation of K3,3 would have r = 5 regions. Now consider the sum
C= b(R), R
where the sum is over all regions R in the representation of the graph. Since every edge of G can be on the boundary of at most two regions, we get C ≤ 2q = 18. On the other hand, since each region of K3,3 has at least four edges on the boundary (there are no triangles in bipartite graphs), we see that C ≥ 4r = 20. We have reached a contradiction. Therefore, K3,3 is nonplanar. Theorem 1.33. If G is a planar graph with n ≥ 3 vertices and q edges, then q ≤ 3n − 6. Furthermore, if equality holds, then every region is bounded by three edges.
1.5 Planarity
79
Proof. Again consider the sum C=
b(R).
R
As previously mentioned, C ≤ 2q. Further, since each region is bounded by at least 3 edges, we have that C ≥ 3r. Thus 3r ≤ 2q
⇒ 3(2 + q − n) ≤ 2q
⇒
q ≤ 3n − 6.
If equality holds, then 3r = 2q, and it must be that every region is bounded by three edges. We can use Theorem 1.33 to establish that K5 is nonplanar. Theorem 1.34. K5 is nonplanar. Proof. K5 has 5 vertices and 10 edges. Thus 3n − 6 = 9 < 10 = q, implying that K5 is nonplanar. Exercise 5 in Section 1.5.1 asked for a planar graph in which every vertex has degree exactly 5. This next result says that such a graph is an extreme example. Theorem 1.35. If G is a planar graph, then G contains a vertex of degree at most five. That is, δ(G) ≤ 5. Proof. Suppose G has n vertices and q edges. If n ≤ 6, then the result is immediate, so we will suppose that n > 6. If we let D be the sum of the degrees of the vertices of G, then we have D = 2q ≤ 2(3n − 6) = 6n − 12. If each vertex had degree 6 or more, then we would have D ≥ 6n, which is impossible. Thus there must be some vertex with degree less than or equal to 5. Exercises 1. G is a connected planar graph of order 24, and it is regular of degree 3. How many regions are in a planar representation of G? 2. Let G be a connected planar graph of order less than 12. Prove δ(G) ≤ 4. 3. Prove that Euler’s formula fails for disconnected graphs. 4. Let G be a connected, planar, K3 -free graph of order n ≥ 3. Prove that G has no more than 2n − 4 edges. 5. Prove that there is no bipartite planar graph with minimum degree at least 4.
80
1. Graph Theory
6. Let G be a planar graph with k components. Prove that n − q + r = 1 + k. 7. Let G be of order n ≥ 11. Show that at least one of G and G is nonplanar. 8. Show that the average degree (see Exercise 11 in Section 1.3.2) of a planar graph is less than six. 9. Prove that the converse of Theorem 1.33 is not true. 10. Find a 4-regular planar graph, and prove that it is unique. 11. A planar graph G is called maximal planar if the addition of any edge to G creates a nonplanar graph. (a) Show that every region of a maximal planar graph is a triangle. (b) If a maximal planar graph has order n, how many edges and regions does it have?
1.5.3 Regular Polyhedra We are usually convinced more easily by reasons we have found ourselves than by those which have occurred to others. — Blaise Pascal, Pens´ees A polyhedron is a solid that is bounded by flat surfaces. Dice, bricks, pyramids, and the famous dome at Epcot Center in Florida are all examples of polyhedra. Polyhedra can be associated with graphs in a very natural way. Think of the polyhedra as having faces, edges, and corners (or vertices). The vertices and edges of the solid make up its skeleton, and the skeleton can be viewed as a graph. An interesting property of these skeleton graphs is that they are planar. One way to see this is to imagine taking hold of one of the faces and stretching it so that its edges form the boundary of the exterior region of the graph. The regions of these planar representations directly correspond to the faces of the polyhedra. Figure 1.81 shows a brick-shaped polyhedron, its associated graph, and a planar representation of the graph.
FIGURE 1.81. A polyhedron and its graph.
Because of the natural correspondence, we are able to apply some of what we know about planar graphs to polyhedra. The next theorem follows directly from Euler’s Formula for planar graphs, Theorem 1.31.
1.5 Planarity
81
Theorem 1.36. If a polyhedron has V vertices, E edges, and F faces, then V − E + F = 2. This next theorem is similar to Theorem 1.35. Given a polyhedron P , define ρ(P ) to be ρ(P ) = min{b(R) | R is a region of P }. Theorem 1.37. For all polyhedra P , 3 ≤ ρ(P ) ≤ 5. Proof. Since one or two edges can never form a boundary, we know that ρ(P ) ≥ 3 for all polyhedra P . So we need to prove only the upper bound. Let P be a polyhedron and let G be its associated graph. Suppose P has V vertices, E edges, and F faces. For each k, let Vk be the number of vertices of degree k, and let Fk be the number of faces of P (or regions of G) of bound degree k. From our earlier remarks, if k < 3, then Vk = Fk = 0. Since every edge of P touches exactly two vertices and exactly two faces, we find that
kVk = 2E = kFk . k≥3
k≥3
If every face of P were bounded by 6 or more edges, then we would have
2E = kFk ≥ 6Fk = 6 Fk = 6F, k≥3
k≥6
k≥6
implying that E ≥ 3F . Furthermore,
kVk ≥ 3V, 2E = k≥3
implying that V ≤ 23 E. Thus E =V +F −2≤
1 2 E + E − 2 = E − 2, 3 3
and this, of course, is a contradiction. Therefore, some face of P is bounded by fewer than 6 edges. Hence, ρ(P ) ≤ 5. We now apply this result to derive a geometric fact known to the ancient Greeks. A regular polygon is one that is equilateral and equiangular. We say a polyhedron is regular if its faces are mutually congruent, regular polygons and if the number of faces meeting at a vertex is the same for every vertex. The cube, whose faces are congruent squares, and the tetrahedron, whose faces are congruent equilateral triangles, are regular polyhedra. A fact that has been known for at least 2000 years is that there are only five regular polyhedra: the tetrahedron, the cube, the octahedron, the dodecahedron, and the icosahedron (see Figure 1.82). We can use a graph-theoretic argument to prove this.
82
1. Graph Theory
Tetrahedron
Cube
Octahedron
Dodecahedron
Icosahedron
FIGURE 1.82. The five regular polyhedra and their graphical representations.
Theorem 1.38. There are exactly five regular polyhedra. Proof. Let P be a regular polyhedron, and let G be its associated planar graph. Let V , E, and F be the number of vertices, edges, and faces (regions) of P . Since the faces of P are congruent, each is bordered by the same number of edges, say k. Theorem 1.37 tells us that 3 ≤ k ≤ 5. Further, since the polyhedron P is regular, it follows that the graph G is also regular. Let us say that G is regular of degree r where r ≥ 3. From Theorem 1.37, we obtain rV = 2E = kF . Now, Theorem 1.36 implies that 8 = 4V − 4E + 4F = 4V − 2E + 4F − 2E = 4V − rV + 4F − kF = (4 − r)V + (4 − k)F.
1.5 Planarity
83
V and E are of course both positive, and since 3 ≤ k ≤ 5 and r ≥ 3, there are only five possible cases. Case 1. Suppose r = 3 and k = 3. In this case, V = F and 8 = V + F , implying that V = F = 4. This is the tetrahedron. (The fact that the tetrahedron is the only regular polygon with V = F = 4 is based on a geometrical argument. This applies to the remaining four cases as well.) Case 2. Suppose r = 3 and k = 4. Here we have V = 8 and 3V = 4F . Thus F = 6, and P is a cube. Case 3. Suppose r = 3 and k = 5. In this case we have 8 = V − F and 3V = 5F . Solving this system yields V = 20 and F = 12. This is a dodecahedron. Case 4. Suppose r = 4 and k = 3. Here we have F = 8 and 4V = 3F . Thus V = 6 and P is an octahedron. Case 5. Suppose r = 5 and k = 3. In this case we have 8 = −V + F and 5V = 3F . Solving this system yields V = 12 and F = 20. This is an icosahedron. Exercises 1. (From [52].) Show that the octahedron is a complete multipartite graph: Kr1 ,...,rn for some n and for some values r1 , . . . , rn . 2. Find an example of a polyhedron different from the ones discussed in this section. Sketch the polyhedron, and draw the associated graph. 3. See if you can find an alternative proof (not necessarily graph-theoretic) of the fact that there are only five regular polyhedra.
1.5.4 Kuratowski’s Theorem . . . a pair so famous. — William Shakespeare, Anthony and Cleopatra Our goal in this section is to compile a list of all nonplanar graphs. Since the list will be infinite (and since this book is not), we will make use of a clever characterization due to Kuratowski. We have already established that both K3,3 and K5 are nonplanar, so we should put them at the top of our list. What other graphs should we include? Suppose G is a graph that contains K3,3 as a subgraph. This graph G would have to be nonplanar, since a planar representation of it would have to contain a planar representation of K3,3 . So we can add to our list of nonplanar graphs all graphs that contain K3,3 or K5 as a subgraph. The graph in Figure 1.83 shows us that our list of nonplanar graphs is not yet complete. This graph is not planar, but it does not contain K5 or K3,3 as a subgraph. Of course, if we were to replace the two edges labeled a and b with a single edge e, then the graph would contain K5 as a subgraph. This motivates the following definition.
84
1. Graph Theory a
b
FIGURE 1.83.
Let G be a graph. A subdivision of an edge e in G is a substitution of a path for e. We say that a graph H is a subdivision of G if H can be obtained from G by a finite sequence of subdivisions. For example, the graph in Figure 1.83 contains a subdivision of K5 , and in Figure 1.84, H is a subdivision of G. G
H
FIGURE 1.84. A graph and a subdivision.
We leave the proof of the following theorem to the exercises (see Exercise 1). Theorem 1.39. A graph G is planar if and only if every subdivision of G is planar. Our list of nonplanar graphs now includes K3,3 , K5 , graphs containing K3,3 or K5 as subgraphs, and all graphs containing a subdivision of K3,3 or K5 . The list so far stems from only two specific graphs: K3,3 and K5 . A well-known theorem by Kuratowski [185] tells us that there are no other graphs on the list! The bottom line is that K3,3 and K5 are the only two real enemies of planarity. Kuratowski proved this beautiful theorem in 1930, closing a long-open problem.14 In 1954, Dirac and Schuster [78] found a proof that was slightly shorter than the original proof, and theirs is the proof that we will outline here. Theorem 1.40 (Kuratowski’s Theorem). A graph G is planar if and only if it contains no subdivision of K3,3 or K5 . Sketch of Proof We have already discussed that if a graph G is planar, it contains no subgraph that is a subdivision of K3,3 or K5 . Thus we need to discuss only the reverse direction of the theorem. 14 We should note here that Frink and Smith also discovered a proof of this fact in 1930, independently of Kuratowski. Since Kuratowski’s result was published first, his name has traditionally been associated with the theorem (and the names Frink and Smith have traditionally been associated with footnotes like this one.)
1.6 Colorings
85
Suppose G is a graph that contains no subdivision of K3,3 or K5 . Here are the steps that Dirac and Schuster used to prove the result. 1. Prove that G is planar if and only if each block of G is planar. (A block of G is a maximal connected subgraph of G that has no cut vertex). 2. Explain why it suffices to show that a block is planar if and only if it contains no subdivision of K3,3 or K5 . Assume that G is a block itself (connected with no cut vertex). 3. Suppose that G is a nonplanar block that contains no subdivision of K3,3 or K5 (and search for a contradiction). 4. Prove that δ(G) ≥ 3. 5. Establish the existence of an edge e = uv such that the graph G − e is also a block. 6. Explain why G− e is a planar graph containing a cycle C that includes both u and v, and choose C to have a maximum number of interior regions. 7. Establish several structural facts about the subgraphs inside and outside the cycle C. 8. Use these structural facts to demonstrate the existence of subdivisions of K3,3 or K5 , thus establishing the contradiction. Exercises 1. Prove that a graph G is planar if and only if every subdivision of G is planar. 2. Use Kuratowski’s Theorem to prove that the Petersen graph (Figure 1.63) is nonplanar. 3. Prove the first step of the proof of Kuratowski’s Theorem. 4. Determine all complete multipartite graphs (of the form Kr1 ,...,rn ) that are planar.
1.6 Colorings One fish, two fish, red fish, blue fish. — Dr. Seuss The senators in a particular state sit on various senate committees, and the committees need to schedule times for meetings. Since each senator must be present at each of his or her committee meetings, the meeting times need to be scheduled carefully. One could certainly assign a unique meeting time to each of the
86
1. Graph Theory
committees, but this plan may not be feasible, especially if the number of committees is large. We ask ourselves, given a particular committee structure, what is the fewest number of meeting times that are required? We can answer this question by studying graph coloring.
1.6.1 Definitions Given a graph G and a positive integer k, a k-coloring is a function K : V (G) → {1, . . . , k} from the vertex set into the set of positive integers less than or equal to k. If we think of the latter set as a set of k “colors,” then K is an assignment of one color to each vertex. We say that K is a proper k-coloring of G if for every pair u, v of adjacent vertices, K(u) = K(v) — that is, if adjacent vertices are colored differently. If such a coloring exists for a graph G, we say that G is k-colorable. For example, the graph C5 as shown in Figure 1.85 is 3-colorable: P (a) = P (c) = 1, P (b) = P (d) = 2, P (c) = 3. Since C5 is 3-colorable, a direct
a e
b d
c
FIGURE 1.85. C5 is 3-colorable.
consequence of the definition is that C5 is k-colorable for all k ≥ 3. Is C5 2colorable? Another way of viewing a proper k-coloring is as an assignment of vertices to sets, called color classes, where each set represents vertices that all receive the same color. For the coloring to be proper, each color class must be an independent set of vertices. It is natural to wonder how many colors are necessary to color a particular graph G. For instance, we know that three colors are enough for the graph in Figure 1.85, but is this the least required? A quick check of C5 reveals that coloring with two colors is impossible. So three colors are necessary. This idea motivates a definition. Given a graph G, the chromatic number of G, denoted by χ(G), is the smallest integer k such that G is k-colorable. In our example, we can say that χ(C5 ) = 3. What about odd cycles in general? (Try one!) What about even cycles? (Try one!) Here is a list of chromatic numbers for some common graphs. Verify them! 2 if n is even, χ(Cn ) = 3 if n is odd,
1.6 Colorings
χ(Pn ) =
2 1
87
if n ≥ 2, if n = 1,
χ(Kn ) = n, χ(En ) = 1, χ(Km,n ) = 2.
Exercises 1. Find the chromatic number of each of the following graphs. Explain your answers completely. (a) Trees. (b) Bipartite graphs. (c) Complete multipartite graphs, Kr1 ,r2 ,...,rt . (d) The Petersen Graph. (e) The graph in Figure 1.86, called the Birkhoff Diamond. (f) The graphs of the regular polyhedra in Figure 1.82.
FIGURE 1.86. The Birkhoff Diamond.
2. Senate committees C1 through C7 consist of the members as indicated: C1 = {Adams, Bradford, Charles}, C2 = {Charles, Davis, Eggers}, C3 = {Davis, Ford}, C4 = {Adams, Gardner}, C5 = {Eggers, Howe}, C6 = {Eggers, Bradford, Gardner}, C7 = {Howe, Charles, Ford}. Use the ideas of this section to determine the fewest number of meeting times that need to be scheduled for these committees. 3. When issuing seating assignments for his third grade students, the teacher wants to be sure that if two students might interfere with one another, then they are assigned to different areas of the room. There are six main troublemakers in the class: John, Jeff, Mike, Moe, Larry, and Curly. How many different areas are required in the room if John interferes with Moe and
88
1. Graph Theory
Curly; Jeff interferes with Larry and Curly; Mike interferes with Larry and Curly; Moe interferes with John, Larry, and Curly; Larry interferes with Jeff, Mike, Moe, and Curly; and Curly interferes with everyone? 4. Prove that adding an edge to a graph increases its chromatic number by at most one. 5. Prove that a graph G of order at least two is bipartite if and only if it is 2-colorable. 6. A graph G is called k-critical if χ(G) = k and χ(G − v) < k for each vertex v of G. (a) Find all 1-critical and 2-critical graphs. (b) Give an example of a 3-critical graph. (c) If G is k-critical, then show that G is connected. (d) If G is k-critical, then show that δ(G) ≥ k − 1. (e) Find all of the 3-critical graphs. Hint: Use part (d).
1.6.2 Bounds on Chromatic Number The point is, ladies and gentlemen, that greed, for lack of a better word, is good. Greed is right. Greed works. — Gordon Gekko, in Wall Street In general, determining the chromatic number of a graph is hard. While small or well-known graphs (like the ones in the previous exercises) may be fairly easy, the number of possibilities in large graphs makes computing chromatic numbers difficult. We therefore often rely on bounds to give some sort of idea of what the chromatic number of a graph is, and in this section we consider some of these bounds. If G is a graph on n vertices, then an obvious upper bound on χ(G) is n, since an n-coloring is always possible on a graph with n vertices. This bound is exact for complete graphs, as it takes as many colors as there are vertices to color a complete graph. In fact, complete graphs are the only graphs for which this bound is sharp (see Exercise 5). We set this aside as Theorem 1.41. Theorem 1.41. For any graph G of order n, χ(G) ≤ n. Let us now discuss a very basic graph coloring algorithm, the greedy algorithm. To color a graph having n vertices using this algorithm, first label the vertices in some order—call them v1 , v2 , . . . , vn . Next, order the available colors in some way. We will denote them by the positive integers 1, 2, . . . , n. Then start coloring by assigning color 1 to vertex v1 . Next, if v1 and v2 are adjacent, assign color 2 to vertex v2 ; otherwise, use color 1 again. In general, to color vertex vi , use
1.6 Colorings
89
the first available color that has not been used for any of vi ’s previously colored neighbors. For example, the greedy algorithm produces the coloring on the right from the graph on the left in Figure 1.87. First, v1 is assigned color 1; then v2 is assigned color 1, since v2 is not adjacent to v1 . Then v3 is assigned color 1 since it is not adjacent to v1 or v2 . Vertex v4 is assigned color 2, then v5 is assigned 2, and finally v6 is assigned 2.
v1
v4
v2
1
2
1
v5
v3
v6
2
1
2
FIGURE 1.87. Applying the greedy algorithm.
It is important to realize that the coloring obtained by the greedy algorithm depends heavily on the initial labeling of the vertices. Different labelings can (and often do) produce different colorings. Figure 1.88 displays the coloring obtained from a different original labeling of the same graph. More colors are used in this
v2
v3
v5
1
2
3
v6
v4
v1
1
3
1
FIGURE 1.88. Applying it again.
second coloring. We see that while “greed works” in that the algorithm always gives a legal coloring, we cannot expect it to give us a coloring that uses the fewest possible colors. The following bound improves Theorem 1.41. Theorem 1.42. For any graph G, χ(G) ≤ Δ(G) + 1, where Δ(G) is the maximum degree of G. Proof. Running the greedy algorithm on G produces a legal coloring that uses at most Δ(G) + 1 colors. This is because every vertex in the graph is adjacent to at most Δ(G) other vertices, and hence the largest color label used is at most Δ(G) + 1. Thus, χ(G) ≤ Δ(G) + 1. Notice that we obtain equality in this bound for complete graphs and for cycles with an odd number of vertices. As it turns out, these are the only families of graphs for which the equality in Theorem 1.42 holds. This is stated in Brooks’s
90
1. Graph Theory
Theorem [41]. The proof that we give is a modification of the one given by Lov´asz [190]. Theorem 1.43 (Brooks’s Theorem). If G is a connected graph that is neither an odd cycle nor a complete graph, then χ(G) ≤ Δ(G). Proof. Let G be a connected graph of order n that is neither a complete graph nor an odd cycle. Let k = Δ(G). We know that k = 0 and k = 1, since otherwise G is complete. If k = 2, then G must be either an even cycle or a path. In either case, χ(G) = 2 = Δ(G). So assume that k = Δ(G) ≥ 3. We are now faced with three cases. In each case we will establish a labeling of the vertices of G in the form v1 , v2 , . . . , vn . We will then use the greedy algorithm to color G with no more than k colors. Case 1. Suppose that G is not k-regular. Then there exists some vertex with degree less than k. Choose such a vertex and call it vn . Let S0 = {vn } and let S1 = N (vn ), the neighborhood of vn . Further, let S2 = N (S1 ) − {vn } − S1 , S3 = N (S2 ) − S1 − S2 , .. . Si = N (Si−1 ) − Si−2 − Si−1 , for each i (Figure 1.89). Since G is finite, there is some t such that St is not empty, S1
S2
vn
FIGURE 1.89. The sets Si .
and Sr is empty for all r > t. Next, label the vertices in S1 with the labels vn−1 , vn−2 , . . . , vn−|S1 | . Label the vertices in S2 with the labels vn−|S1 |−1 , . . . , vn−|S1 |−|S2 | . Continue labeling in this decreasing fashion until all vertices of G have been labeled. The vertex with label v1 is in the set St . Let u be a vertex in some Si , i ≥ 1. Since u has at least one neighbor in Si−1 , it has at most k − 1 adjacencies with vertices whose label is less than its own. Thus, when the greedy algorithm gets to u, there will be at least one color from {1, 2, . . . , k} available. Further, since deg(vn ) < k, there will be a color from {1, 2, . . . , k} available when the greedy algorithm reaches vn . Thus, in this case the greedy algorithm uses at most k colors to properly color G.
1.6 Colorings
91
Case 2. Suppose that G is k-regular and that G has a cut vertex, say v. The removal of v from G will form at least two connected components. Say the components are G1 , G2 , . . . , Gt . Consider the graph H1 = G1 ∪ {v} (the component G1 with v added back—see Figure 1.90). H1 is a connected graph, and the degree
G2 Gt
G1 v
H1 FIGURE 1.90. The graph H1 .
of v in H is less than k. Using the method in Case 1, we can properly color H1 with at most k colors. Similarly, we can properly color each Hi = Gi − {v} with at most k colors. Without loss of generality, we can assume that v gets the same color in all of these colorings (if not, just permute the colors to make it so). These colorings together create a proper coloring of G that uses at most k colors. Case 2 is complete. Case 3. Suppose that G is k-regular and that it does not contain a cut vertex. This means that G is 2-connected. Subcase 3a. Suppose that G is 3-connected. This means that for all v, the graph G − v is 2-connected. Let v be a vertex of G with neighbors v1 and v2 such that v1 v2 ∈ E(G) (such vertices exist since G is not complete). By the assumption in this subcase, the graph G − {v1 , v2 } is connected. Subcase 3b. Suppose that G is not 3-connected. This means that there exists a pair of vertices v, w such that the graph G − {v, w} is disconnected. Let the components of G − {v, w} be G1 , G2 , . . . , Gt . Since k ≥ 3, it must be that each Gi has at least two vertices. It also must be that v is adjacent to at least one vertex in each Gi , since w is not a cut vertex of G. Let u ∈ V (G1 ) be a neighbor of v. Suppose for the moment that u is a cut vertex of the graph G − v. If this is the case, then there must be another vertex y of G1 such that (i) y is not a cut vertex of the graph G − v, and (ii) the only paths from y to w in G − v go through vertex u. Since u is not a cut vertex of G itself, it must be that y is adjacent to v. In either case, it must be that v has a neighbor in G1 (either u or y) that is not a cut vertex of G − v. The vertex v has a similar such neighbor in G2 . For convenience, let us rename: For i = 1, 2, let vi ∈ V (Gi ) be a neighbor of v that is not a cut vertex of the graph G − v. Vertices v1 and v2 are nonadjacent, and since they were in different components of G − {v, w}, it must be that G − {v1 , v2 } is connected. In each subcase, we have identified vertices v, v1 , and v2 such that vv1 , vv2 ∈ E(G), v1 v2 ∈ E(G), and G − {v1 , v2 } is connected. We now proceed to label the vertices of G in preparation for the greedy algorithm.
92
1. Graph Theory
Let v1 and v2 be as labeled. Let v be labeled vn . Now choose a vertex adjacent to vn that is not v1 or v2 (such a vertex exists, since deg(vn ) ≥ 3). Label this vertex vn−1 . Next choose a vertex that is adjacent to either vn or vn−1 and is not v1 , v2 , vn , or vn−1 . Call this vertex vn−2 . We continue this process. Since G − {v1 , v2 } is connected, then for each i ∈ {3, . . . , n − 1}, there is a vertex vi ∈ V (G) − {v1 , v2 , vn , vn−1 , . . . , vi+1 } that is adjacent to at least one of vi+1 , . . . , vn . Now that the vertices are labeled, we can apply the greedy algorithm. Since v1 v2 ∈ E(G), the algorithm will give the color 1 to both v1 and v2 . Since each vi , 3 ≤ i < n, is adjacent to at most k − 1 predecessors, and since vn is adjacent to v1 and v2 , the algorithm never requires more than k = Δ(G) colors. Case 3 is complete. The next bound involves a new concept. The clique number of a graph, denoted by ω(G), is defined as the order of the largest complete graph that is a subgraph of G. For example, in Figure 1.91, ω(G1 ) = 3 and ω(G2 ) = 4.
G1
G2 FIGURE 1.91. Graphs with clique numbers 3 and 4, respectively.
A simple bound that involves clique number follows. We leave it to the reader to provide a (one or two line) explanation. Theorem 1.44. For any graph G, χ(G) ≥ ω(G). It is natural to wonder whether we might be able to strengthen this theorem and prove that χ(G) = ω(G) for every graph G. Unfortunately, this is false. Consider the graph G shown in Figure 1.92. The clique number of this graph is 5, and the
FIGURE 1.92. Is χ(G) = ω(G)?
1.6 Colorings
93
chromatic number is 6 (see Exercise 2). The upper and lower bounds given in Theorem 1.45 concern α(G), the independence number of G, defined back in Section 1.4.3. The proofs are left as an exercise (see Exercise 6). Theorem 1.45. For any graph G of order n, n ≤ χ(G) ≤ n + 1 − α(G). α(G) Exercises 1. Recall that avgdeg(G) denotes the average degree of vertices in G. Prove or give a counterexample to the following statement: χ(G) ≤ 1 + avgdeg(G). 2. If G is the graph in Figure 1.92, prove that χ(G) = 6 and ω(G) = 5. 3. Determine a necessary and sufficient condition for a graph to have a 2colorable line graph. 4. Recall that τ (G) denotes the number of vertices in a detour path (a longest path) of G, prove that χ(G) ≤ τ (G). 5. Prove that the only graph G of order n for which χ(G) = n is Kn . 6. Prove that for any graph G of order n, n ≤ χ(G) ≤ n + 1 − α(G). α(G) 7. If G is bipartite, prove that ω(G) = χ(G). 8. Let G be a graph of order n. Prove that (a) n ≤ χ(G)χ(G); √ (b) 2 n ≤ χ(G) + χ(G).
1.6.3 The Four Color Problem That doesn’t sound too hard. — Princess Leia, Star Wars The Four Color Problem. Is it true that the countries on any given map can be colored with four or fewer colors in such a way that adjacent countries are colored differently?
94
1. Graph Theory
The seemingly simple Four Color Problem was introduced in 1852 by Francis Guthrie, a student of Augustus DeMorgan. The first written reference to the problem is a letter from DeMorgan to Sir William Rowan Hamilton. Despite Hamilton’s indifference15, DeMorgan continued to talk about the problem with other mathematicians. In the years that followed, many of the world’s top mathematical minds attempted either to prove or disprove the conjecture, and in 1879 Alfred Kempe announced that he had found a proof. In 1890, however, P. J. Heawood discovered an error in Kempe’s proof. Kempe’s work did have some positive features, though, for Heawood made use of Kempe’s ideas to prove that five colors always suffice. In this section, we translate the Four Color Problem into a graph theory problem, and we prove the Five Color Theorem. Any map can be represented by a planar graph in the following way: Represent each country on the map by a vertex, and connect two vertices with an edge whenever the corresponding countries share a nontrivial border (more than just a point). Some examples are shown in Figure 1.93.
FIGURE 1.93. Graph representations of maps.
The regions on the map correspond to vertices on the graph, so a graph coloring yields a map coloring with no bordering regions colored the same. This natural representation allows us to see that a map is 4-colorable if and only if its associated graph is 4-colorable. The Four Color Conjecture is equivalent to the following statement. A thorough discussion of this equivalence can be found in [52]. 15 Perhaps he was too busy perfecting plans for a cool new game that he would release a few years later. See Section 1.4.3.
1.6 Colorings
95
Theorem 1.46 (Four Color Theorem). Every planar graph is 4-colorable. When Heawood pointed out the error in Kempe’s proof, researchers flocked back to the drawing board. People worked on the Four Color Problem for years and years trying numerous strategies. Finally, in 1976, Kenneth Appel and Wolfgang Haken, with the help of John Koch, announced that they had found a proof [12]. To complete their proof, they verified thousands of cases with computers, using over 1000 hours of computer time. As you might imagine, people were skeptical of this at first. Was this really a proof? How could an argument with so many cases be verified? While the Appel–Haken proof is accepted as being valid, mathematicians still search for alternative proofs. Robertson, Sanders, Seymour, and Thomas [239] have probably come the closest to finding a short and clever proof, but theirs still requires a number of computer calculations. In a 1998 article [267], Robin Thomas said the following. For the purposes of this survey, let me telescope the difficulties with the A&H proof into two points: (1) part of the proof uses a computer and cannot be verified by hand, and (2) even the part that is supposedly hand-checkable has not, as far as I know, been independently verified in its entirety. . . . Neil Robertson, Daniel P. Sanders, Paul Seymour, and I tried to verify the Appel–Haken proof, but soon gave up and decided that it would be more profitable to work out our own proof. . . . We were not able to eliminate reason (1), but we managed to make progress toward (2). As mentioned earlier, Heawood [156] provided a proof of the Five Color Theorem in the late 1890s, and we present his proof here. Some of the ideas in his proof came from Kempe’s attempt [174] to solve the Four Color Problem. Theorem 1.47 (Five Color Theorem). Every planar graph is 5-colorable. Proof. We induct on the order of G. Let G be a planar graph of order n. If n ≤ 5, then the result is clear. So suppose that n ≥ 6 and that the result is true for all planar graphs of order n − 1. From Theorem 1.35, we know that G contains a vertex, say v, having deg(v) ≤ 5. Consider the graph G obtained by removing from G the vertex v and all edges incident with v. Since the order of G is n − 1 (and since G is of course planar), we can apply the induction hypothesis and conclude that G is 5-colorable. Now, we can assume that G has been colored using the five colors, named 1, 2, 3, 4, and 5. Consider now the neighbors of v in G. As noted earlier, v has at most five neighbors in G, and all of these neighbors are vertices in (the already colored) G . If in G fewer than five colors were used to color these neighbors, then we can properly color G by using the coloring for G on all vertices other than v, and by coloring v with one of the colors that is not used on the neighbors of v. In doing this, we have produced a 5-coloring for G.
96
1. Graph Theory
So, assume that in G exactly five of the colors were used to color the neighbors of v. This implies that there are exactly five neighbors, call them w1 , w2 , w3 , w4 , w5 , and assume without loss of generality that each wi is colored with color i (see Figure 1.94). 1
w1 5
v
w5 w4
4
2
w2
3
w3
FIGURE 1.94.
We wish to rearrange the colors of G so that we make a color available for v. Consider all of the vertices of G that have been colored with color 1 or with color 3. Case 1. Suppose that in G there does not exist a path from w1 to w3 where all of the colors on the path are 1 or 3. Define a subgraph H of G to be the union of all paths that start at w1 and that are colored with either 1 or 3. Note that w3 is not a vertex of H and that none of the neighbors of w3 are in H (see Figure 1.95). 1 1
1 3
3
3 w1 1
FIGURE 1.95.
Now, interchange the colors in H. That is, change all of the 1’s into 3’s and all of the 3’s into 1’s. The resulting coloring of the vertices of G is a proper coloring, because no problems could have possibly arisen in this interchange. We now see that w1 is colored 3, and thus color 1 is available to use for v. Thus, G is 5-colorable. Case 2. Suppose that in G there does exist a path from w1 to w3 where all of the colors on the path are 1 or 3. Call this path P . Note now that P along with v forms a cycle that encloses either w2 or w4 (Figure 1.96).
1.6 Colorings 1
w5 w4
w1 v
1
3
3
3
1
1
w2
1 3
w5
w3 3
1
3
1
w1
w2
v
or
w3
w4 3
97
1
3 1
3
FIGURE 1.96. Two possibilities.
So there does not exist a path from w2 to w4 where all of the colors on the path are 2 or 4. Thus, the reasoning in Case 1 applies! We conclude that G is 5-colorable. Exercises 1. Determine the chromatic number of the graph of the map of the United States. 2. Determine the chromatic number of the graph of the map of the countries of South America. 3. Determine the chromatic number of the graph of the map of the countries of Africa. 4. Determine the chromatic number of the graph of the map of the countries of Australia. Hint: This graph will be quite small! 5. Where does the proof of the Five Color Theorem go wrong for four colors?
1.6.4 Chromatic Polynomials Everything should be made as simple as possible, but not simpler. — Albert Einstein Chromatic polynomials, developed by Birkhoff in the early 1900s as he studied the Four Color Problem, provide us with a method of counting the number of different colorings of a graph. Before we introduce the polynomials, we should clarify what we mean by different colorings. Given a graph G, suppose that its vertices are labeled v1 , v2 , . . . vn . A coloring of G is an assignment of colors to these vertices, and we call two colorings C1 and C2 different if at least one vi receives a different color in C1 than it does in C2 . For instance, the two colorings of K4 shown in Figure 1.97 are considered different, since v3 and v4 receive different colorings.
98
1. Graph Theory
red
blue
v1 v3
green
red
v2
v1
v4
v3
white
white
blue
v2 v4
green
FIGURE 1.97. Two different colorings.
If we restrict ourselves to four colors, how many different colorings are there of K4 ? Since there are four choices for v1 , then three for v2 , etc., we see that there are 4 · 3 · 2 · 1 different colorings of K4 using four colors. If six colors were available, there would be 6 · 5 · 4 · 3 different colorings. If only two were available, there would be no proper colorings of K4 . In general, define cG (k) to be the number of different colorings of a graph G using at most k colors. So we have cK4 (4) = 24, cK4 (6) = 360, and cK4 (2) = 0. In fact, if k and n are positive integers where k ≥ n, then cKn (k) = k(k − 1)(k − 2) · · · (k − n + 1). Further, if k < n, then cKn (k) = 0. We also note that cEn (k) = k n for all positive integers k and n. A simple but important property of cG (k) is that G is k-colorable if and only if cG (k) > 0. Equivalently, cG (k) > 0 if and only if χ(G) ≤ k. Finding values of cG (k) is relatively easy for some well-known graphs. Computing this function in general, though, can be hard. Birkhoff and Lewis [27] developed a way to reduce this hard problem to an easier one. Before we see their method, we need a definition. Let G be a graph and let e be an edge of G. Recall that G − e denotes the graph where e is removed from G. Define the graph G/e to be the graph obtained from G by removing e, identifying the end vertices of e, and leaving only one copy of any resulting multiple edges. As an example, a graph G and the graphs G − bc and G/bc are shown in Figure 1.98. Theorem 1.48. Let G be a graph and e be any edge of G. Then cG (k) = cG−e (k) − cG/e (k). Proof. Suppose that the end vertices of e are u and v, and consider the graph G − e. How many k-colorings are there of G − e where u and v are assigned the same color? If C is a such a coloring of G − e, then C can be thought of as a coloring of G/e, since u and v are colored the same. Similarly, any coloring of G/e can also be thought of as a coloring of G − e where u and v are colored the same. Thus, the answer to this question is cG/e (k).
1.6 Colorings
G
G - bc a
w z
w c
b
a b
c
x
y
G / bc y
z
a w
x
99
z
b&c x
y
FIGURE 1.98. Examples of the operations.
Now, how many k-colorings are there of G − e where u and v are assigned different colors? If C is a such a coloring of G − e, then C can be considered as a coloring of G, since u and v are colored differently. Similarly, any coloring of G can also be thought of as a coloring of G−e where u and v are colored differently. Thus, the answer to this second question is cG (k). Thus, the total number of k-colorings of G − e is cG−e (k) = cG/e (k) + cG (k), and the result follows. For example, suppose we want to find cP4 (k). That is, how many ways are there to color the vertices of P4 with k colors available? We label the edges of P4 as shown in Figure 1.99.
P4
e1
e2
e3
FIGURE 1.99. The labeled edges of P4 .
The theorem implies that cP4 (k) = cP4 −e1 (k) − cP4 /e1 (k). For convenience, let us denote P4 − e1 and P4 /e1 by G11 and G12 , respectively (see Figure 1.100).
G11
e2
e3
G12
FIGURE 1.100. The first application.
e2
e3
100
1. Graph Theory
Applying the theorem again, we obtain cP4 (k) = cG11 −e2 (k) − cG11 /e2 (k) − cG12 −e2 (k) + cG12 /e2 (k). Denote the graphs G11 − e2 , G11 /e2 , G12 − e2 , and G12 /e2 by G21 , G22 , G23 , and G24 , respectively (see Figure 1.101).
G21
G23
e3 G22
e3 G24
e3
e3
FIGURE 1.101. The second application.
Applying the theorem once more yields cP4 (k) = cG21 −e3 (k) − cG21 /e3 (k) − cG22 −e3 (k) + cG22 /e3 (k) − cG23 −e3 (k) + cG23 /e3 (k) + cG24 −e3 (k) − cG24 /e3 (k). That is, cP4 (k) = cE4 (k)−cE3 (k)−cE3 (k)+cE2 (k)−cE3 (k)+cE2 (k)+cE2 (k)−cE1 (k). Thus,
cP4 (k) = k 4 − k 3 − k 3 + k 2 − k 3 + k 2 + k 2 − k = k 4 − 3k 3 + 3k 2 − k.
We should check a couple of examples. How many colorings of P4 are there with one color? cP4 (1) = 14 − 3(1)3 + 3(1)2 − 1 = 0. This, of course, makes sense. And how many colorings are there with two colors? cP4 (2) = 24 − 3(2)3 + 3(2)2 − 2 = 2. Figure 1.102 shows these two colorings. Score one for Birkhoff! red
blue
red
blue
blue
red
blue
red
FIGURE 1.102. Two 2-colorings of P4 .
As you can see, chromatic polynomials provide a way to count colorings, and the Birkhoff–Lewis theorem allows you to reduce a problem to a slightly simpler one. We should note that it is not always necessary to work all the way down to empty graphs, as we did in the previous example. Once a graph G is obtained for which the value of cG (k) is known, there is no need to reduce that one further. We now present some properties of cG (k).
1.7 Matchings
101
Theorem 1.49. Let G be a graph of order n. Then 1. cG (k) is a polynomial in k of degree n, 2. the leading coefficient of cG (k) is 1, 3. the constant term of cG (k) is 0, 4. the coefficients of cG (k) alternate in sign, and 5. the absolute value of the coefficient of the k n−1 term is the number of edges in G. We leave the proof of this theorem as an exercise (Exercise 3). One proof strategy is to induct on the number of edges in G and use the Birkhoff–Lewis reduction theorem (Theorem 1.48). Before leaving this section, we should note that Birkhoff considered chromatic polynomials of planar graphs, and he hoped to find one of them that had 4 as a root. If he had found one, then the corresponding planar graph would not be 4colorable, and hence would be a counterexample to the Four Color Conjecture. Although he was unsuccessful in proving the Four Color Theorem, he still deserves credit for producing a very nice counting technique. Exercises 1. Find chromatic polynomials for each of the following graphs. For each one, determine how many 5-colorings exist. (a) K1,3 (b) K1,5 (c) C4 (d) C5 (e) K4 − e (f) K5 − e 2. Show that k 4 − 4k 3 + 3k 2 is not a chromatic polynomial for any graph. 3. Prove Theorem 1.49. 4. Determine the chromatic polynomial for a tree of order n.
1.7 Matchings Pardon me, do you have a match? — James Bond, in From Russia with Love
102
1. Graph Theory
The Senate committees that we discussed earlier need to form an executive council. Each committee needs to designate one of its members as an official representative to sit on the council, and council policy states that no senator can be the official representative for more than one committee. For example, let us suppose there are four committees: Senators A, B, C, and D are on Committee 1; Senators A, E, and F are members of Committee 2; Committee 3 consists of E, F , and D; and Senator A is the only member of Committee 4. In this example, the executive council could consist of A, E, F , and C—representing Committees 4, 3, 2, and 1, respectively. As another example, suppose Committee 1 consists of W , X and Y ; Committee 2 of W , X, and Z; Committee 3 of W , Y , and Z; Committee 4 of X, Y , and Z; and Committee 5 of W and Z. It does not take long to see that it is impossible in this case to select official representatives according to the policy. So a natural question arises: Under what circumstances can the executive council be formed successfully? In the sections that follow, we will see how graphs can be used to help answer this question.
1.7.1 Definitions And as to the meaning . . . — C. S. Calverly, Ballad A matching in a graph is a set of independent edges. That is, it is a set of edges in which no pair shares a vertex. Given a matching M in a graph G, the vertices belonging to the edges of M are said to be saturated by M (or M -saturated). The other vertices are M -unsaturated. Consider the graph G shown in Figure 1.103. An example of a matching in G is M1 = {ab, ce, df }. M2 = {cd, ab} is also a matching, and so is M3 = {df }. We can see that a, b, c, d are M2 -saturated and e, f , and g are M2 -unsaturated. The only M1 -unsaturated vertex is g. a c
b d
e
f
g
FIGURE 1.103. The matching M1 .
If a matching M saturates every vertex of G, then M is said to be a perfect matching. In Figure 1.104, G1 has a perfect matching, namely {ab, ch, de, f g}. None of G2 , G3 , and G4 has a perfect matching. Why is this? We will talk more about perfect matchings in Section 1.7.4. A maximum matching in a graph is a matching that has the largest possible cardinality. A maximal matching is a matching that cannot be enlarged by the
1.7 Matchings
G1
a
c
G2
h
G4
d
b g
f
103
G3
e
FIGURE 1.104. Only G1 has a perfect matching.
addition of any edge. In Figure 1.105, M1 = {ae, bf, cd, gh} is a maximum matching (since at most one of gh, gi, and gj can be in any matching). The matching M2 = {dg, af, bc} is maximal, but not maximum. a
b c e
d f
g
h i j
FIGURE 1.105.
Exercises 1. Determine whether the graph of Figure 1.106 has a perfect matching. If so, then exhibit it. If not, explain why.
FIGURE 1.106. Is there a perfect matching?
2. Find the minimum size of a maximal matching in each of the following graphs. (a) C10
104
1. Graph Theory
(b) C11 (c) Cn 3. (From [52].) The matching graph M (G) of a graph G has the maximum matchings of G as its vertices, and two vertices M1 and M2 of M (G) are adjacent if M1 and M2 differ in only one edge. Show that each cycle Cn , n = 3, 4, 5, or 6, is the matching graph of some graph.
1.7.2 Hall’s Theorem and SDRs I’ll match that! — Monty Hall, Let’s Make a Deal In this section we consider several classic results concerning matchings. We begin with a few more definitions. Given a graph G and a matching M , an M -alternating path is a path in G where the edges alternate between M -edges and non-M -edges. An M -augmenting path is an M -alternating path where both end vertices are M -unsaturated. As an example, consider the graph G and the matching M indicated in Figure 1.107. An example of an M -alternating path is c, a, d, e, i. An example of an M -augmenting path is j, g, f , a, c, b. The reason for calling such a path “M augmenting” will become apparent soon. c
b g
a
d
f
h
e i
j FIGURE 1.107. The graph G and matching M .
The following result is due to Berge [23]. Theorem 1.50 (Berge’s Theorem). Let M be a matching in a graph G. M is maximum if and only if G contains no M -augmenting paths. Proof. First, assume that M is a maximum matching, and suppose that P : v1 , v2 , . . . , vk is an M -augmenting path. Due to the alternating nature of M augmenting paths, it must be that k is even and that the edges v2 v3 , v4 v5 , . . . , vk−2 vk−1 are all edges of M . We also see that the edges v1 v2 , v3 v4 , . . . , vk−1 vk are not edges of M (Figure 1.108). But then if we define the set of edges M1 to be M1 = (M \ {v2 v3 , . . . , vk−2 vk−1 }) ∪ {v1 v2 , . . . , vk−1 vk },
1.7 Matchings
v1
v2
v3
v4
v5
v6
105
vk - 2 vk - 1 vk
FIGURE 1.108. An M -augmenting path.
then M1 is a matching that contains one more edge than M , a matching that we assumed to be maximum. This is a contradiction, and we can conclude that G contains no M -augmenting paths. For the converse, assume that G has no M -augmenting paths, and suppose that M is a matching that is larger than M . Define a subgraph H of G as follows: Let V (H) = V (G) and let E(H) be the set of edges of G that appear in exactly one of M and M . Now consider some properties of this subgraph H. Since each of the vertices of G lies on at most one edge from M and at most one edge from M , it must be that the degree (in H) of each vertex of H is at most 2. This implies that each connected component of H is either a single vertex, a path, or a cycle. If a component is a cycle, then it must be an even cycle, since the edges alternate between M -edges and M -edges. So, since |M | > |M |, there must be at least one component of H that is a path that begins and ends with edges from M . But this path is an M -augmenting path, contradicting our assumption. Therefore, no such matching M can exist—implying that M is maximum. Before we see Hall’s classic matching theorem, we need to define one more term. If G is a bipartite graph with partite sets X and Y , we say that X can be matched into Y if there exists a matching in G that saturates the vertices of X. Consider the two examples in Figure 1.109. In the bipartite graph on the left,
X
Y
X
Y
FIGURE 1.109.
we see that X can be matched into Y . In the graph on the right, though, it is impossible to match X into Y (why is this?). What conditions on a bipartite graph must exist if we want to match one partite set into the other? The answer to this question is found in the following result of Hall [147] (Philip, not Monty). Recall that the neighborhood of a set of vertices S, denoted by N (S), is the union of the neighborhoods of the vertices of S.
106
1. Graph Theory
Theorem 1.51 (Hall’s Theorem). Let G be a bipartite graph with partite sets X and Y . X can be matched into Y if and only if |N (S)| ≥ |S| for all subsets S of X. Proof. First suppose that X can be matched into Y , and let S be some subset of X. Since S itself is also matched into Y , we see immediately that |S| ≤ |N (S)| (see Figure 1.110). Now suppose that |N (S)| ≥ |S| for all subsets S of X, and
S
N(S)
X
Y
FIGURE 1.110.
let M be a maximum matching. Suppose that u ∈ X is not saturated by M (see Figure 1.111). Define the set A to be the set of vertices of G that can be joined to u
u X
Y
FIGURE 1.111.
by an M -alternating path. Let S = A ∩ X, and let T = A ∩ Y (see Figure 1.112). Notice now that Berge’s Theorem implies that every vertex of T is saturated by
S
T
u X
Y
FIGURE 1.112.
1.7 Matchings
107
M and that u is the only unsaturated vertex of S. That is, every vertex of T is saturated, and every vertex of S \ {u} is saturated. This implies that |T | = |S|− 1. It follows from Berge’s Theorem and the definition of T that N (S) = T . But then we have that |N (S)| = |S| − 1 < |S|, and this is a contradiction. We conclude that such a vertex u cannot exist in X and that M saturates all of X. Given some family of sets X, a system of distinct representatives, or SDR, for the sets in X can be thought of as a “representative” collection of distinct elements from the sets of X. For instance, let S1 , S2 , S3 , S4 , and S5 be defined as follows: S1 = {2, 8}, S2 = {8}, S3 = {5, 7}, S4 = {2, 4, 8}, S5 = {2, 4}. The family X1 = {S1 , S2 , S3 , S4 } does have an SDR, namely {2, 8, 7, 4}. The family X2 = {S1 , S2 , S4 , S5 } does not have an SDR. So under what conditions will a finite family of sets have an SDR? We answer this question with the following theorem. Theorem 1.52. Let S1 , S2 , . . . , Sk be a collection of finite, nonempty sets. This collection has an SDR if and only if for every t ∈ {1, . . . , k}, the union of any t of these sets contains at least t elements. Proof. Since each of the sets is finite, then of course S = S1 ∪ S2 ∪ · · · ∪ Sk is finite. Let us say that the elements of S are a1 , . . . , an . We now construct a bipartite graph with partite sets X = {S1 , . . . , Sk } and Y = {a1 , . . . , an } (Figure 1.113). We place an edge between Si and aj if and only if aj ∈ Si .
X
S1
S2
Sk
Y
a1
a2
an
FIGURE 1.113. Constructing a bipartite graph.
Hall’s Theorem now implies that X can be matched into Y if and only if |A| ≤ |N (A)| for all subsets A of X. In other words, the collection of sets has an SDR if and only if for every t ∈ {1, . . . , k}, the union of any t of these sets contains at least t elements.
108
1. Graph Theory
Hall’s Theorem is often referred to as Hall’s Marriage Theorem. We will see more about this in Section 2.9. Exercises 1. (From [56].) For the graphs of Figure 1.114, with matchings M as shaded, find (a) an M -alternating path that is not M -augmenting; (b) an M -augmenting path if one exists; and, if so, use it to obtain a bigger matching.
FIGURE 1.114.
2. For each of the following families of sets, determine whether the condition of Theorem 1.52 is met. If so, then find an SDR. If not, then show how the condition is violated. (a) {1, 2, 3}, {2, 3, 4}, {3, 4, 5}, {4, 5}, {1, 2, 5} (b) {1, 2, 4}, {2, 4}, {2, 3}, {1, 2, 3} (c) {1, 2}, {2, 3}, {1, 2, 3}, {2, 3, 4}, {1, 3}, {3, 4} (d) {1, 2, 5}, {1, 5}, {1, 2}, {2, 5} (e) {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {1, 2, 3, 4}, {2, 3, 4} 3. Let G be a bipartite graph. Show that G has a matching of size at least |E(G)|/Δ(G). 4. Let Θ = {S1 , S2 , . . . , Sr } be a family of distinct nonempty subsets of the set {1, 2, . . . , n}. If the Si are all of the same cardinality, then prove that there exists an SDR of Θ.
1.7 Matchings
109
5. Let M1 and M2 be matchings in a bipartite graph G with partite sets X and Y . If S ⊆ X is saturated by M1 and T ⊆ Y is saturated by M2 , show that there exists a matching in G that saturates S ∪ T . 6. (From [139].) Let G be a bipartite graph with partite sets X and Y . Let δX denote the minimum degree of the vertices in X, and let ΔY denote the maximum degree of the vertices in Y . Prove that if δX ≥ ΔY , then there exists a matching in G that saturates X.
1.7.3 The K¨onig–Egerv´ary Theorem What I tell you three times is true. — Lewis Carroll, The Hunting of the Snark The main theorem that we present in this section is very important, for it is closely related to several results from other areas of graph theory. We will discuss a few of these areas after we have proven the theorem. A set C of vertices in a graph G is said to cover the edges of G if every edge of G is incident with at least one vertex of C. Such a set C is called an edge cover of G. Consider the graphs G1 and G2 in Figure 1.115. In G1 , the set {b, d, e, a} is an edge cover, as is the set {a, e, f }. In fact, you can see by a little examination that there is no edge cover G1 with fewer than three vertices. So we can say that {a, e, f } is a minimum edge cover of G1 . In G2 , each of the following sets is an edge cover: {v1 , v2 , v3 , v4 , v5 , v6 } (obviously) and {u2 , v6 , u1 }. What is the size of a minimum edge cover here? a
v1
b c
G1
d
v2
v3
u1
u2
v4
v5
v6
G2
e f
u3
u4
FIGURE 1.115.
We are now ready to prove the following result of K¨onig [180] and Egerv´ary [87]. Theorem 1.53 (K¨onig–Egerv´ary Theorem). Let G be a bipartite graph. The maximum number of edges in a matching in G equals the minimum number of vertices in an edge cover of G. Proof. Let M be a maximum matching of G. Let X and Y be the partite sets of G, and let W be the set of all M -unsaturated vertices of X (see Figure 1.116). Note that |M | = |X| − |W |.
110
1. Graph Theory
W u
X
Y
FIGURE 1.116.
Now let A be the set of vertices of G that can be reached via an M -alternating path from some vertex of W . Let S = A ∩ X, and let T = A ∩ Y . We can note two things now: First, S \ W is matched to T (implying that |W | = |S| − |T |), and second, N (S) = T . If we let C = (X \ S) ∪ T , we see that C covers the edges of G. So C is an edge cover of G, and |C| = |X| − |S| + |T | = |X| − |W | = |M |. Now suppose that C is any edge cover. Since each vertex of C can cover at most one edge of M , it must be that |C | ≥ |M |. We conclude then that C is a minimum edge cover. The K¨onig–Egerv´ary Theorem is one of several theorems in graph theory that relate the minimum of one thing to the maximum of something else. What follows are some examples of theorems that are very closely related to the K¨onig– Egerv´ary Theorem. Menger’s Theorem Let G be a connected graph, and let u and v be vertices of G. If S is a subset of vertices that does not include u or v, and if the graph G − S has u and v in different connected components, then we say that S is a u, v-separating set. The following result is known as Menger’s Theorem [202]. Theorem 1.54. Let G be a graph and let u and v be vertices of G. The maximum number of internally disjoint paths from u to v equals the minimum number of vertices in a u, v-separating set. Max Flow Min Cut Theorem A graph can be thought of as a flow network, where one vertex is specified to be the source of the flow and another is specified to be the receiver of the flow. As an amount of material flows from source to receiver, it passes through other intermediate vertices, each of which has a particular flow capacity. The total flow of a network is the amount of material that is able to make it from source to receiver. A cut in a network is a set of intermediate vertices whose removal completely cuts
1.7 Matchings
111
the flow from the source to the receiver. The capacity of the cut is simply the sum of the capacities of the vertices in the cut. Theorem 1.55. Let N be a flow network. The maximum value of total flow equals the minimum capacity of a cut. Independent Zeros If A is an m × n matrix with real entries, a set of independent zeros in A can be thought of as a set of ordered pairs {(i1 , j1 ), (i2 , j2 ), . . . , (it , jt )} with the following properties: a. the (ik , jk ) entry of A is 0 for k = 1, 2, . . . , t; b. if a = b, then ia = ib and ja = jb . That is, none of the zeros in the set are in the same row or column. Now, in this matrix A one can draw lines through each row and column that contains a zero. Such a set of lines is said to cover the zeros of A. Theorem 1.56. The maximum number of independent zeros in A is equal to the minimum number of lines through rows or columns that together cover all the zeros of A. Exercises 1. Use the K¨onig–Egerv´ary Theorem to prove Hall’s Theorem. 2. Let k be some fixed integer, 1 ≤ k ≤ n, and let G be some subgraph of Kn,n with more than (k − 1)n edges. Prove that G has a matching of size at least k. 3. Use the original statement of the K¨onig–Egerv´ary Theorem to prove Theorem 1.56.
1.7.4 Perfect Matchings It’s a perfect ending. — Sophie, in Anastasia We end this section on matchings by discussing perfect matchings. Recall that a perfect matching is a matching that saturates the entire vertex set of a graph. What kinds of graphs have perfect matchings? One thing that is clear is that a graph must be of even order in order to have a chance at having a perfect matching. But being of even order is certainly not enough to guarantee a perfect matching (look back at Figure 1.105). We do know that K2n , C2n , and P2n have perfect matchings. The following result regarding perfect matchings in bipartite graphs is a corollary to Hall’s Theorem. The proof is left as an exercise (Exercise 5).
112
1. Graph Theory
Corollary 1.57. If G is a bipartite graph that is regular of degree k, then G contains a perfect matching. It seems very natural to think that the more edges a graph has, the more likely it is that the graph will have a perfect matching. The following theorem verifies this thought, to a degree. Theorem 1.58. If G is a graph of order 2n such that δ(G) ≥ n, then G has a perfect matching. Proof. Let G be a graph of order 2n with δ(G) ≥ n. Dirac’s theorem (Theorem 1.22) guarantees the existence of a Hamiltonian cycle, C. A perfect matching of G is formed by using alternate edges of C. In 1947 Tutte [269] provided perhaps the best known characterization of graphs with perfect matchings. A number of proofs of Tutte’s Theorem have been published since then. The proof that we present is due to Anderson [7]. A definition first: Given a graph G, define Ω(G) to be the number of connected components of G with odd order. Also, define Σ(G) to be the number of connected components of G with even order. Theorem 1.59 (Tutte’s Theorem). Let G be a graph of order n ≥ 2. G has a perfect matching if and only if Ω(G − S) ≤ |S| for all subsets of S of V (G). Proof. We begin with the forward direction. Let G be a graph that has a perfect matching. Suppose S is a set of vertices and that O1 , O2 , . . . , Ok are the odd components of G − S. For each i, the vertices in Oi can be adjacent only to other vertices in Oi and to vertices in S. Since G has a perfect matching, at least one vertex out of each of the Oi ’s has to be matched with a different vertex in S. If k > |S|, then some Oi would be left out (Figure 1.117). Thus, k ≤ |S|.
O1 O2
Ok
S ? FIGURE 1.117.
For the reverse direction of the theorem, suppose that |S| ≥ Ω(G − S) for all S. In particular, if S = ∅, then Ω(G − ∅) ≤ 0. This implies that there are no odd components of G—every component of G is even. More generally, we make the following claim.
1.7 Matchings
113
Claim A. For any proper subset S, |S| and Ω(G − S) are either both even or both odd. Let C be some component of G. We know from earlier that C has even order. If an even number of vertices is removed from C, then the number of odd components remaining must also be even. If an odd number of vertices is removed from C, then the number of odd components remaining must be odd. Since this is true for every component of G, it is true for all of G. Hence Claim A is proved. We now proceed by induction on n, the order of the graph. If n = 2, then G is K2 , which certainly has a perfect matching. Suppose now that the result is true for all graphs of even order up to n, and let G be a graph of even order n. We now have two cases. Case 1. Suppose that for every proper subset S, Ω(G − S) < |S|. (That is, the strict inequality holds.) Claim A implies that |S| and Ω(G − S) have the same parity, so we can say in this case that for all subsets S, Ω(G − S) ≤ |S| − 2. Let uv ∈ E(G), and consider the graph G − u − v (a graph with two fewer vertices than G). We would like to apply the induction hypothesis to G − u − v, so we need the following claim. Claim B. For all subsets S of V (G − u − v), Ω(G − u − v − S ) ≤ |S |. If Claim B were not true, then Ω(G − u − v − S1 ) > |S1 | for some subset S1 . But since |S1 | = |S1 ∪ {u, v}| − 2, we get Ω(G − u − v − S1 ) > |S1 ∪ {u, v}|, and this contradicts the assumption in this case. Claim B is proved. Since Claim B is true, we can apply the induction hypothesis to G − u − v. That is, we can conclude that G − u − v has a perfect matching. This matching, together with the edge uv, forms a perfect matching of G. Case 1 is complete. Case 2. Suppose there exists a subset S such that Ω(G − S) = |S|. There may be a number of subsets S that satisfy this condition—suppose without loss of generality that S is a largest such set. Let O1 , O2 , . . . , Ok be the components of G − S of odd order. Claim C. Σ(G − S) = 0. That is, there are no even-ordered components of G − S. Let E be an even ordered component of G − S, and let x be a vertex of E. The graph G − S − x has exactly one more odd component than G − S. Thus, |S ∪ {x}| = Ω(G − S − x). But this means that S ∪ {x} is a set larger than S that satisfies the assumption of this case. Since we chose S to be the largest, we have a contradiction. Therefore there are no even-ordered components of G − S. Claim C is proved. Claim D. There exist vertices s1 , s2 , . . . , sk ∈ S and vertices v1 , v2 , . . . , vk , where for each i vi ∈ Oi , such that {v1 s1 , v2 s2 , . . . , vk sk } is a matching. For each i ∈ {1, . . . , k}, define the set Si to be the set of vertices in S that are adjacent to some vertex in Oi . Note that if Si = ∅ for some i, then Oi is
114
1. Graph Theory
completely disconnected from anything else in G, implying that G itself has an odd component. Since this contradicts our assumption in this case, we can assume that each Si is nonempty. Furthermore, our initial assumptions imply that the union of any r of the Si ’s has size at least r. Thus, the condition in Theorem 1.52 is satisfied, implying that there exists a system of distinct representatives for the family of sets S1 , S2 , . . . , Sk . If we let these representatives be s1 , s2 , . . . , sk , and their adjacencies in the Oi ’s be v1 , v2 , . . . , vk , then Claim D is proved. The situation in G is depicted in Figure 1.118, where k = |S|. O1 O2
S
Ok
FIGURE 1.118.
At this point, each vertex in S has been matched to a vertex in an Oi . The goal at this point is to show that each Oi − vi has a perfect matching. Let W be some subset of vertices of (the even-ordered) Oi − vi . Claim E. Ω(Oi − vi − W ) ≤ |W |. If Ω(Oi − vi − W ) > |W |, then, by Claim A, Ω(Oi − vi − W ) ≥ |W | + 2. But then, Ω(G − S − vi − W ) ≥ |S| − 1 + |W | + 2 = |S| + |W | + 1 = |S ∪ W ∪ {vi }|. This contradicts our assumption, and thus Claim E is proved. Since Claim E is true, each Oi − vi satisfies the induction hypothesis, and thus has a perfect matching. These perfect matchings together with the perfect matching shown in Figure 1.118 form a perfect matching of G, and so Case 2 is complete. We conclude this section by considering perfect matchings in regular graphs. If a graph G is 1-regular, then G itself is a perfect matching. If G is 2-regular, then G is a collection of disjoint cycles; as long as each cycle is even, G will have a perfect matching. What about 3-regular graphs? A graph that is 3-regular must be of even order, so is it possible that every 3-regular graph contains a perfect matching? In a word, no. The graph in Figure 1.119 is a connected 3-regular graph that does not have a perfect matching. Thanks to Petersen [221], though, we do know of a special class of 3-regular graphs that do have perfect matchings. Recall that a bridge in a graph is an edge whose removal would disconnect the graph. The graph in Figure 1.119 has three bridges.
1.7 Matchings
115
FIGURE 1.119.
Theorem 1.60 (Petersen’s Theorem). Every bridgeless, 3-regular graph contains a perfect matching. Proof. Let G be a bridgeless, 3-regular graph, and suppose that it does not contain a perfect matching. By Tutte’s Theorem, there must exist a subset S of vertices where the number of odd components of G − S is greater than |S|. Denote the odd-ordered components of G − S by O1 , O2 , . . . , Ok . First, each Oi must have at least one edge into S. Otherwise, there would exist an odd-ordered, 3-regular subgraph of G, and this is not possible, by Theorem 1.1. Second, since G is bridgeless, there must be at least two edges joining each Oi to S. Moreover, if there were only two edges joining some Oi to S, then Oi would contain an odd number of vertices with odd degree, and this cannot happen. We can therefore conclude that there are at least three edges joining each Oi to S. This implies that there are at least 3k edges coming into S from the Oi ’s. But since every vertex of S has degree 3, the greatest number of edges incident with vertices in S is 3|S|, and since 3k > 3|S|, we have a contradiction. Therefore, G must have a perfect matching. It is probably not surprising that the Petersen of Theorem 1.60 is the same person for whom the Petersen graph (Figure 1.63) is named. Petersen used this special graph as an example of a 3-regular, bridgeless graph whose edges cannot be partitioned into three separate, disjoint matchings. Exercises 1. Find a maximum matching of the graph shown in Figure 1.119. 2. Use Tutte’s Theorem to prove that the graph in Figure 1.119 does not have a perfect matching. 3. Draw a connected, 3-regular graph that has both a cut vertex and a perfect matching.
116
1. Graph Theory
4. Determine how many different perfect matchings there are in Kn,n . 5. Prove Corollary 1.57. 6. Characterize when Kr1 ,r2 ,...,rk has a perfect matching. 7. Prove that every tree has at most one perfect matching. 8. Let G be a subgraph of K20,20 . If G has a perfect matching, prove that G has at most 190 edges that belong to no perfect matching. 9. Use Tutte’s Theorem to prove Hall’s Theorem.
1.8 Ramsey Theory I have to go and see some friends of mine, some that I don’t know, and some who aren’t familiar with my name. — John Denver, Goodbye Again We begin this section with a simple question: How many people are required at a gathering so that there must exist either three mutual acquaintances or three mutual strangers? We will answer this question soon. Ramsey theory is named for Frank Ramsey, a young man who was especially interested in logic and philosophy. Ramsey died at the age of 26 in 1930—the same year that his paper On a problem of formal logic was published. His paper catalyzed the development of the mathematical field now known as Ramsey theory. The study of Ramsey theory has burgeoned since that time. While many results in the subject are published each year, there are many questions whose answers remain elusive. As the authors of [136] put it, “the field is alive and exciting.”
1.8.1 Classical Ramsey Numbers An innocent looking problem often gives no hint as to its true nature. — Paul Erd˝os [92] A 2-coloring of the edges of a graph G is any assignment of one of two colors to each of the edges of G. Figure 1.120 shows a 2-coloring of the edges of K5 using red (thick) and blue (thin). Let p and q be positive integers. The (classical) Ramsey number associated with these integers, denoted by R(p, q), is defined to be the smallest integer n such that every 2-coloring of the edges of Kn either contains a red Kp or a blue Kq as a subgraph. Read through that definition at least one more time, and then consider this simple example. We would like to find the value of R(1, 3). According to the definition, this is the least value of n such that every 2-coloring of the edges of Kn
1.8 Ramsey Theory
117
FIGURE 1.120. A 2-coloring of K5 .
either contains as a subgraph a K1 all of whose edges are red, or a K3 all of whose edges are blue. How many vertices are required before we know that we will have one of these objects in every coloring of a complete graph? If you have just one vertex, then no matter how you color the edges (ha-ha) of K1 , you will always end up with a red K1 . Thus, R(1, 3) = 1. We have found our first Ramsey number! We should note here that the definition given for Ramsey number is in fact a good definition. That is, given positive integers p and q, R(p, q) does in fact exist. Ramsey himself proved this fact, and we will learn more about the proof of “Ramsey’s Theorem” in Chapter 2. Back to examples. We just showed that R(1, 3) = 1. Similar reasoning shows that R(1, k) = 1 for all positive integers k (see Exercise 2). How about R(2, 4)? We need to know the smallest integer n such that every 2coloring of the edges of Kn contains either a red K2 or a blue K4 . We claim that R(2, 4) = 4. To show this, we must demonstrate two things: first, that there exists a 2-coloring of K3 that contains neither a red K2 nor a blue K4 , and second, that any 2-coloring of the edges of K4 contains at least one of these as a subgraph. We demonstrate the first point. Consider the 2-coloring of K3 given in Figure 1.121 (recall that red is thick and blue is thin—the edges in this coloring are all blue). This coloring of K3 does not contain a red K2 , and it certainly does not
FIGURE 1.121. The edges of K3 colored blue.
contain a blue K4 . Thus R(2, 4) > 3. For the second point, suppose that the edges of K4 are 2-colored in some fashion. If any of the edges are red, then we have a red K2 . If none of the edges are red, then we have a blue K4 . So, no matter the coloring, we always get one of the two. This proves that R(2, 4) = 4. What do you think is the value of R(2, 5)? How about R(2, 34)? As you will prove in Exercise 3, R(2, k) = k for all integers k ≥ 2.
118
1. Graph Theory
Exercises 1. How many different 2-colorings are there of K3 ? of K4 ? of K5 ? of K10 ? 2. Write a nice proof of the fact that R(1, k) = 1 for all positive integers k. 3. Write a nice proof of the fact that R(2, k) = k for integers k ≥ 2. 4. Prove that for positive integers p and q, R(p, q) = R(q, p). 5. If 2 ≤ p ≤ p and 2 ≤ q ≤ q, then prove that R(p , q ) ≤ R(p, q). Also, prove that equality holds if and only if p = p and q = q.
1.8.2 Exact Ramsey Numbers and Bounds Take me to your leader. — proverbial alien How many people are required at a gathering so that there must exist either three mutual acquaintances or three mutual strangers? We can rephrase this question as a problem in Ramsey theory: How many vertices do you need in an (edge) 2colored complete graph for it to be necessary that there be either a red K3 (people who know each other) or a blue K3 (people who do not know each other)? As the next theorem states, the answer is 6. Theorem 1.61. R(3, 3) = 6. Proof. We begin the proof by exhibiting (in Figure 1.122) a 2-coloring of the edges of K5 that produces neither a red (thick) K3 nor a blue (thin) K3 . This
FIGURE 1.122. A 2-coloring of the edges of K5 .
2-coloring of K5 demonstrates that R(3, 3) > 5. Now consider K6 , and suppose that each of its edges has been colored red or blue. Let v be one of the vertices of K6 . There are five edges incident with v, and they are each colored red or blue, so it must be that v is either incident with at least three red edges or at least three blue edges (think about this; it is called the Pigeonhole Principle—more on this in later chapters). Without loss of generality, let us assume that v is incident with at least three red edges, and let us call them vx, vy, and vz (see Figure 1.123).
1.8 Ramsey Theory
119
FIGURE 1.123.
FIGURE 1.124.
Now, if none of the edges xy, xz, yz is colored red, then we have a blue K3 (Figure 1.124). On the other hand, if at least one of xy, xz, yz is colored red, we have a red K3 (Figure 1.125).
FIGURE 1.125.
Therefore, any 2-coloring of the edges of K6 produces either a red K3 or a blue K3 . Let us determine another Ramsey number. Theorem 1.62. R(3, 4) = 9. Proof. Consider the 2-coloring of the edges of K8 given in Figure 1.126. A bit of examination reveals that this coloring produces no red (thick) K3 and no blue (thin) K4 . Thus, R(3, 4) ≥ 9. We now want to prove that R(3, 4) ≤ 9, and we will use the facts that R(2, 4) = 4 and R(3, 3) = 6. Let G be any complete graph of order at least 9, and suppose that the edges of G have been 2-colored arbitrarily. Let v be some vertex of G. Case 1. Suppose that v is incident with at least four red edges. Call the end vertices of these edges “red neighbors” of v, and let S be the set of red neighbors of v (see Figure 1.127).
120
1. Graph Theory
FIGURE 1.126. A 2-coloring of the edges in K8 .
v S
FIGURE 1.127.
Since S contains at least four vertices, and since R(2, 4) = 4, the 2-coloring of the edges that are within S must produce either a red K2 or a blue K4 within S itself. If the former is the case, then we are guaranteed a red K3 in G (see Figure 1.128). If the latter is the case, then we are clearly guaranteed a blue K4 in G.
v S
FIGURE 1.128.
Case 2. Suppose that v is incident with at least six blue edges. Call the other end vertices of these edges “blue neighbors” of v, and let T be the set of blue neighbors of v (see Figure 1.129). Since T contains at least six vertices, and since R(3, 3) = 6, the 2-coloring of the edges that are within T must produce either a red K3 or a blue K3 within T itself. If the former is the case, then we are obviously guaranteed a red K3 in G.
1.8 Ramsey Theory
121
v
T
FIGURE 1.129.
If the latter is the case, then we are guaranteed a blue K4 in G (see Figure 1.130).
v
T
FIGURE 1.130.
Case 3. Suppose that v is incident with fewer than four red edges and fewer than six blue edges. In this case there must be at most nine vertices in G altogether, and since we assumed at the beginning that the order of G is at least 9, we can say that G has order exactly 9. Further, we can say that v is incident with exactly three red edges and exactly five blue edges. And since the vertex v was chosen arbitrarily, we can assume that this holds true for every vertex of G. Now if we consider the underlying “red” subgraph of G, we have a graph with nine vertices, each of which has degree 3. But this cannot be, since the number of vertices in G with odd degree is even (the First Theorem of Graph Theory). Therefore, this case cannot occur. We have therefore proved that any 2-coloring of the edges of a complete graph on 9 vertices (or more) produces either a red K3 or a blue K4 . Hence, R(3, 4) = 9.
122
1. Graph Theory
Some known Ramsey numbers are listed below. R(1, k) = 1, R(2, k) = k, R(3, 3) = 6, R(3, 4) = 9, R(3, 5) = 14, R(3, 6) = 18, R(3, 7) = 23, R(3, 8) = 28, R(3, 9) = 36, R(4, 4) = 18, R(4, 5) = 25. Bounds on Ramsey Numbers Determining exact values of Ramsey numbers is extremely difficult in general. In fact, the list given above is not only a list of some known Ramsey numbers, it is a list of all known Ramsey numbers. Many people have attempted to determine other values, but to this day no other numbers are known. However, there has been progress in finding bounds, and we state some important ones here. The proofs of the first two theorems will be discussed in Section 2.10.2 (see Theorem 2.28 and Corollary 2.29). The first bound is due to Erd˝os and Szekeres [94], two major players in the development of Ramsey theory. Their result involves a quotient of factorials: Here, n! denotes the product 1 · 2 · · · n. Theorem 1.63. For positive integers p and q, R(p, q) ≤
(p + q − 2)! . (p − 1)!(q − 1)!
The next theorem gives a bound on R(p, q) based on “previous” Ramsey numbers. Theorem 1.64. If p ≥ 2 and q ≥ 2, then R(p, q) ≤ R(p − 1, q) + R(p, q − 1). Furthermore, if both terms on the right of this inequality are even, then the inequality is strict. The following bound is for the special case p = 3. Theorem 1.65. For every integer q ≥ 3, R(3, q) ≤
q2 + 3 . 2
The final bound that we present is due to Erd˝os [90]. It applies to the special case p = q. In the theorem, x denotes the greatest integer less than or equal to x. Theorem 1.66. If p ≥ 3, then R(p, p) > 2n/2 .
1.8 Ramsey Theory
123
A number of other specific bounds are known: 35 ≤ R(4, 6) ≤ 41, 43 ≤ R(5, 5) ≤ 49, 58 ≤ R(5, 6) ≤ 87, 102 ≤ R(6, 6) ≤ 165. Even with the sophisticated computing power that is available to us today, we are not able to compute values for more than a handful of Ramsey numbers. Paul Erd˝os once made the following comment regarding the difficulty in finding exact values of Ramsey numbers [63]: Suppose an evil alien would tell mankind “Either you tell me [the value of R(5, 5)] or I will exterminate the human race.” . . . It would be best in this case to try to compute it, both by mathematics and with a computer. If he would ask [for the value of R(6, 6)], the best thing would be to destroy him before he destroys us, because we couldn’t [determine R(6, 6)]. Exercises 1. Prove that R(3, 5) ≥ 14. The graph in Figure 1.131 will be very helpful.
FIGURE 1.131. A 2-coloring of K13 .
2. Use Theorem 1.64 and the previous exercise to prove that R(3, 5) = 14.
124
1. Graph Theory
3. Construct a graph and a 2-coloring that proves R(4, 4) ≥ 18. 4. Use Theorem 1.64 and the previous exercise to prove that R(4, 4) = 18. 5. Use Theorem 1.64 to prove Theorem 1.65.
1.8.3 Graph Ramsey Theory All generalizations are dangerous, even this one. — Alexandre Dumas Graph Ramsey theory is a generalization of classical Ramsey theory. Its development was due in part to the search for the elusive classical Ramsey numbers, for it was thought that the more general topic might shed some light on the search. The generalization blossomed and became an exciting field in itself. In this section we explain the concept of graph Ramsey theory, and we examine several results. These results, and more like them, can be found in [136]. Given two graphs G and H, define the graph Ramsey number R(G, H) to be the smallest value of n such that any 2-coloring of the edges of Kn contains either a red copy of G or a blue copy of H. The classical Ramsey number R(p, q) would in this context be written as R(Kp , Kq ). The following simple result demonstrates the relationship between graph Ramsey numbers and classical Ramsey numbers. Theorem 1.67. If G is a graph of order p and H is a graph of order q, then R(G, H) ≤ R(p, q). Proof. Let n = R(p, q), and consider an arbitrary 2-coloring of Kn . By definition, Kn contains either a red Kp or a blue Kq . Since G ⊆ Kp and H ⊆ Kq , there must either be a red G or a blue H in Kn . Hence, R(G, H) ≤ n = R(p, q). Here is a result due to Chv´atal and Harary [55] that relates R(G, H) to the chromatic number of G, χ(G), and the order of the largest component of H, denoted by C(H). Theorem 1.68. R(G, H) ≥ (χ(G) − 1)(C(H) − 1) + 1. Proof. Let m = χ(G) − 1 and let n = C(H) − 1. Consider the graph S formed by taking m copies of Kn and adding all of the edges in between each copy (Figure 1.132). Actually, S = Kmn . Now color all of the edges within each Kn blue, and color all other edges red. From the way we have constructed the coloring, every red subgraph can be vertex colored with m colors. Since m < χ(G), there can be no red G present. Furthermore, any blue subgraph has at most n = C(H) − 1 vertices in its largest component. Hence, there can be no blue H present. We have exhibited a 2-coloring of Kmn that contains neither a red G nor a blue H.
1.8 Ramsey Theory
Kn
125
Kn
Kn Kn FIGURE 1.132. The graph S.
The next few theorems give exact graph Ramsey numbers for specific classes of graphs. The first is due to Chv´atal [53], and the proof uses a few ideas from previous sections. Theorem 1.69. If Tm is a tree with m vertices, then R(Tm , Kn ) = (m − 1)(n − 1) + 1. Proof. If m = 1 or n = 1, then R(Tm , Kn ) = 1 and the result holds. Assume then that m and n are both at least 2. Claim A. R(Tm , Kn ) ≥ (m − 1)(n − 1) + 1. Consider the graph that consists of n − 1 copies of Km−1 , with all possible edges between the copies of Km−1 . This graph is actually K(m−1)(n−1) . Color the edges in each Km−1 red, and color all of the other edges blue. Since each of the red subgraphs has order m − 1, no red Tm can exist. Also, by this construction, no blue Kn can exist. Since this 2-coloring contains no red Tm and no blue Kn , it must be that R(Tm , Kn ) ≥ (m − 1)(n − 1) + 1. Claim B. R(Tm , Kn ) ≤ (m − 1)(n − 1) + 1. Let G be K(m−1)(n−1)+1 , and suppose that its edges have been arbitrarily 2colored. Let Gr denote the subgraph of G formed by the red edges, and let Gb denote the subgraph of G formed by the blue edges. If there is no blue Kn , then ω(Gb ) ≤ n−1, and if so, then α(Gr ) ≤ n−1, since Gr is the complement of Gb . Thus by Theorem 1.45, χ(Gr ) ≥ m. Let H be a subgraph of Gr that is m-critical. By part (d) of Exercise 6 in Section 1.6.1, δ(H) ≥ m − 1. By Theorem 1.16, H contains Tm as a subgraph, and therefore G has a red Tm . The next theorem is due to Burr [46]. Theorem 1.70. If Tm is a tree of order m and if m − 1 divides n − 1, then R(Tm , K1,n ) = m + n − 1.
126
1. Graph Theory
In the following theorem, mK2 denotes the graph consisting of m copies of K2 , and nK2 has a similar meaning. Theorem 1.71. If m ≥ n ≥ 1, then R(mK2 , nK2 ) = 2m + n − 1. As we mentioned earlier, these results apply to specific classes of graphs. In general, determining values of R(G, H) is quite difficult. So the generalization that was intended to solve hard classical Ramsey problems has produced hard problems of its own! Exercises 1. Find R(P3 , P3 ). 2. Find R(P3 , C4 ). 3. Find R(C4 , C4 ). 4. Prove that R(K1,3 , K1,3 ) = 6. 5. Prove that R(2K3 , K3 ) = 8.
1.9 References Prince John: Are you finished? Sir Robin of Locksley: I’m only just beginning. — Robin Hood We have only just begun our walk through the field of graph theory. In this section we will provide references for those who are interested in further study. The books by Chartrand and Lesniak [52], Buckley and Lewinter [43] and West [281] provide very thorough introductions to a large number of topics in graph theory. The graduate-level texts by Diestel [75] and Bollob´as [29], along with offering further study of the concepts covered in this chapter, also cover network flows, extremal graph theory, and random graphs. Gould’s book [128] covers a number of graph algorithms, from finding maximum matchings to testing planarity. Many interesting applications of graph theory can be found in texts by Gross and Yellen [139], Foulds [106], and Roberts and Tesman [238]. A good source for connections between graph theory and other mathematical topics is [21], edited by Beineke and Wilson. The text [148] by Harary is a thorough discussion of counting various types of graphs. A wonderful source for the history of graph theory and some of its famous problems is the book [26] by Biggs, Lloyd, and Wilson. Buckley and Harary [42] have a nice text which focuses on distance in graphs. For more on the development of the Four Color Problem, see the books by Wilson
1.9 References
127
[285] and Aigner [3]. Much more information regarding Ramsey theory can be found in the book [136] by Graham, Rothschild, and Spencer. Also, Radziszowski [231] maintains a list of current bounds on small Ramsey numbers. The book by Barab´asi [17] is a nice general treatment of graphs (networks) and their relationship to all sorts of phenomena. Finally, the books by Hoffman [163] and Schechter [247] tell the story of Paul Erd˝os, a twentieth century giant in the field of graph theory.
2 Combinatorics
[Combinatorics] has emerged as a new subject standing at the crossroads between pure and applied mathematics, the center of bustling activity, a simmering pot of new problems and exciting speculations. — Gian-Carlo Rota, [243, p. vii]
The formal study of combinatorics dates at least to Gottfried Wilhelm Leibniz’s Dissertatio de Arte Combinatoria in the seventeenth century. The last half-century, however, has seen a huge growth in the subject, fueled by problems and applications from many fields of study. Applications of combinatorics arise, for example, in chemistry, in studying arrangements of atoms in molecules and crystals; biology, in questions about the structure of genes and proteins; physics, in problems in statistical mechanics; communications, in the design of codes for encryption, compression, and correction of errors; and especially computer science, for instance in problems of scheduling and allocating resources, and in analyzing the efficiency of algorithms. Combinatorics is, in essence, the study of arrangements: pairings and groupings, rankings and orderings, selections and allocations. There are three principal branches in the subject. Enumerative combinatorics is the science of counting. Problems in this subject deal with determining the number of possible arrangements of a set of objects under some particular constraints. Existential combinatorics studies problems concerning the existence of arrangements that possess some specified property. Constructive combinatorics is the design and study of algorithms for creating arrangements with special properties. J.M. Harris et al., Combinatorics and Graph Theory, DOI: 10.1007/978-0-387-79711-3 2, c Springer Science+Business Media, LLC 2008
130
2. Combinatorics
Combinatorics is closely related to the theory of graphs. Many problems in graph theory concern arrangements of objects and so may be considered as combinatorial problems. For example, the theory of matchings and Ramsey theory, both studied in the previous chapter, have the flavor of existential combinatorics, and we continue their study later in this chapter. Also, combinatorial techniques are often employed to address problems in graph theory. For example, in Section 2.5 we determine another method for finding the chromatic polynomial of a graph. We focus on topics in enumerative combinatorics through most of this chapter, but turn to some questions in existential combinatorics in Sections 2.4 and 2.10, and to some problems in constructive combinatorics in Sections 2.9 and 2.10. Throughout this chapter we study arrangements of finite sets. Chapter 3 deals with arrangements and combinatorial problems involving infinite sets. Our study in this chapter includes the investigation of the following questions. • Should a straight beat a flush in the game of poker? What about a full house? • Suppose a lazy professor collects a quiz from each student in a class, then shuffles the papers and redistributes them randomly to the class for grading. How likely is it that no one receives his or her own quiz to grade? • How many ways are there to make change for a dollar? • How many different necklaces with twenty beads can be made using rhodonite, rose quartz, and lapis lazuli beads, if a necklace can be worn in any orientation? • How many seating arrangements are possible for n guests attending a wedding reception in a banquet room with k round tables? • Suppose 100 medical students rank 100 positions for residencies at hospitals in order of preference, and the hospitals rank the students in order of preference. Is there a way to assign the students to the hospitals in such a way that no student and hospital prefer each other to their assignment? Is there an efficient algorithm for finding such a matching? • Is it possible to find a collection of n ≥ 3 points in the plane, not all on the same line, so that every line that passes through two of the points in fact passes through a third? Or, if we require instead that no three points lie on the same line, can we arrange a large number of points so that no subset of them forms the vertices of a convex octagon?
2.1 Some Essential Problems The mere formulation of a problem is far more essential than its solution. . . — Albert Einstein
2.1 Some Essential Problems
131
We begin our study of combinatorics with two essential observations that underlie many counting strategies and techniques. The first is a simple observation about counting when presented with a number of alternative choices. Sum Rule. Suppose S1 , S2 , . . . , Sm are mutually disjoint finite sets, and |Si | = ni for 1 ≤ i ≤ m. Then the number of ways to select one object from any of the sets S1 , S2 , . . . , Sm is the sum n1 + n2 + · · · + nm . We often use the sum rule implicitly when solving a combinatorial problem when we break the set of possible outcomes into several disjoint cases, each of which can be analyzed separately. For example, suppose a coy college athlete tells us that his two-digit jersey number is divisible by 3, its first digit is odd, and its second digit is less than its first. How many numbers satisfy these criteria? A natural approach is to break the problem into five cases based on the first digit. Analyzing each of 1, 3, 5, 7, and 9 in turn, we find the possibilities are {}, {30}, {51, 54}, {72, 75}, or {90, 93, 96}, so there are eight possible jersey numbers in all. The second essential observation concerns counting problems where selections are made in sequence. Product Rule. Suppose S1 , S2 , . . . , Sm are finite sets, and |Si | = ni for 1 ≤ i ≤ m. Then the number of ways to select one element from S1 , followed by one element from S2 , and so on, ending with one element from Sm , is the product n1 n2 · · · nm , provided that the selections are independent, that is, the elements chosen from S1 , . . . , Si−1 have no bearing on the selection from Si , for each i. For example, consider the number of m-letter acronyms that can be formed using the full alphabet. To construct such an acronym, we make m choices in sequence, one for each position, and each choice has no effect on any subsequent selection. Thus, by the product rule, the number of such acronyms is 26m . We can apply a similar strategy to count the number of valid phone numbers in the U.S. and Canada. Under the North American Numbering Plan, a phone number has ten digits, consisting of an area code, then an exchange, then a station code. The three-digit area code cannot begin with 0 or 1, and its second digit can be any number except 9. The three-digit exchange cannot begin with 0 or 1, and the station code can be any four-digit number. Using the product rule, we find that the number of valid phone numbers under this plan is (8 · 9 · 10) · (8 · 102 ) · 104 = 5 760 000 000. One might object that certain three-digit numbers are service codes reserved for special use in many areas, like 411 for information and 911 for emergencies. Let’s compute the number of valid phone numbers for which neither the area code nor the exchange end with the digits 11. The amended number of area codes is then 8(9 · 10 − 1) = 712, and for exchanges we obtain 8 · 99 = 792. Thus, the number of valid phone numbers is 712 · 792 · 104 = 5 639 040 000. We can use the product rule to solve three basic combinatorial problems.
132
2. Combinatorics
Problem 1. How many ways are there to order a collection of n different objects? For example, how many ways are there to arrange the cards in a standard deck of 52 playing cards by shuffling? How many different batting orders are possible among the nine players on a baseball team? How many ways are there to arrange ten books on a shelf? To order a collection of n objects, we need to pick one object to be first, then another one to be second, and another one third, and so on. There are n different choices for the first object, then n − 1 remaining choices for the second, and n − 2 for the third, and so forth, until just one choice remains for the last object. The total number of ways to order the n objects is therefore the product of the integers between 1 and n. This number, called n factorial, is written n!. An ordering, or rearrangement, of n objects is often called a permutation of the objects. Thus, the number of permutations of n items is n!. Our second problem generalizes the first one. Problem 2. How many ways are there to make an ordered list of k objects from a collection of n different objects? For example, how many ways can a poll rank the top 20 teams in a college sport if there are 100 teams in the division? How many ways can a band arrange a play list of twelve songs if they know only 25 different songs? Applying the same reasoning used in the first problem, we find that the answer to Problem 2 is the product n(n − 1)(n − 2) · · · (n − k + 1), or n!/(n − k)!. This number is sometimes denoted by P (n, k), but products like this occur frequently in combinatorics, and a more descriptive notation is often used to designate them. We define the falling factorial power xk as a product of k terms beginning with x, with each successive term one less than its predecessor: xk = x(x − 1)(x − 2) · · · (x − k + 1) =
k−1
(x − i).
(2.1)
i=0
The expression xk is pronounced “x to the k falling.” Similarly, we define the rising factorial power xk (“x to the k rising”) by xk = x(x + 1)(x + 2) · · · (x + k − 1) =
k−1
(x + i).
(2.2)
i=0
Thus, we see that P (n, k) = nk = (n − k + 1)k , and n! = nn = 1n . Also, the expressions n0 , n0 , and 0! all represent products having no terms at all. Multiplying any expression by such an empty product should not disturb the value of the expression, so the value of each of these degenerate products is taken to be 1. Our third problem concerns unordered selections.
2.1 Some Essential Problems
133
Problem 3. How many ways are there to select k objects from a collection of n objects, if the order of selection is irrelevant? For example, how many different hands are possible in the game of poker? A poker hand consists of five cards drawn from a standard deck of 52 different cards. The order of the cards in a hand is unimportant, since players can rearrange their cards freely. The solution to Problem 3 is usually denoted by nk , or sometimes C(n, k). The expression nk is pronounced “n choose k.” We can find a formula for nk by using our solutions to Problems 1 and 2. Since there are k! different ways to order a collection of k objects, it follows that the product nk k! is the number of possible ordered lists of k objects selected from the same collection of n objects. Therefore, n nk n! = = . (2.3) k k! k!(n − k)! The numbers nk are called binomial coefficients, for reasons discussed in the next section. The binomial coefficients are ubiquitous in combinatorics, and we close this section with a few applications of these numbers. 5 1. The number of different hands in poker is 52 The 5 = 52 /5! = 2 598 960. 52 number of different thirteen-card hands in the game of bridge is 13 = 635 013 559 600. 2. To play the Texas lottery game Lotto Texas, a gambler selects six different numbers between 1 and 54. The order of selection is unimportant. The number of possible lottery tickets is therefore 54 6 = 25 827 165. 3. Suppose we need to travel m blocks east and n blocks south in a regular grid of city streets. How many paths are there to our destination if we travel only east and south? We can represent a path to our destination as a sequence b1 , b2 , . . . , bn+m , where bi represents the direction we are traveling during the ith block of our route. Exactly m
of the terms in this sequence must be “east,” and there are precisely m+n ways to select m positions in the sequence to have this m value. The remaining n positions in the sequence must all be “south,” so
(m+n)! the number of possible paths is m+n = m!n! . m 4. A standard deck of playing cards consists of four suits (spades, hearts, clubs, and diamonds), each with thirteen cards. Each of the cards in a suit has a different face value: a number between 2 and 10, or a jack, queen, king, or ace. How many poker hands have exactly three cards with the same face value? We can answer this question by considering how to construct such a hand through a sequence of simple steps. First, select one of the thirteen different
134
2. Combinatorics
face values. Second, choose three of the four cards in the deck having this value. Third, pick two cards from the 48 cards having a different face value. By the product rule, the number of possibilities is 13 4 48 = 58 656. 1 3 2 Poker aficionados will recognize that this strategy counts the number of ways to deal either of two different hands in the game: the “three of a kind” and the stronger “full house.” A full house consists of a matched triple together with a matched pair, for example, three jacks and two aces; a three of a kind has only a matched triple. The number of ways to deal a full house is 13 4 12 4 = 3744, 1 3 1 2 since choosing a matched pair involves first selecting one of twelve different remaining face values, then picking two of the four cards having this value. The number of three of a kind hands is therefore 58 656 − 3744 = 54 912. We can also compute this number directly by modifying our first strategy. To avoid the possibility of selecting a matched pair in the last step, we can replace the term 48 = 48 · 47/2 by 48 · 44/2, since the face value of 2 the last card should not match any other card selected. Indeed, we calculate 13 · 4 · 48 · 44/2 = 54 912. Notice that dividing by 2 is required in the last step, since the last two cards may be selected in any order. Exercises 1. In the C++ programming language, a variable name must start with a letter or the underscore character (_), and succeeding characters must be letters, digits, or the underscore character. Uppercase and lowercase letters are considered to be different characters. (a) How many variable names with exactly five characters can be formed in C++? (b) How many are there with at most five characters? (c) How many are there with at most five characters, if they must read exactly the same forwards and backwards? For example, kayak and T55T are admissible, but Kayak is not. 2. Assume that a vowel is one of the five letters A, E, I, O, or U. (a) How many eleven-letter sequences from the alphabet contain exactly three vowels? (b) How many of these have at least one repeated letter?
2.1 Some Essential Problems
135
3. There are 30 teams in the National Basketball Association: 15 in the Western Conference, and 15 in the Eastern Conference. (a) Suppose each of the teams in the league has one pick in the first round of the NBA draft. How many ways are there to arrange the order of the teams selecting in the draft? (b) Suppose that each of the first three positions in the draft must be awarded to one of the fourteen teams that did not advance to the playoffs that year. How many ways are there to assign the first three positions in the draft? (c) How many ways are there for eight teams from each conference to advance to the playoffs, if order is unimportant? (d) Suppose that every team has three centers, four guards, and five forwards. How many ways are there to select an all-star team with the same composition from the Western Conference? 4. According to the Laws of the Game of the International Football Association, a full football (soccer) team consists of eleven players, one of whom is the goalkeeper. The other ten players fall into one of three outfield positions: defender, midfielder, and striker. There is no restriction on the number of players at each of these positions, as long as the total number of outfield players is ten. (a) How many different configurations are there for a full football team? For example, one team may field four strikers, three midfielders, and three defenders, in addition to the goalkeeper. Another may play five strikers, no midfielders, and five defenders, plus the goalkeeper. (b) Repeat the previous problem if there must be at least two players at each outfield position. (c) How many ways can a coach assign eleven different players to one of the four positions, if there must be exactly one goalkeeper, but there is no restriction on the number of players at each outfield position? 5. A political science quiz has two parts. In the first, you must present your opinion of the four most influential secretaries-general in the history of the United Nations in a ranked list. In the second, you must name ten members of the United Nations security council in any order, including at least two permanent members of the council. If there have been eight secretariesgeneral in U.N. history, and there are fifteen members of the U.N. security council, including the five permanent members, how many ways can you answer the quiz, assuming you answer both parts completely? 6. A midterm exam in phenomenology has two parts. The first part consists of ten multiple choice questions. Each question has four choices, labeled (a), (b), (c), and (d), and one may pick any combination of responses on each
136
2. Combinatorics
of these questions. For example, one could choose just (a) alone on one question, or both (b) and (c), or all four possibilities, or none of them. In the second part, one may choose either to answer eight true/false questions, or to select the proper definition of each of seven terms from a list of ten possible definitions. Every question must be answered on whichever part is chosen, but one is not allowed to complete both portions. How many ways are there to complete the exam? 7. A ballot lists ten candidates for city council, eight candidates for the school board, and five bond issues. The ballot instructs voters to choose up to four people running for city council, rank up to three candidates for the school board, and approve or reject each bond issue. How many different ballots may be cast, if partially completed (or empty) ballots are allowed? 8. Compute the number of ways to deal each of the following five-card hands in poker. (a) Straight: the values of the cards form a sequence of consecutive integers. A jack has value 11, a queen 12, and a king 13. An ace may have a value of 1 or 14, so A 2 3 4 5 and 10 J Q K A are both straights, but K A 2 3 4 is not. Furthermore, the cards in a straight cannot all be of the same suit (a flush). (b) Flush: All five cards have the same suit (but not in addition a straight). (c) Straight flush: both a straight and a flush. Make sure that your counts for straights and flushes do not include the straight flushes. (d) Four of a kind. (e) Two distinct matching pairs (but not a full house). (f) Exactly one matching pair (but no three of a kind). (g) At least one card from each suit. (h) At least one card from each suit, but no two values matching. (i) Three cards of one suit, and the other two of another suit, like three hearts and two spades. 9. In the lottery game Texas Two Step, a player selects four different numbers between 1 and 35 in step 1, then selects an additional “bonus ball” number in the same range in step 2. The latter number is not considered to be part of the set selected in step 1, and in fact it may match one of the numbers selected there. (a) A resident of College Station always selects a bonus ball number that is different from any of the numbers he picks in step 1. How many of the possible Texas Two Step tickets have this property?
2.2 Binomial Coefficients
137
(b) In Rhode Island’s lottery game Wild Money, a gambler picks a set of five numbers between 1 and 35. Is the number of possible tickets in this game the same as the number of tickets in Texas Two Step where the bonus ball number is different from the other numbers? Determine the ratio of the number of possible tickets in Wild Money to the number in the restricted Texas Two Step. 10.
(a) A superstitious resident of Amarillo always picks three even numbers and three odd numbers when playing Lotto Texas. What fraction of all possible lottery tickets have this property? (b) Suppose in a more general lottery game one selects six numbers between 1 and 2n. What fraction of all lottery tickets have the property that half the numbers are odd and half are even? (c) What is the limiting value of this probability as n grows large?
11. Suppose a positive integer N factors as N = pn1 1 pn2 2 · · · pnmm , where p1 , p2 , . . . , pm are distinct prime numbers and n1 , n2 , . . . , nm are all positive integers. How many different positive integers are divisors of N ? 12. Assume that a positive integer cannot have 0 as its leading digit. (a) How many five-digit positive integers have no repeated digits at all? (b) How many have no consecutive repeated digits? (c) How many have at least one run of consecutive repeated digits (for example, 23324, 45551, or 151155, but not 12121)? 13. How many positive integers are there whose representation in base 8 has exactly eight octal digits, at most one of which is odd? An octal digit is a number between 0 and 7, inclusive. Assume that the octal representation of a positive integer cannot start with a zero. 14. Let Δ be the difference operator: Δ(f (x)) = f (x + 1) − f (x). Show that Δ(xn ) = nxn−1 , and use this to prove that m−1
kn =
k=0
mn+1 . n+1
2.2 Binomial Coefficients About binomial theorem I’m teeming with a lot o’ news, With many cheerful facts about the square of the hypotenuse. — Gilbert and Sullivan, The Pirates of Penzance
138
2. Combinatorics
The binomial coefficients possess a number of interesting arithmetic properties. In this section we study some of the most important identities associated with these numbers. Because binomial coefficients occur so frequently in this subject, knowing these essential identities will be helpful in our later studies. The first identity generalizes our formula (2.3). Expansion. If n is a nonnegative integer and k is an integer, then ⎧ n! ⎨ if 0 ≤ k ≤ n, n = k!(n − k)! ⎩ k 0 otherwise.
(2.4)
Designating the value of nk to be 0 when k < 0 or k > n is sensible, for there are no ways to select fewer than zero or more than n items from a collection of n objects. Notice that every subset of k objects selected from a set of n objects leaves a complementary collection of n − k objects that are not selected. Counting the number of subsets with k objects is therefore the same as counting the number of subsets with n− k objects. This observation leads us to our second identity, which is easy to verify using the expansion formula. Symmetry. If n is a nonnegative integer and k is an integer, then n n = . k n−k
(2.5)
Before presenting the next identity, let us consider again the problem of counting poker hands. Suppose the ace of spades is the most desirable card in the deck (it certainly is in American Western movies), and we would like to know the number of five-card hands that include this card. The answer is the number of ways to select four cards from the other 51 cards in the deck, namely, 51 4 . We can also count the number of hands that do not include the ace of spades. This is the
number of ways to pick five cards from the other 51, that is, 51 5 . But every poker hand either includes the ace of spades or does not, so 52 51 51 = + . 5 5 4 More generally, suppose we distinguish one particular object in a collection of n objects. The number of unordered collections of k of the objects that include
the distinguished object is n−1 ; the number of collections that do not include
k−1 this special object is n−1 . We therefore obtain the following identity. k Addition. If n is a positive integer and k is any integer, then n n−1 n−1 = + . k k k−1
(2.6)
2.2 Binomial Coefficients
139
We can prove this identity more formally using the expansion identity. It is easy to check that the identity holds for k ≤ 0 or k ≥ n. If 0 < k < n, we have n−1 n−1 (n − 1)! (n − 1)! + = + k k−1 k!(n − 1 − k)! (k − 1)!(n − k)! ((n − k) + k)(n − 1)! = k!(n − k)! n! = k!(n − k)! n = . k We can use this identity to create a table of binomial coefficients. Let n ≥ 0 index the rows of the table, and let k ≥ 0 index the columns. Begin by entering 1 in the first position of each row, since n0 = 1 for n ≥ 0; then use (2.6) to compute the entries in successive rows of the table. The resulting pattern of numbers is called Pascal’s triangle, after Blaise Pascal, who studied many of its properties in his Trait´e du Triangle Arithm´etique, written in 1654. (See [85] for more information on its history.) The first few rows of Pascal’s triangle are shown in Figure 2.1. n
k=0 1 n=0 1 1 1 1 2 1 2 3 1 3 4 1 4 5 1 5 6 1 6 7 1 7 8 1 8 9 1 9 10 1 10 k
2
3
4
5
6
7
8
9 10
1 3 1 6 4 1 10 10 5 1 15 20 15 6 1 21 35 35 21 7 1 28 56 70 56 28 8 1 36 84 126 126 84 36 9 1 45 120 210 252 210 120 45 10
TABLE 2.1. Pascal’s triangle for binomial coefficients,
n k
1
2n 1 2 4 8 16 32 64 128 256 512 1024
.
The next identity explains the origin of the name for these numbers: They appear as coefficients when expanding powers of the binomial expression x + y. The Binomial Theorem. If n is a nonnegative integer, then
n (x + y)n = xk y n−k . k k
(2.7)
140
2. Combinatorics
The notation
means that the sum extends over all integers k. Thus, the right
k
side of (2.7) is formally an infinite sum, but all terms with k < 0 or k > n are zero by the expansion identity, so there are only n + 1 nonzero terms in this sum. Proof. We prove this identity by induction on n. For n = 0, both sides evaluate to 1. Suppose then that the identity holds for a fixed nonnegative integer n. We need to verify that it holds for n + 1. Using our inductive hypothesis, then distributing the remaining factor of (x + y), we obtain
n n+1 (x + y) xk y n−k = (x + y) k k
n
n xk+1 y n−k + xk y n+1−k . = k k k
k
Now we reindex the first sum, replacing each occurrence of k by k − 1. Since the original sum extends over all values of k, the reindexed sum does, too. Thus
n
n (x + y)n+1 = xk y n+1−k + xk y n+1−k k−1 k k k
n n + xk y n+1−k = k−1 k k
n + 1 xk y n+1−k , = k k
by the addition identity. This completes the induction, and we conclude that the identity holds for all n ≥ 0. We note two important consequences of the binomial theorem. First, setting x = y = 1 in (2.7), we obtain
n = 2n . (2.8) k k
Thus, summing across the nth row in Pascal’s triangle yields 2n , and there are therefore exactly 2n different subsets of a set of n elements. These row sums are included in Table 2.1. Second, setting x = −1 and y = 1 in (2.7), we find that the alternating sum across any row of Pascal’s triangle is zero, except of course for the top row:
0 if n ≥ 1, n = (2.9) (−1)k k 1 if n = 0. k This is obvious from the symmetry relation when n is odd, but less clear when n is even.
2.2 Binomial Coefficients
141
These two consequences of the binomial theorem concern sums over the lower index of binomial coefficients. The next identity tells us the value of a sum over the upper index. Summing on the Upper Index. If m and n are nonnegative integers, then n
k n+1 = . (2.10) m m+1 k=0
Proof. We use induction on n to verify this identity. For n = 0, each side equals 1 if m = 0, and each side is 0 if m > 0. Suppose then that the identity holds for some fixed nonnegative integer n. We must show that it holds for the case n + 1. Let m be a nonnegative integer. We obtain n+1 n
k n + 1
k = + m m m k=0 k=0 n+1 n+1 = + m m+1 n+2 = . m+1 By induction, the identity holds for all n ≥ 0. To illustrate one last identity, we study the Lotto Texas game in more detail. Recall that a player selects six different numbers between 1 and 54 to enter the lottery. The largest prize is awarded to anyone matching all six numbers picked in a random drawing by lottery officials, but smaller prizes are given to players matching at least three of these numbers. To determine fair amounts for these smaller prizes, the state lottery commission needs to know the number of possible tickets that match exactly k of the winning numbers, for every k. 6 Clearly, there is just one way to match all six winning numbers. There are 5 = 6 ways to pick five of the six winning numbers, and 48 ways to select one losing number, so there are 6 ·48 = 288 tickets that match five numbers. Selecting
four of the winning numbers and two of the losing numbers makes 64 48 = 2 16 920 possible tickets, and in general we see that the number of tickets that match 48 exactly k of the winning numbers is k6 6−k . By summing over k, we count every possible ticket exactly once, so 54 6 48 = . 6 k 6−k k
More generally, if a lottery game requires selecting m numbers from a set of m+n numbers, we obtain the identity m+n m n = . m k m−k k
142
2. Combinatorics
That is, the number of possible tickets equals the sum over k of the number of ways to match exactly k of the m winning numbers and m − k of the n losing numbers. More generally still, suppose a lottery game requires a player to select
numbers on a ticket, and each drawing selects m winning numbers. Using the same reasoning, we find that m+n m n = .
k
−k k
Now replace by + p and reindex the sum, replacing k by k + p, to obtain the following identity. Vandermonde’s Convolution. If m and n are nonnegative integers and and p are integers, then m+n m n = . (2.11)
+p p+k
−k k
Notice that the lower indices in the binomial coefficients on the right side sum to a constant. Exercises 1. Use a combinatorial argument to prove that there are exactly 2n different subsets of a set of n elements. (Do not use the binomial theorem.) 2. Prove the absorption/extraction identity: If n is a positive integer and k is a nonzero integer, then n n−1 n = . (2.12) k k k−1 3. Use algebraic methods to prove the cancellation identity: If n and k are nonnegative integers and m is an integer with m ≤ n, then n k n n−m = . (2.13) k m m k−m This identity is very useful when the left side appears in a sum over k, since the right side has only a single occurrence of k. 4. Suppose that a museum curator with a collection of n paintings by Jackson Pollack needs to select k of them for display, and needs to pick m of these to put in a particularly prominent part of the display. Show how to count the number of possible combinations in two ways so that the cancellation identity appears.
2.2 Binomial Coefficients
143
5. Prove the parallel summation identity: If m and n are nonnegative integers, then n
m+k m+n+1 = . (2.14) k n k=0
6. Prove the hexagon identity: If n is a positive integer and k is an integer, then n−1 n n+1 n−1 n n+1 = . (2.15) k−1 k+1 k k k−1 k+1 Why is it called the hexagon identity? 7. Compute the value of the following sums. Your answer should be an expression involving one or two binomial coefficients.
80k + 1 (a) . k 31 k
1 99 200 . (b) k+1 k 120 − k k≥0
201 k
201 j . k + 1 100 k=100 j=100
n2 (d) , for a nonnegative integer n. k k
n , for an integer m and a nonnegative integer n. (−1)k (e) k (c)
k≤m
8. Prove the binomial theorem for falling factorial powers,
n n xk y n−k , (x + y) = k k
and for rising factorial powers, (x + y)n =
n xk y n−k . k k
9. Let n be a nonnegative integer. Suppose f (x) and g(x) are functions defined for all real numbers x, and that both functions are n times differentiable. Let f (k) (x) denote the kth derivative of f (x), so f (0) (x) = f (x), f (1) (x) = f (x), and f (2) (x) = f (x). Let h(x) = f (x)g(x). Show that
n (n) f (k) (x)g (n−k) (x). h (x) = k k
144
2. Combinatorics
10. In the Virginia lottery game Win For Life, an entry consists of a selection of six different numbers between 1 and 42, and each drawing selects seven different numbers in this range. How many different entries can match at least three of the drawn numbers? 11. The state of Florida administers several lottery games. In Florida Lotto, a player picks a set of six numbers between 1 and 53. In Fantasy 5, a gambler chooses a set of five numbers between 1 and 36. In which game is a player more likely to match at least two numbers against the ones drawn?
2.3 Multinomial Coefficients Alba, alma, ball, balm, bama, blam, lama, lamb, ma’am, mall, malm, mama, . . . — Words constructed from letters in “Alma, Alabama” Suppose we want to know the number of ways to place n different objects into two boxes, one marked A and the other marked B, in such a way that box A receives a specified number a of the objects, and box B gets the remaining b objects, so a + b = n. Assume that the order of placement of the objects nin each box is immaterial, and denote the total number of such arrangements by a,b . We can compute this number easily by using our knowledge of binomial coefficients. Since each valid distribution corresponds to a different subset for n of a objects
box A, we see that a,b is simply the binomial coefficient na (or nb ). Thus, n n! a,b = a!b! . Now imagine we have three boxes, labeled A, B, and C, and suppose we want to know the number of ways to place a prescribed number a of the objects in box A, a given number b in box B, and the remaining c = n − a − b in box C. Again, assume the order of
placement of objects in each box is irrelevant, and n denote this number by a,b,c . Since each arrangement can be described by first selecting a elements from the set of n for box A, and then picking b objects from the remaining n − a for box B, we see by the product rule that n n n−a = a, b, c a b n! (n − a)! (2.16) = · a!(n − a)! b!(n − a − b)! n! . = a! b! c! n The number a,b,c is called a trinomial coefficient. We can generalize this problem for an arbitrary number of boxes. Suppose we have n objects, together with m boxes labeled 1, 2, . . . , m, and suppose k1 , k2 , . . . , km are nonnegative integers satisfying k1 + k2 + · · · + km = n. We define the
2.3 Multinomial Coefficients
145
multinomial coefficient k1 ,k2n,...,km to be the number of ways to place k1 of the objects in box 1, k2 in box 2, and so on, without regard to the order of the objects in each box. Then an argument similar to our analysis for trinomial coefficients shows that n n n − k1 n − k1 − k2 = ··· k1 , . . . , km k2 k3 k1 n − k1 − · · · − km−2 (2.17) · km−1 n! = . k1 ! k2 ! · · · km ! Multinomial coefficients often arise in a natural way in combinatorial problems. While we can always reduce questions about multinomial coefficients to problems about binomial coefficients or factorials by using (2.17), it is often useful to handle them directly. We derive some important formulas for multinomial coefficients in this section. These generalize some of the statements about binomial coefficients from Section 2.2. We begin with a more general formula for expanding multinomial coefficients in terms of factorials. Expansion. If n is a nonnegative integer, and k1 , . . . , km are integers satisfying k1 + · · · + km = n, then ⎧ ⎨ n! if each ki ≥ 0, n = k1 ! · · · km ! (2.18) ⎩0 k1 , . . . , km otherwise. n = 0 when at least one of the ki is negative is certainly sensible, Taking k1 ,...,k m since it is impossible to place a negative number of objects in a box. Second, it is clear that rearranging the numbers
k1 , . . . , km does not affect n the value of the multinomial coefficient k1 ,...,k , since this just corresponds to m relabeling the boxes. We can state this in the following way. Symmetry. Suppose π(1), . . . , π(m) is a permutation of {1, . . . , m}. Then n n = . (2.19) k1 , . . . , km kπ(1) , . . . , kπ(m) Third, we can observe a simple addition law. Let α be one of the objects from the set of n. It must be placed in one of the boxes. If we place α in box 1, then n−1 there are k1 −1,k ways to arrange the remaining n − 1 objects to create 2 ,...,km
n−1 a valid arrangement. If we set α in box 2, then there are k1 ,k2 −1,k to 3 ,...,km complete the assignment of objects to boxes. Continuing in this way, we obtain the following identity.
146
2. Combinatorics
Addition. If n is a positive integer and k1 + · · · + km = n, then
n k1 , . . . , km
=
n−1 n−1 + k1 − 1, k2 , . . . , km k1 , k2 − 1, k3 , . . . , km (2.20) n−1 . + ··· + k1 , k2 , . . . , km−1 , km − 1
In the last section, the addition identity for m = 2 produced Pascal’s triangle for the binomial coefficients. We can use a similar strategy to generate a geometric arrangement of the trinomial coefficients when m = 3, which we might call Pascal’s pyramid. The top level of the pyramid corresponds 0 to n = 0, just as in Pascal’s triangle, and here we place a single 1, for 0,0,0 . The next level holds the numbers for n = 1, and we place the three 1s in a triangular
1 formation,
1just
1 below the n = 0 datum at the apex, for the numbers 1,0,0 , 0,1,0 , and 0,0,1 . In general, we use the addition formula (2.20) to compute the numbers in level n n from those in level n − 1, and we place the value of a,b,c in level n just below n−1 n−1 n−1 the triangular arrangement of numbers a−1,b,c , a,b−1,c , and a,b,c−1 in level n−1. Figure 2.1 shows the first few levels of the pyramid of trinomial coefficients. Here, the position of each number in level n is shown relative to the positions of the numbers in level n − 1, each of which is marked with a triangle ().
1
1
1 1
2
1 1
n=0
3
1 4
3 6
3
6
3 3
4
1 1
n=3
1
n=2
1
1
2
n=1
3
2
4 12
12 4
6 12
6 n=4
FIGURE 2.1. The first five levels of Pascal’s pyramid.
4 4
1
2.3 Multinomial Coefficients
147
We can use the addition identity to obtain an important generalization of the binomial theorem for multinomial coefficients. The Multinomial Theorem. If n is a nonnegative integer, then
n n xk1 · · · xkmm . (x1 + · · · + xm ) = k1 , . . . , km 1
(2.21)
k1 +···+km =n
Here, the notation k1 +···+km =n means that the sum extends over all integer m-tuples (k1 , . . . , km ) whose sum is n. Of course, there are infinitely many such m-tuples, but only finitely many produce a nonzero term by the Expansion identity, so this is in effect a finite sum. We prove (2.21) for the case m = 3; the general case is left as an exercise. Proof. The formula n
(x + y + z) =
a+b+c=n
n xa y b z c a, b, c
(2.22)
certainly holds for n = 0, so suppose that it is valid for n. We compute
n n+1 xa y b z c = (x + y + z) (x+y + z) a, b, c a+b+c=n
n
n a+1 b c x y z + xa y b+1 z c = a, b, c a, b, c a+b+c=n a+b+c=n
n xa y b z c+1 + a, b, c a+b+c=n
n n n + + xa y b z c = a − 1, b, c a, b − 1, c a, b, c − 1 a+b+c=n+1
n+1 a b c x y z , = a, b, c a+b+c=n+1
so (2.22) holds for all n ≥ 0. Some additional formulas for multinomial coefficients are developed in the exercises. Some of these may be obtained by selecting particular values for x1 , . . . , xm in the multinomial theorem. We close this section by describing a common way that multinomial coefficients appear in combinatorial problems. Suppose we need to count the number of ways to order a collection of n objects. If all the objects are different, then the answer is simply n!, but what if our collection includes some duplicate objects? Such a collection is called a multiset. Certainly we expect fewer different arrangements when there are some duplicate objects. For example, there are just six ways
148
2. Combinatorics
to line up four poker chips, two of which are red and the other two blue: rrbb, rbrb, rbbr, brrb, brbr, and bbrr. Suppose we have a multiset of size n that includes exactly k1 identical copies of one object, k2 instances of another, and so on, ending with km duplicates of the last object, so k1 + · · · + km = n. In any ordering of these n objects, we may rearrange the ki copies of object i in any way without disturbing the arrangement. Since we can do this for any of the m objects independently, it follows that each distinct ordering of the items occurs k1 !k2 ! · · · km ! times among the n! ways that one could arrange the objects if they had been distinguishable. Therefore, the number of distinct arrangements of our multiset is n! = k1 ! · · · km !
n . k1 , . . . , km
We could also obtain this formula by using our first combinatorial model for the multinomial coefficients. Suppose we have n ping-pong balls, numbered 1 through n, and m boxes, each labeled with a different object from our multiset. The number of ways to distribute the balls among the boxes,
with k1 in box 1, k2 in n box 2, and so on, is the multinomial coefficient k1 ,...,k . But each arrangement m corresponds to an ordering of the elements of our multiset: The numbers in box i indicate the positions of object i in the listing. We have thus answered the analogue of Problem 1 from Section 2.1 for multisets. We can also study a generalization of Problem 2: How many ways are there to make an ordered list of r objects from a multiset of n objects, if the multiset comprises ki copies of object i for 1 ≤ i ≤ m? Our approach to this problem depends on the ki and r, so we’ll study an example. Suppose a contemplative resident of Alma, Alabama, wants to know the number of ways to rearrange the letters of her home town and state, ignoring differences in case. There are eleven letters in all: six As, one B, two Ls, and two Ms, so she computes the total 11 11! number to be 6,1,2,2 = 6!2!2! = 13 860. Suppose she also wants to know the number of four-letter sequences of letters that can be formed from the same string, ALMAALABAMA, like the ones in the list that open this section, only they do not have to be English words. This is the multiset version of Problem 2 with n = 11, r = 4, m = 4, k1 = 6, k2 = 1, and k3 = k4 = 2. We can solve this by constructing each sequence in two steps: first, select four elements from the multiset; second, count the number of ways to order that subcollection. We can group the possible sub-multisets according to their pattern of repeated elements. For example, consider the subcollections that have two copies of one
object, and two copies of another. Denote this pattern by wwxx. There are 32 = 3 ways to select values for w and x, since we must pick two of the three
letters A, L, and M. Each of these subcollections can be ordered 4 in any of 2,2 = 6 ways, so the pattern wwxx produces 3 · 6 = 18 possible four-letter sequences in all. There are five possible patterns for a four-element multiset, which we can denote wwww, wwwx, wwxx, wwxy, and wxyz. The analysis of each one is summarized in the following table.
2.3 Multinomial Coefficients
Pattern wwww wwwx
Sub-multisets 1 3
Orderings per sub-multiset 1 4
1
3,1
4 2,2 4 2,1,1
3
wwxx
2
3 3
wwxy
1
wxyz
2
1
4!
149
Total 1 12 18 108 24
Summing the values in the rightmost column, we find that there are exactly 163 ways to form a four-letter sequence from the letters in Alma, Alabama. Exercises 1. Prove the addition identity for multinomial coefficients (2.20) by using the expansion identity (2.18). 2. For nonnegative integers a, b, and c, let P (a, b, c) denote the number of paths in three-dimensional space that begin at the origin, end at (a, b, c), and consist entirely of steps of unit length, each
of which is parallel to a coordinate axis. Prove that P (a, b, c) = a+b+c a,b,c . 3. Prove the multinomial theorem (2.21) for an arbitrary positive integer m. 4. Prove the following identities for sums of multinomial coefficients, if m and n are positive integers.
n (a) = mn . k1 , . . . , km k1 +···+km
0 if m = 2 , n k2 +k4 +···+k2 (b) (−1) = k1 , . . . , km 1 if m = 2 + 1. k +···+k 1
m
5. Prove that if n is a nonnegative integer and k is an integer, then
n n−k n =2 . j, k, n − j − k k j 6. Prove the multinomial theorem for falling factorial powers,
n k1 km n x1 · · · xm , (x1 + · · · + xm ) = k1 , . . . , km k1 +···+km =n
and for rising factorial powers, (x1 + · · · + xm ) = n
k1 +···+km =n
n km xk1 · · · xm . k1 , . . . , km 1
You may find it helpful to consider the trinomial case first.
150
2. Combinatorics
7. Use a combinatorial argument to establish the following analogue of Vandermonde’s convolution for trinomial coefficients. If m and n are nonnegative integers, and a + b + c = m + n, then
m n m+n = . α, β, γ a − α, b − β, c − γ a, b, c α+β+γ=m
8. State an analogue of Vandermonde’s convolution for multinomial coefficients, and use a combinatorial argument to establish it. 9. Compute the number of r-letter sequences that can be formed by using the letters in each location below, for each given value of r. Ignore differences in case. (a) Bug Tussle, TX: r = 3, r = 4, r = 11. (b) Cooleemee, NC: r = 4, r = 10, r = 11. (c) Oconomowoc, WI: r = 4, r = 11, r = 12. (d) Unalaska, Alaska: r = 3, r = 4, r = 14. (e) Walla Walla, WA: r = 4, r = 5, r = 12. 10. Certainly there are more four-letter sequences that can be formed by using the letters in Bobo, Mississippi, than can be formed by using the letters in Soso, Mississippi. Is the difference more or less than the distance between these two cities in miles, which is 267? 11. A band of combinatorial ichthyologists asserts that the number of five-letter sequences that can be formed using the letters of the Hawaiian long-nosed butterfly fish, the lauwiliwilinukunuku’oi’oi, is more than twice as large as the number of five-letter sequences that can be created using the name of the state fish of Hawaii, the painted triggerfish humuhumunukunukuapua’a. Prove or disprove their claim by computing the exact number in each case.
2.4 The Pigeonhole Principle I am just here for anyone that’s for the pigeons. — Mike Tyson, Phoenix City Council meeting, June 1, 2005, reported in The Arizona Republic We now turn to a simple, but powerful, idea in combinatorial reasoning known as the pigeonhole principle. We can state it in the following way. Theorem 2.1 (Pigeonhole Principle). Let n be a positive integer. If more than n objects are distributed among n containers, then some container must contain more than one object.
2.4 The Pigeonhole Principle
151
The proof is simple—if each container held at most one object, then there would be at most n objects in all. This mathematical idea is also called the box principle (especially in number theory texts), which is sensible enough, since we can imagine the containers as boxes. In German, it is the drawer principle, logically enough, after Dirichlet’s original term, the Schubfachprinzip. It may seem odd to think of our containers as pigeon roosts, but the name probably originally referred to the “pigeonholes” one sees in those old desks with lots of square nooks for squirreling away papers. (One imagines however that the origins of the term may be the subject of some, well, squabbling. . . .) So while the traditional name may be somewhat antiquated, at least the avian nomenclature saves us from talking about Dirichlet’s drawers. The pigeonhole principle is very useful in establishing the existence of a particular configuration or combination in many mathematical contexts. We begin with a few simple examples. 1. Suppose 400 freshmen enroll in introductory calculus one term. Then two must have the same birthday. Here, the pigeonholes are calendar days, so n = 366. 2. In honor of champion pugilist (and pigeon enthusiast) Mike Tyson, suppose that n boxers schedule a round-robin tournament, so each fighter meets every other in a bout, and afterwards no contestant is undefeated. Then each boxer has between 1 and n − 1 wins, so two boxers must have the same record in the tournament. 3. It is estimated that the average full head of hair has 100 000 to 150 000 strands of hair. Let’s assume that the most hirsute among us has less than 250 000 strands of hair on their head. The city of Phoenix has over 1.5 million residents, so it follows that there must be at least two residents with exactly the same number of hairs on their head. Moreover, since only a fraction of the population is bald, the statement surely remains true if we exclude those with no hair at all. (Sorry, Iron Mike.) In this last problem, we can in fact conclude considerably more. The population of Phoenix is more than six times the maximum number of hairs per head, and a moment’s thought reveals that there must in fact exist at least six people in Phoenix with identical hair counts. We can thus state a more powerful pigeonhole principle. Theorem 2.2 (Generalized Pigeonhole Principle). Let m and n be positive integers. If more than mn objects are distributed among n containers, then at least one container must contain at least m + 1 objects. The proof is again easy—if each container held at most m objects then the total number of objects would be at most mn. An alternative formulation of this statement appears in the exercises. Next, we establish the following arithmetic variation on the pigeonhole principle.
152
2. Combinatorics
Theorem 2.3. Suppose a1 , a2 , . . . , an is a sequence of real numbers with mean μ, so μ = (a1 + · · · + an )/n. Then there exist integers i and j, with 1 ≤ i, j ≤ n, such that ai ≤ μ and aj ≥ μ. The proof is again straightforward—if every element of the sequence were strictly greater than μ, then we would have a1 + · · · + an > nμ, a contradiction. Thus, an integer i must exist with ai ≤ μ. A similar argument establishes the existence of j. While the pigeonhole principle and the variations we describe here are all quite simple to state and verify, this idea plays a central role in establishing many decidedly nontrivial statements in mathematics. We conclude this section with two examples. Monotonic Subsequences We say a sequence a1 , . . . , an is increasing if a1 ≤ a2 ≤ · · · ≤ an , and strictly increasing if a1 < a2 < · · · < an . We define decreasing and strictly decreasing in the same way. Consider first an arrangement of the integers between 1 and 10, for example, 3, 5, 8, 10, 6, 1, 9, 2, 7, 4. (2.23) Scan the list for an increasing subsequence of maximal length. Above, we find (3, 5, 8, 10), (3, 5, 8, 9), (3, 5, 6, 7), and (3, 5, 6, 9) all qualify with length 4. Next, scan the list for a decreasing subsequence of maximal length. Here, the best we can do is length 3, achieved by (8, 6, 1), (8, 6, 2), (8, 6, 4), (10, 6, 2), (10, 6, 4), (10, 7, 4), and (9, 7, 4). Is it possible to find an arrangement of the integers from 1 to 10 that simultaneously avoids both an increasing subsequence of length 4 and a decreasing subsequence of length 4? The following theorem asserts that this is not possible. Its statement dates to an early and influential paper of Erd˝os and Szekeres [94], the same one cited in Section 1.8 for its contribution to the development of Ramsey theory. Theorem 2.4. Suppose m and n are positive integers. A sequence of more than mn real numbers must contain either an increasing subsequence of length at least m + 1, or a strictly decreasing subsequence of length at least n + 1. Proof. Suppose that r1 , r2 , . . . , rmn+1 is a sequence of real numbers which contains neither an increasing subsequence of length m + 1, nor a strictly decreasing subsequence of length n + 1. For each integer i with 1 ≤ i ≤ mn + 1, let ai denote the length of the longest increasing subsequence in this sequence of numbers whose first term is ri , and let di denote the length of the longest strictly decreasing subsequence beginning with this term. For example, for the sequence (2.23) we see that a2 = 3 (for 5, 8, 10 or 5, 8, 9), and d2 = 2 (for 5, 1 or 5, 2). By our hypothesis, we know that 1 ≤ ai ≤ m and 1 ≤ di ≤ n for each i, and thus there are only mn different possible values for the ordered pair (ai , di ). However, there are mn + 1 such ordered pairs, so by the pigeonhole principle there exist two integers j and k with j < k such that aj = ak and dj = dk . Denote this pair
2.4 The Pigeonhole Principle
153
by (α, δ), so α = aj = ak and δ = dj = dk . Now let rk , ri2 , . . . , riα denote a maximal increasing subsequence beginning with rk and let rk , ri2 , . . . , riδ denote a maximal strictly decreasing subsequence beginning with this term. If rj ≤ rk , then rj , rk , ri2 , . . . , riα is an increasing subsequence of length α + 1 beginning with rj . On the other hand, if rj > rk , then rj , rk , ri2 , . . . , riδ is a strictly decreasing subsequence of length δ + 1 beginning with rj . In either case, we reach a contradiction. Of course, we can replace “increasing” with “strictly increasing” and simultaneously “strictly decreasing” with “decreasing” in this statement. Approximating Irrationals by Rationals Let α be an irrational number. Since every real interval [a, b] with a < b contains infinitely many rational numbers, certainly there exist rational numbers arbitrarily close to α. Suppose however we restrict the rationals we may select to the set of fractions with bounded denominator. How closely can we approximate α now? More specifically, given an irrational number α and a positive integer Q, does there exist a rational number p/q with 1 ≤ q ≤ Q and α − pq especially small? How small can we guarantee? At first glance, if we select a random denominator q in the range [1, Q], then certainly α lies in some interval ( kq , k+1 q ), for some integer k, so its distance to the nearest multiple of 1/q is at most 1/2q. We might therefore expect that on average we would observe a distance of about 1/4q, for randomly selected q. In view of Theorem 2.3, we might then expect that approximations with distance at most 1/4q must exist. In fact, however, we can establish a much stronger result by using the pigeonhole principle. The following important theorem is due to Dirichlet and his Schubfachprinzip. We first require some notation. For a real number x, let x denote the floor of x, or integer part of x. It is defined to be the largest integer m satisfying m ≤ x. Similarly, the ceiling of x, denoted by x, is the smallest integer m satisfying x ≤ m. Last, the fractional part of x, denoted by {x}, is defined by {x} = x − x. For example, for x = π we have π = 3, π = 4, and {π} = 0.14159 . . . ; for x = 1 we obtain 1 = 1 = 1 and {1} = 0. Theorem 2.5 (Dirichlet’s Approximation Theorem). Suppose α is an irrational real number, and Q is a positive integer. Then there exists a rational number p/q with 1 ≤ q ≤ Q satisfying 1 α − p < . q q(Q + 1) Proof. Divide the real interval [0, 1] into Q + 1 subintervals of equal length: 1 1 2 Q−1 Q Q 0, , , ,..., , , ,1 . Q+1 Q+1 Q+1 Q+1 Q+1 Q+1
154
2. Combinatorics
Since each of the Q + 2 real numbers 0, {α} , {2α} , . . . , {Qα} , 1
(2.24)
lies in [0, 1], by the pigeonhole principle at least two of them must lie in the same subinterval. Each of the numbers in (2.24) can be written in a unique way as rα−s with r and s integers and 0 ≤ r ≤ Q, so it follows that there exist integers r1 , r2 , s1 , and s2 , with 0 ≤ r1 , r2 ≤ Q, such that |(r2 α − s2 ) − (r1 α − s1 )|
1 and d > log2 d
m+1 , 2
then there exists a polynomial h(x) of degree at most d − 1 whose coefficients are all 0, 1, or −1, and which is divisible by (x − 1)m .
2.5 The Principle of Inclusion and Exclusion What we here have to do is to conceive, and invent a notation for, all the possible combinations which any number of class terms can yield; and then find some mode of symbolic expression which shall indicate which of these various compartments are empty or occupied . . . — John Venn, [275, p. 23] Suppose there are 50 beads in a drawer: 25 are glass, 30 are red, 20 are spherical, 18 are red glass, 12 are glass spheres, 15 are red spheres, and 8 are red glass spheres. How many beads are neither red, nor glass, nor spheres? We can answer this question by organizing all of this information using a Venn diagram with three overlapping sets: G for glass beads, R for red beads, and S for spherical beads. See Figure 2.2. We are given that there are eight red glass spheres, so start by labeling the common intersection of the sets G, R, and S in the diagram with 8. Then the region just above this one must have ten elements, since there are 18 red glass beads, and exactly eight of these are spherical. Continuing in this way, we determine the size of each of the sets represented in the diagram, and we
2.5 The Principle of Inclusion and Exclusion
157
conclude that there are exactly twelve beads in the drawer that are neither red, nor glass, nor spheres.
10 G
R
3
8 4
1
5 7
S 12
FIGURE 2.2. A solution using a Venn diagram.
Alternatively, we can answer this question by determining the size of the set G ∪ R ∪ S (does this make us counting GURUS?). Summing the number of elements in the sets G, R, and S produces a number that is too large, since this sum counts the beads that are in more than one of these sets at least twice. We can try to compensate by subtracting the number of elements in the sets G ∩ R, G ∩ S, and R ∩ S from the sum. This produces a total that is too small, since the beads that have all three attributes are counted three times in the first step, then subtracted three times in the second step. Thus, we must add the number of elements in G ∩ R ∩ S to the sum, and we find that |G ∪ R ∪ S| = |G| + |R| + |S| − |G ∩ R| − |G ∩ S| − |R ∩ S| + |G ∩ R ∩ S| . Letting N0 denote the number of beads with none of the three attributes, we then compute N0 = 50 − |G ∪ R ∪ S| = 50 − |G| − |R| − |S| + |G ∩ R| + |G ∩ S| + |R ∩ S| − |G ∩ R ∩ S| = 50 − 25 − 30 − 20 + 18 + 12 + 15 − 8 = 12. This suggests a general technique for solving some similar combinatorial problems. Suppose we have a collection of N distinct objects, and each object may satisfy one or more properties that we label a1 , a2 , . . . , ar . Let N (ai ) denote the number of objects having property ai , let N (ai aj ) signify the number having
158
2. Combinatorics
both property ai and property aj , and in general let N (ai1 ai2 . . . aim ) represent the number satisfying the m properties ai1 , . . . , aim . Let N0 denote the number of objects having none of the properties. We prove the following theorem. Theorem 2.6 (Principle of Inclusion and Exclusion). Using the notation above,
N (ai ) + N (ai aj ) − N (ai aj ak ) + · · · N0 = N − i
m
+ (−1)
i<j
i<j n. (2.86) k Further, because of the correspondence between seating arrangements and permutations, we have
n = n!. (2.87) k k
Consider now the case n = 4 and k = 2. Suppose one knight, delayed by an armor adjustment, picks his place after the first three knights are already seated. If the first three knights are seated at one table, then the last knight must sit at the second table by himself. The number of arrangements % in & this case is the number of ways to seat the first three knights at one table, so 31 = 2. On the other hand, if two of the first three knights occupy one table, and the third sits at the second table, then the last knight may then either join the single knight, or the table with two knights. There are two possibilities in the latter case, since the fourth knight may sit % &on the left side of either of the knights already at %the& table.% Thus, & % there & are 3 32 = 9 possibilities in this case, and we find that 42 = 3 32 + 31 = 11. Figure 2.19 shows these eleven arrangements when Tristram joins Bedivere, Lancelot, and Percival at two tables. This technique generalizes to produce a recurrence relation for these numbers. To seat n knights at k tables, we can first seat n − 1 knights at k − 1 tables, then seat the last knight alone at the kth table. Alternatively, we can seat the first n − 1 knights at k tables, then insert the last knight at one of these tables. This knight must sit on the left side of one of the other n − 1 knights, so there are n − 1 different places to seat the last knight. Therefore, n n−1 n−1 = (n − 1) + , n ≥ 1. (2.88) k k k−1
2.8 More Numbers B L
T
B
P
B
P
L
T
B
L
P
T
L
B
P
T
P
B L
T L
P
B
T
T
B P
L
P
P L
B
T
T
L
229
B
L P
L
T
T
B P
FIGURE 2.19. Seating Bedivere, Lancelot, Percival, and Tristram at two tables.
We can use this formula to compute a triangle of Stirling cycle numbers, just as we used the addition identity for binomial coefficients to obtain Pascal’s triangle. These computations appear in Table 2.5. Recall that for fixed n the generating function for the sequence of binomial coefficients has a particularly nice form: k nk xk = (x + 1)n . We can use the identity (2.88) to obtain an analogous % & representation for the sequence of Stirling cycle numbers. Let Gn (x) = k nk xk . Clearly, G0 (x) = 1, and for n ≥ 1, Gn (x) =
n k
k
= (n − 1)
xk
n − 1 k
k
k
x +
n − 1 k
k−1
xk
= (n − 1)Gn−1 (x) + xGn−1 (x), so Gn (x) = (x+n−1)Gn−1 (x). It is easy to verify by induction that this implies that Gn (x) = x(x + 1)(x + 2) · · · (x + n − 1) = xn . Thus, xn =
n k
k
xk .
(2.89)
230
2. Combinatorics
%n& k
n=0 1 2 3 4 5 6 7 8
k=0 1 2 3 4 5 6 7 8 1 0 1 0 1 1 0 2 3 1 0 6 11 6 1 0 24 50 35 10 1 0 120 274 225 85 15 1 0 720 1764 1624 735 175 21 1 0 5040 13068 13132 6769 1960 322 28 1 TABLE 2.5. Stirling cycle numbers,
%n& k
n! 1 1 2 6 24 120 720 5040 40320
.
for n ≥ 0. Therefore, the Stirling cycle numbers allow us to express rising factorial powers as linear combinations of ordinary powers. Exercise 7 establishes a similar connection for the falling factorial powers. Exercises 1. Use (2.88) and Table 2.5 to compute the values of 2. Prove that
k
%9 & k
and
%10& k
for each k.
⎧ ⎪ if n = 0, ⎨1 k n = −1 if n = 1, (−1) ⎪ k ⎩ 0 if n ≥ 2.
3. Use a combinatorial argument to show that n−1 n n!
1 = . 2 2 m=1 m(n − m) 4. Use a combinatorial argument to determine a simple formula for 5. Use a combinatorial argument to show that
n n+1 n−k k = n m m−1 k=0
for nonnegative integers n and m. 6. Prove that if n and m are nonnegative integers then n+1 n k = . m+1 k m k
%
& .
n n−2
2.8 More Numbers
7. Prove that if n ≥ 0 then xn =
(−1)n−k
k
n k
x = s(n, k)xk . k
231
(2.90)
k
8. Use (2.89) to prove that if n ≥ 0 then n
n y n−k = (1 + ky). k k
k=1
%n&
Then use this to prove that k equals the sum of all products of n − k % & distinct integers selected from {1, . . . , n − 1}. For example, 63 = 1 · 2 · 3 + 1·2·4+1·2·5+1·3·4+1·3·5+1·4·5+2·3·4+2·3·5+2·4·5+3·4·5 = 225. 9. Let d(n, k) denote the number of ways to place n knights at k identical tables, with at least two knights at each table. For example, Figure 2.19 shows that d(4, 2) = 3. Set d(0, 0) = 1. (a) Use a combinatorial argument to show that d(n, k) satisfies the recurrence relation
d(n, k) = (n − 1) d(n − 1, k) + d(n − 2, k − 1) for n ≥ 1. (b) Compute the table of values of d(n, k) for 0 ≤ n ≤ 8, similar to Table 2.5. (c) Prove that if n ≥ 0 then
d(n, k) = n¡,
k
where n¡ denotes the number of derangements of n.
2.8.3 Stirling Set Numbers 36 (Roger Federer, 2006–07), 35 (John McEnroe, 1984), 26 (Stefan Edberg, 1991–92), 25 (Ilie Nastase, 1972–73). — Most consecutive sets won in Grand Slam matches in men’s tennis How many ways are there to divide n guests at a party into exactly k groups, if we disregard the arrangement of people within each group? Rephrased, this problem asks for the number of ways to partition a set of n objects into exactly k nonempty subsets, so that each element in the original set appears exactly once among the k subsets. For example, there are three ways to partition the set {a, b, c} into two nonempty subsets: {a, b}, {c}; {a, c}, {b}; and {b, c}, {a}. There is just one
232
2. Combinatorics
way to partition {a, b, c} into one subset: {a, b, c}, and just one way to partition {a, b, c} into three subsets: {a}, {b}, {c}. (nThe ) number (3)of ways to(divide ) (n3)objects into exactly k groups is denoted by 3 k . Thus, 2 = 3, and 1 = 3 = 1. These numbers are called the Stirling set numbers, or the Stirling numbers of the second kind. The notation S(n, k) is also often used to denote these numbers. We begin by listing a few properties of these numbers. First, for n ≥ 1 we have * * n n = = 1, (2.91) 1 n since there is only one way to place n people into a single group, and only one way to split them into n groups. Second, * 1 if n = 0, n (2.92) = 0 0 if n > 0, since one cannot divide n people into zero groups, unless there are no people. Third, to divide n people into n − 1 groups, we must pick two people to be in one group, then place the rest of the people in groups by themselves, so * n n = . (2.93) n−1 2 Next, we set
* n = 0, if k < 0 or k > n. (2.94) k % & Also, the Stirling cycle number nk distinguishes among the(different ways to ) arrange n people within k groups, and the Stirling set number nk does not, so * n n ≤ (2.95) k k for all n ≥ 0 and all k. ( ) We now derive a recurrence relation for nk . Suppose we plan to divide n ≥ 1 people into k groups for a party, and we know that one person will arrive late. We could divide the first n − 1 people into k − 1 groups, then place the last person in her own group when she arrives, or we can arrange the first n (− 1 people into ) k groups, then pick a group for the last person to join. There are n−1 different k−1 ( ) ways to arrange the guests in the first case, and k n−1 different possibilities in k the second. Therefore, * * * n n−1 n−1 =k + , n ≥ 1. (2.96) k k k−1 For example, to partition the set {a, b, c, d} into two subsets, we can place d in its own set, yielding {a, b, c}, {d}, or we can split {a, b, c} into two sets, then add d
2.8 More Numbers
233
to one of these sets. The latter possibility yields the six different partitions {a, b, d}, {c}; {a, c, d}, {b}; {b, c, d}, {a}; (2.97) {a, b}, {c, d}; {a, c}, {b, d}; {b, c}, {a, d}; () () ( ) and 42 = 2 32 + 31 = 7. Using identity (2.96), we can generate the triangle of Stirling set numbers shown in Table 2.6. The sequence {bn } that appears in this table as the sum across the rows of the triangle is studied in the next section. (n) k
n=0 1 2 3 4 5 6 7 8
k=0 1 0 0 0 0 0 0 0 0
1
2
1 1 1 1 1 1 1 1
3
4
6
7
1 3 1 7 6 1 15 25 10 1 31 90 65 15 1 63 301 350 140 21 127 966 1701 1050 266
1 28
TABLE 2.6. Stirling set numbers,
5
(n) k
8
bn 1 1 2 5 15 52 203 877 1 4140
, and Bell numbers, bn .
Exercise 8 analyzes the generating function for the sequence of Stirling set ( ) numbers nk with n fixed. We can obtain a more useful relation, however, if we replace the ordinary powers of x in this generating function with falling factorial powers. For fixed n, let
n* Fn (x) = xk , k k
so F0 (x) = 1. If n ≥ 1, then
n − 1* n − 1* Fn (x) = k + xk k k−1 k
n − 1*
n − 1* xk+1 = k xk + k k k k *
n − 1*
n−1 k k = k x + (x − k) x k k k
k
= xFn−1 (x), so by induction we obtain xn =
n* xk , k k
n ≥ 0.
(2.98)
234
2. Combinatorics
Therefore, the Stirling set numbers allow us to express ordinary powers as combinations of falling factorial powers. We can derive(another useful formula by considering the generating function ) for the numbers nk with k fixed. Let
n*
Hk (x) =
n≥0
k
xn ,
so H0 (x) = 1. For k ≥ 1, we obtain
n* xn k n≥1
n − 1* n − 1* k + xn = k k−1 n≥1
n*
n * n x +x xn = kx k k−1
Hk (x) =
n≥0
n≥0
= kxHk (x) + xHk−1 (x), so Hk (x) =
x Hk−1 (x), 1 − kx
and therefore Hk (x) =
xk . (1 − x)(1 − 2x) · · · (1 − kx)
(2.99)
Next, we use partial fractions to expand this rational function. Our calculations are somewhat simpler if we multiply by k! first, so we wish to find constants A1 , A2 , . . . , Ak such that +k
k!xk
m=1 (1
− mx)
=
k
Am . 1 − mx m=1
Clearing denominators, we have k!xk =
k
Am
m=1
m−1
k
j=1
j=m+1
(1 − jx)
(1 − jx),
and setting x = 1/m, we obtain m−1 k k! j j , 1− 1− = Am mk m j=m+1 m j=1
2.8 More Numbers
235
so k! = mAm
m−1
k
j=1
j=m+1
(m − j)
(m − j) k
= mAm (m − 1)!(−1)k−m
(j − m)
j=m+1
= (−1)k−m m!(k − m)!Am , and Am = (−1)k−m Thus
k . m
k k 1
k−m m Hk (x) = (−1) k! m=1 1 − mx
k 1
k−m k = (−1) (mx)n k! m=1 m n≥0 k
1
k−m k mn xn , = (−1) k! m=1 m n≥0
and therefore
* k n 1
k = mn , (−1)k−m k! m=0 k m
(2.100)
for any nonnegative integers n and k. This( produces a formula for the Stirling set ) 1 numbers. For example, we may compute 63 = 3! (3 · 16 − 3 · 26 + 1 · 36 ) = 90. Exercises 1. Use (2.96) and Table 2.6 to compute the values of
(9) k
and
(10) k
for each k.
2. A hungry fraternity brother stops at the drive-through window of a fast-food restaurant and orders twelve different items. The server plans to convey the items using either three or four identical cardboard trays, and empty trays are never given to a customer. Use (2.96) and your augmented table from Exercise 1 to determine the number of ways that the server can arrange the items on the trays. ( ) 3. Use arguments to determine simple formulas for n2 and ) ( n combinatorial n−2 . 4. A new casino game takes ten ping-pong balls, each labeled with a different number between 1 and 10, and drops each one at random into one of three identical buckets. A bucket may be empty after the ten balls are dropped.
236
2. Combinatorics
(a) Suppose a bet consists of identifying which balls have landed together in each bucket. For example, a bet may state that one bucket is empty, another has just the balls numbered 2, 3, and 7, and the rest are in the other bucket. How many bets are possible? (b) Suppose instead that a bet consists of identifying only the number of balls that land in the buckets. For example, a bet might state that one bucket is empty, another has three balls, and the other has seven. The numbers on the balls have no role in the bet. How many bets are possible? 5. How many different fifty-character sequences use every character of the 26-letter alphabet at least once? More generally, how many ways can one place n distinguishable objects into k distinguishable bins, if no bin may be empty? ( ) 6. Use (2.99) to prove that nk equals the sum of all products of n−k integers ( ) selected from {1, . . . , k}. For example, 63 = 1 · 1 · 1 + 1 · 1 · 2 + 1 · 1 · 3 + 1 · 2 · 2 + 1 · 2 · 3 + 1 · 3 · 3 + 2 · 2 · 2 + 2 · 2 · 3 + 2 · 3 · 3 + 3 · 3 · 3 = 90. 7. Let rn,k denote the number of ways to divide n people into k groups, with at least two people in each group. For example, the list (2.97) shows that r4,2 = 3. Set r0,0 = 1. (a) Use a combinatorial argument to show that rn,k satisfies the recurrence relation rn,k = krn−1,k + (n − 1)rn−2,k−1 for n ≥ 1.
(b) Define rn for n ≥ 0 by rn = k rn,k . Compute the table of values of rn,k and rn for 0 ≤ n ≤ 8, similar to Table 2.6. (c) Determine a formula for r2n,n , for a positive integer n. (d) A rhyming scheme describes the pattern of rhymes in a poem. For example, the rhyming scheme of a limerick is (a, a, b, b, a), since a limerick has five lines, with the first, second, and last line exhibiting one rhyme, and the third and fourth showing a different rhyme. Also, a sonnet is a poem with fourteen lines. Shakespearean sonnets have the rhyming scheme (a, b, a, b, c, d, c, d, e, f, e, f, g, g); many Petrarchan sonnets exhibit the scheme (a, b, b, a, a, b, b, a, c, d, e, c, d, e). Argue that rn counts the number of possible rhyming schemes for a poem with n lines, if each line must rhyme with at least one other line. ( ) 8. Let Gn (x) = k nk xk , so G0 (x) = 1. Show that Gn (x) = x(Gn−1 (x)+ Gn−1 (x)) for n ≥ 1, and use this recurrence to compute G4 (x).
2.8 More Numbers
9. Show that n
x =
n* k
k
(−1)n−k xk .
237
(2.101)
10. Use (2.90) and (2.98), or (2.89) and (2.101), to prove the following identities.
n k * 1 if n = m, (n−k) (−1) = (2.102) k m 0 otherwise. k
n* k 1 if n = m, (−1)(n−k) = (2.103) k m 0 otherwise. k 11. Prove that
k n xk =
k≥0
n*
k!xk k (1 − x)k+1
k
for any nonnegative integer n. 12. Suppose {r1 , . . . , r } and {s1 , . . . , s } are two sets of positive integers, f (x) = j=1 (xrj − xsj ), and N is a positive integer. Prove that
rjn
j=1
=
snj
j=1
for every n with 1 ≤ n ≤ N if and only if f (n) (1) = 0 for every n with 1 ≤ n ≤ N . Here, f (n) (x) denotes the nth derivative of f (x). For example, select {1, 5, 9, 17, 18} and {2, 3, 11, 15, 19} as the two sets, and select N = 4. Then 1 + 5 + 9 + 17 + 18 = 2 + 3 + 11 + 15 + 19 = 50, 12 + 52 + 92 + 172 + 182 = 22 + 32 + 112 + 152 + 192 = 720, 13 + 53 + 93 + 173 + 183 = 23 + 33 + 113 + 153 + 193 = 11600, and 14 + 54 + 94 + 174 + 184 = 24 + 34 + 114 + 154 + 194 = 195684; and f (x) = x−x2 +x5 −x3 +x9 −x11 +x17 −x15 +x18 −x19 has f (n) (1) = 0 for 1 ≤ n ≤ 4.
2.8.4 Bell Numbers Silence that dreadful bell: it frights the isle. . . — William Shakespeare, Othello, Act II, Scene III The Bell number bn is the number of ways to divide n people into any number of groups. It is therefore a sum of Stirling set numbers,
n* bn = . (2.104) k k
238
2. Combinatorics
The first few values of this sequence appear in Table 2.6. We can derive a recurrence relation for the Bell numbers. To divide n people into groups, consider the different ways to form a group containing one particular person. We must choose some number k of the other n − 1 people to join this person in one group, then divide the other n − 1 − k people into groups. It follows that
n − 1 bn = bn−1−k . k k
Reindexing the sum by replacing k with n − 1 − k, then applying the symmetry identity for binomial coefficients, we find the somewhat simpler relation
n − 1 bn = bk , n ≥ 1. (2.105) k k
Rather than analyze the ordinary generating function for the sequence of Bell numbers, we introduce another kind of generating function that is often useful in combinatorial analysis. The exponential generating function for the sequence {an } is defined as the ordinary generating function for the sequence {an /n!}. For example, the exponential generating function for the constant sequence an = c is n x n n≥0 cx /n! = ce , and for the sequence an = (−1) n!, it is 1/(1 + x). The exponential generating function for the sequence of Bell numbers is therefore E(x) =
bn xn . n!
n≥0
We can compute a closed form for this series. Differentiating, we find
bn xn−1 (n − 1)! n≥1
n − 1 1 bk xn−1 = (n − 1)! k
E (x) =
n≥1
=
n−1
n≥1 k=0
=
k
bk xn−1 k!(n − 1 − k)!
k≥0 n≥k+1
bk xn−1 k!(n − 1 − k)!
bk xn+k k!n! k≥0 n≥0
bk
xn xk = n! k! =
n≥0
= ex E(x).
k≥0
(2.106)
2.8 More Numbers
Therefore,
239
(ln E(x)) = ex , and so ln E(x) = ex + c for some constant c. Since E(0) = b0 = 1, we must have c = −1. Thus, x
E(x) = ee
−1
.
(2.107)
We can use this closed form to determine a formula for bn . Using the Maclaurin series for the exponential function twice, we find that 1 ex e e k 1 (ex ) = e k!
E(x) =
k≥0
1 1 (kx)n e k! n! k≥0 n≥0 1 k n xn . = e k! n!
=
n≥0
Therefore, bn =
k≥0
1 kn . e k!
(2.108)
k≥0
This formula is sometimes called Dobi´nski’s formula [79]. Exercises 1. How many ways are there to put ten different dogs into pens, if each pen can hold any number of dogs, and every pen is exactly the same? 2. Determine a closed form for the exponential generating function for each of the following sequences. (a) ak = ck , with c a constant. (b) ak = 1 if k is even and 0 if k is odd. (c) ak = k. (d) ak = k n , for a fixed nonnegative integer n. The number of terms in the answer may depend on n. 3. Verify that equation (2.108) for bn produces the correct value for b0 , b1 , and b2 . 4. Show that the series in equation (2.108) converges for every n ≥ 0.
240
2. Combinatorics
5. Use a combinatorial argument to show that * * n n−1 n−k−1 = m k m−1 k *
n−1 k , = k m−1
(2.109)
k
for n ≥ 1, and use this to derive the recurrence (2.105) for Bell numbers. 6. Define the complementary Bell number ,bn for n ≥ 0 by *
n ,bn = . (−1)k k k
Wilf asked if ,bn = 0 for infinitely many n, or if there even exists an integer n > 2 where ,bn = 0. The first few complementary Bell numbers are 1, −1, 0, 1, 1, −2, −9, −9, 50, 267, 413, −2180, −17731, −50533, and 110176. (a) Describe a combinatorial interpretation of ,bn . (b) Use (2.109) to determine a recurrence for the complementary Bell numbers. Then determine a closed form for their exponential generat, ing function, E(x). How is this function related to the function E(x) of this section? , (c) Use E(x) to determine a formula for ,bn , similar to the expression (2.108) for bn . It is known that the sequence , bn changes sign infinitely often, and that ,bn = 0 for almost all values of n. See Yang [289] and de Wannemacker, Laffey, and Osburn [71] for more information on this problem. 7. Suppose P (x) is the exponential generating function for the sequence {pn }, and Q(x) is the exponential generating function for {qn }. Prove that the product P (x)Q(x) is the exponential generating function for the sequence { k nk pk qn−k }. 8. Let rn denote the number of rhyming schemes for a poem with n lines, if each line must rhyme with at least one other line, as in Exercise 7d of Section 2.8.3. Recall that r0 = 1. (a) Prove that rn =
n−2
k=0
n−1 rk . k
(b) Determine a closed form similar to (2.107) for the exponential generating function R(x) for the sequence {rn }.
2.8 More Numbers
241
(c) Use this generating function, together with Exercise 7, to show that
n rn = (−1)n−k bk . k k
(d) Prove that the number of rhyming schemes for n + 1 lines in which each line rhymes with at least one other line equals the number of rhyming schemes for n lines in which at least one line rhymes with no other line. Note that bn is the total number of rhyming schemes on n lines, including schemes where some lines rhyme with no others. 9. Let Ek (x) denote the exponential generating function for the sequence of Stirling cycle numbers with k fixed,
n xn Ek (x) = . k n! n≥0
Prove that Ek (x) =
Ek−1 (x) , 1−x
for k ≥ 1, and use this to derive a closed form for Ek (x),
n xn (−1)k = (ln(1 − x))k . k! k n!
(2.110)
n≥0
Comtet [60] uses this identity, together with (2.100) and (2.113), to derive a complicated formula due to Schl¨omilch for the Stirling cycle numbers. We include it here without proof: n−k *
n 2n − k n−k+m n−k−m n − 1 + m = (−1) k k−1 n−k−m m m=0 (2.111) n−k+m n−1+m 2n − k m j . (−1)n−k−j = m! k − 1 n − k − m j m=0 j=0 m n−k
(2.112) 10. Use an argument similar to that of Exercise 9 to prove that
n* xn 1 x k = (e − 1) k! k n! n≥0
for every k ≥ 0.
(2.113)
242
2. Combinatorics
2.8.5 Eulerian Numbers 3 (Al Hamilton), 7 (Paul Coffey), 11 (Mark Messier), 17 (Jari Kurri), 31 (Grant Fuhr), 99 (Wayne Gretzky). — Retired jersey numbers, Edmonton Oilers Suppose that a pipe organ having n pipes needs to be installed at a concert hall. Each pipe has a different length, and the pipes must be arranged in a single row. Let us say that two adjacent pipes in an arrangement form an ascent if the one on the left is shorter than the one on the right, and a descent otherwise. Arranging the pipes from shortest to tallest yields an arrangement with n − 1 ascents and no descents; arranging them from tallest to shortest results in no ascents and n − 1 descents. Whether for aesthetic or acoustical reasons, the eccentric director of the concert hall demands that there be exactly k ascents in the arrangement of the n pipes. How The answer is the Eulerian number -n. many ways are there to install the -norgan? . . Stated in more abstract terms, is the number of permutations π of the k k integers {1, . . . , n} having π(i) < π(i + 1) for exactly k numbers i between 1 and n − 1. We list a few properties of these numbers. It is easy to see that there is only one arrangement of n pipes with no ascents, and only one with n − 1 ascents, so / 0 n = 1, n ≥ 0, (2.114) 0 and
/
n n−1
0 = 1,
n ≥ 1.
(2.115)
The Eulerian numbers have a symmetry property similar to that of the binomial coefficients. An arrangement of n pipes with k ascents has n − 1 − k descents, so reversing this arrangement yields a complementary configuration with n − 1 − k ascents and k descents. Thus, / 0 / 0 n n = . (2.116) k n−1−k Next, by summing over k we count every possible arrangement of pipes precisely once, so
/n0 = n!. (2.117) k k
We also note the degenerate cases / 0 n = 0, if n > 0, and k < 0 or k ≥ n, k and
/ 0 0 = 0, k
if k = 0.
(2.118)
(2.119)
2.8 More Numbers
243
We can derive a recurrence relation for the Eulerian numbers. To arrange n pipes with exactly k ascents, suppose we first place every pipe except the tallest into a configuration with exactly k ascents. Then the tallest pipe can be inserted either in the first position, or between two pipes forming any ascent. Any other position would yield an additional ascent. There are therefore k + 1 different places to insert the tallest pipe in this case. Alternatively, we can line up the n − 1 shorter pipes so that there are k − 1 ascents, then insert the last pipe either at the end of the row, or between two pipes forming any descent. There are n − 2 − (k − 1) = n − k − 1 descents, so there are n − k different places to insert the tallest pipe in this case. It is impossible to create a permissible configuration by inserting the tallest pipe into any other arrangement of the n − 1 shorter pipes, so / 0 / 0 / 0 n n−1 n−1 = (k + 1) + (n − k) , k k k−1
n ≥ 1.
(2.120)
-. -. -. -. -. -. For example, 31 = 2 21 + 2 20 = 4, and 42 = 3 32 + 2 31 = 3 + 8 = 11. Figure 2.20 shows these eleven arrangements of four pipes with two ascents. We can use the recurrence (2.120) to compute the triangle of Eulerian numbers, shown in Table 2.7. -n. k
n=0 1 2 3 4 5 6 7 8
k=0 1 1 1 1 1 1 1 1 1
1
2
3
4
5
6
1 4 1 11 11 1 26 66 26 1 57 302 302 57 1 120 1191 2416 1191 120 247 4293 15619 15619 4293
1 247
TABLE 2.7. Eulerian numbers,
-n. k
7
n! 1 1 2 6 24 120 720 5040 1 40320
.
Next, we study some generating functions involving the Eulerian numbers. Recall that in Section 2.6.5 we computed the generating function for the sequence 1 {0, 1, 2, 3, . . .} by differentiating both sides of the identity k≥0 xk = 1−x , then multiplying by x:
k≥0
1 x d d k = =x· kx = x · x . dx dx 1 − x (1 − x)2 k
k≥0
(2.121)
244
2. Combinatorics
FIGURE 2.20. Four organ pipes with two ascents.
Clearly, we can obtain a generating function for the sequence of squares {k 2 } by applying the same differentiate-and-multiply operator to (2.121). We find that
x d k 2 xk = x · dx (1 − x)2 k≥0 2x 1 (2.122) =x + (1 − x)3 (1 − x)2 x(1 + x) . = (1 − x)3 In the same way, we may use this operator to calculate the generating function for the sequence of cubes, then fourth powers and fifth powers. After a bit of
2.8 More Numbers
245
simplifying, we find that
k 3 xk =
x(1 + 4x + x2 ) , (1 − x)4
(2.123)
k 4 xk =
x(1 + 11x + 11x2 + x3 ) , (1 − x)5
(2.124)
k 5 xk =
x(1 + 26x + 66x2 + 26x3 + x4 ) . (1 − x)6
(2.125)
k≥0
k≥0
k≥0
A glance at Table 2.7 shows that the coefficients appearing on the right side of these -n. formulas are all Eulerian numbers, and we would suspect that the numbers k will appear in the generating function for the sequence of nth powers of integers. This is in fact the case. Theorem 2.16. If n ≥ 0 then
k≥1
/n0 x xk . k x = (1 − x)n+1 k n k
(2.126)
k
Proof. We use induction on n. The formula is easy to verify when n = 0, so we assume it holds for a nonnegative integer n. We calculate d n k k x =x· k x dx k≥1 k≥1
/ n0 x d k x =x· dx (1 − x)n+1 k k / 0
/n0 1 n + 1 n k+1 k =x (k + 1)x + x (1 − x)n+1 (1 − x)n+2 k k k k
/ n0
/ n 0 x k k (1 − x) = (k + 1)x + (n + 1) x (1 − x)n+2 k k−1 k k / 0 / 0
x n k
n = (k + 1) x + (n + 1 − k) xk (1 − x)n+2 k k−1 k k
/n + 10 x xk . = (1 − x)n+2 k
n+1 k
k
The last step follows from the recurrence relation (2.120).
246
2. Combinatorics
- . We can use (2.126) to obtain a formula for nk in terms of binomial coefficients and powers. We calculate
/n0 (1 − x)m+1 n m xk = m x x k m≥1 k
n + 1 (−1)j xj = (m + 1)n xm j j m≥0 (2.127)
j n+1 n j+m (m + 1) x = (−1) j m≥0 j≥0
=
n+1 (k + 1 − j)n xk . (−1) j j=0
k
k≥0
j
Now the first and last expressions in (2.127) are power series-in. x, so we can equate coefficients to obtain a formula for the Eulerian number nk . We find that / 0
k n n+1 = (k + 1 − j)n . (−1)j k j j=0
(2.128)
Last, we derive one more interesting identity involving Eulerian numbers, binomial coefficients, - and . ordinary powers. Consider a sort of generating function
for the sequence { nk } with n fixed, where we use the binomial coefficient x+k n in place of xk . Let
/n0x + k , Fn (x) = k n k
so that F0 (x) = 1. For n ≥ 1, we calculate / 0 / 0
n−1 n−1 x+k (k + 1) + (n − k) Fn (x) = k k−1 n k / 0 / 0
n−1 x+k n−1 x+k = (k + 1) + (n − k) k n k−1 n k k / 0
/ 0
n−1 x+k n−1 x+k+1 (k + 1) + (n − k − 1) . = k n k n k
k
by the sum Combining the two sums on the right, and replacing the term x+k+1 n x+k x+k + , we find that n n−1
/n − 10 x + k x+k Fn (x) = n + (n − k − 1) k n n−1 k / 0
n − 1 (x + k)n−1
(x + k − n + 1) + (n − k − 1) = (n − 1)! k k
2.8 More Numbers
=x
247
/n − 10x + k n−1
k
k
= xFn−1 (x). Therefore, Fn (x) = xn , so we obtain xn =
/n0x + k , k n
n ≥ 0.
(2.129)
k
This is known as Worpitzky’s identity [287]. Thus, Eulerian numbers allow us to write ordinary powers as linear binomial of certain x+2 generalized x+3 combinations coefficients. For example, x4 = x4 + 11 x+1 + 11 + . 4 4 4 Exercises 1. Use an ordinary generating function to find a simple formula for verify your formula using (2.128).
-n. 1 , and
2. Let En (x) denote the polynomial En (x) =
/ n0 xk . k k
Use (2.126) to show that the exponential generating function for the sequence of polynomials {En (x)}n≥0 is E(x, t) = That is, show that E(x, t) =
1−x . −x
et(x−1)
En (x)tn . n!
n≥0
3. (From [282].) Use (2.126) and Exercise 11 of Section 2.8.3 to prove that
/ n0
n* 2k = k! k k k
k
for any nonnegative integer n. 4. Use (2.128) to establish the following identity for n ≥ 1: n (j + 1)n−1 = 0. (−1) j j=0
n
j
248
2. Combinatorics
5. A neurotic running back for an American football team will run between two offensive linemen only if the jersey number of the player on the left is less than the jersey number of the player on the right. The player will not run outside the last player on either end of the offensive line. The coach wants to be sure that the running back has at least three options on every play. If the coach always puts seven players on the offensive line, and there are fifteen players on the team capable of playing any position on the offensive line, each of whom has a different jersey number, how many formations of linemen are possible?
2.9 Stable Marriage How do I love thee? Let me count the ways. — Elizabeth Barrett Browning, Sonnet 43, Sonnets from the Portuguese Most of the problems we have considered in this chapter are questions in enumerative combinatorics, concerned with counting arrangements of objects subject to various constraints. In this section we consider a very different kind of combinatorial problem. Suppose we must arrange n marriages between n men and n women. Each man supplies us with a list of the women ranked according to his preference; each woman does the same for the men. Is there always a way to arrange the marriages so that no unmatched man and woman prefer each other to their assigned spouses? Such a pairing is called a stable matching. Consider a simple example with n = 2. Suppose Aaron prefers Yvonne over Zo¨e, and Bj¨orn prefers Zo¨e over Yvonne. We denote these preferences by A : Y > Z, B : Z > Y. Suppose also that Yvonne and Zo¨e both prefer Aaron over Bj¨orn, so Y : A > B, Z : A > B. Then the matching of Aaron with Zo¨e and Bj¨orn with Yvonne is unstable, since Aaron and Yvonne prefer each other over their partners. The preferences of Bj¨orn and Zo¨e are irrelevant: Indeed, Zo¨e would prefer to remain with Aaron in this case. On the other hand, the matching of Aaron with Yvonne and Bj¨orn with Zo¨e is stable, for no unmatched pair prefers to be together over their assigned partners. The stable marriage problem is a question of existential combinatorics, since it asks whether a particular kind of arrangement exists. We might also consider it as a problem in constructive combinatorics, if we ask for an efficient algorithm for
2.9 Stable Marriage
249
finding a stable matching whenever one does exist. In fact, we develop just such an algorithm in Section 2.9.1. The stable marriage problem and its variations have many applications in problems involving scheduling and assignments. We mention three examples. 1. Stable Roommates. Suppose 2n students at a university must be paired off and assigned to n dorm rooms. Each student ranks all of the others in order of preference. A pairing is stable if no two unmatched students prefer to room with each other over their assigned partners. Must a stable pairing always exist? This variation of the stable marriage problem, known as stable roommates, is considered in Exercise 1. 2. College Admissions. Suppose a number of students apply for admission to a number of universities. Each student ranks the universities, and each university ranks the students. Is there a way to assign the students to universities in such a way that no student and university prefer each other over their assignment? This problem is similar to the original stable marriage question, since we are matching elements from two sets using information on preferences. However, there are some significant differences—probably not every student applies to every university, and each university needs to admit a number of students. Some variations on the stable marriage problem that cover extensions like these are considered in Section 2.9.2. 3. Hospitals and Residents. The problem of assigning medical students to hospitals for residencies is similar to the problem of matching students and universities: Each medical student ranks hospital residency programs in order of preference, and each hospital ranks the candidates. In this case, however, a program has been used to make most of the assignments in the U.S. since 1952. The National Resident Matching Program was developed by a group of hospitals to try to ensure a fair method of hiring residents. Since medical students are not obligated to accept the position produced by the matching program, it is important that the algorithm produce a stable matching. (Since the program’s inception, a large majority of the medical students have accepted their offer.) We describe this matching algorithm in the next section. Exercises 1. Suppose that four fraternity brothers, Austin, Bryan, Conroe, and Dallas, need to pair off as roommates. Each of the four brothers ranks the other three brothers in order of preference. Prove that there is a set of rankings for which no stable matching of roommates exists.
250
2. Combinatorics
2. Suppose M1 and M2 are two stable matchings between n men and n women, and we allow each woman to choose between the man she is paired with in M1 and the partner she receives in M2 . Each woman always chooses the man she prefers. Show that the result is a stable matching between the men and the women. 3. Suppose that in the previous problem we assign each woman the man she likes less between her partners in the two matchings M1 and M2 . Show that the result is again a stable matching. 4. The following preference lists for four men, {A, B, C, D}, and four women, {W, X, Y, Z}, admit exactly ten different stable matchings.
A B C D
1 W X Y Z
2 X W Z Y
3 Y Z W X
4 Z Y X W
W X Y Z
1 D C B A
2 C D A B
3 B A D C
4 A B C D
(a) Prove that the matching {(A, X), (B, Z), (C, W ), (D, Y )} is stable. (b) Determine the remaining nine stable matchings.
2.9.1 The Gale–Shapley Algorithm Matchmaker, matchmaker, make me a match! — Chava and Hodel, Fiddler on the Roof In 1962, Gale and Shapley [117] proved that a stable matching between n men and n women always exists by describing an algorithm for constructing such a matching. Their algorithm is essentially the same as the one used by the hospitals to select residents, although apparently no one realized this for several years [143, chap. 1]. In the algorithm, we first choose either the men or the women to be the proposers. Suppose we select the men; the women will have their chance soon. Then the men take turns proposing to the women, and the women weigh the offers that they receive. More precisely, the Gale–Shapley algorithm has three principal steps. Algorithm 2.17 (Gale–Shapley). Construct a stable matching. Input.
A set of n men, a set of n women, a ranked list of the n women for each man, and a ranked list of the n men for each woman.
Output.
A stable matching that pairs the n men and n women.
Description.
2.9 Stable Marriage
251
Step 1. Label every man and woman as free. Step 2. While some man m is free, do the following. Let w be the highest-ranked woman on the preference list of m to whom m has not yet proposed. If w is free, then label m and w as engaged to each other. If w is engaged to m and w prefers m over m , then label m as free and label m and w as engaged to one another. Otherwise, if w prefers m over m, then w remains engaged to m and m remains free. Step 3. Match all of the engaged couples. For example, consider the problem of arranging marriages between five men, Mack, Mark, Marv, Milt, and Mort, and five women, Walda, Wanda, Wendy, Wilma, and Winny. The men’s and women’s preferences are listed in Table 2.8.
Mack Mark Marv Milt Mort
1 Winny Wanda Winny Winny Wanda
2 Wilma Winny Walda Wilma Winny
3 Wanda Wendy Wanda Wanda Walda
4 Walda Wilma Wilma Wendy Wilma
5 Wendy Walda Wendy Walda Wendy
Walda Wanda Wendy Wilma Winny
Milt Milt Mort Mark Marv
Mort Marv Mack Mort Mort
Mack Mort Milt Milt Mark
Mark Mark Mark Mack Milt
Marv Mack Marv Marv Mack
TABLE 2.8. Preferences for five men and women.
First, Mack proposes to Winny, who accepts, and Mark proposes to Wanda, who also accepts. Then Marv proposes to Winny. Winny likes Marv much better than her current fianc´e, Mack, so Winny rejects Mack and becomes engaged to Marv. This leaves Mack without a partner, so he proceeds to the second name on his list, Wilma. Wilma currently has no partner, so she accepts. Our engaged couples are now (Mack, Wilma), (Mark, Wanda), and (Marv, Winny). Next, Milt proposes to his first choice, Winny. Winny prefers her current partner, Marv, so she rejects Milt. Milt proceeds to his second choice, Wilma. Wilma rejects Mack in favor of Milt, and Mack proposes to his third choice, Wanda. Wanda prefers to remain with Mark, so Mack asks Walda, who accepts. Our engaged couples are now (Mack, Walda), (Mark, Wanda), (Marv, Winny), and (Milt, Wilma).
252
2. Combinatorics
Now our last unmatched man, Mort, asks his first choice, Wanda. Wanda accepts Mort over Mark, then Mark asks his second choice, Winny. Winny rejects Mark in favor of her current partner, Marv, so Mark proposes to his third choice, Wendy. Wendy is not engaged, so she accepts. Now all the men and women are engaged, so we have our matching: (Mack, Walda), (Mark, Wendy), (Marv, Winny), (Milt, Wilma), and (Mort, Wanda). We prove that this is in fact a stable matching. Theorem 2.18. The Gale–Shapley algorithm produces a stable matching. Proof. First, each man proposes at most n times, so the procedure must terminate after at most n2 proposals. Thus, the procedure is an algorithm. Second, the algorithm always produces a matching. This follows from the observations that a woman, once engaged, is thereafter engaged to exactly one man, and every man ranks every woman, so the last unmatched man must eventually propose to the last unmatched woman. Third, we prove that the matching is stable. Suppose m prefers w to his partner in the matching. Then m proposed to w, and was rejected in favor of another suitor. This suitor is ranked higher than m by w, so w must prefer her partner in the matching to m. Therefore, the matching is stable. We remark that the Gale–Shapley algorithm is quite efficient: A stable matching is always found after at most n2 proposals. (Exercise 8 establishes a better upper bound.) Suppose that we choose the women as the proposers. Does the algorithm produce the same stable matching? We test this by using the lists of preferences in Table 2.8. First, Walda proposes to Milt, who accepts. Next, Wanda proposes to Milt, and Milt prefers Wanda over Walda, so he accepts. Walda must ask her second choice, Mort, who accepts. Then Wendy proposes to Mort, who declines, so she asks Mack, and Mack accepts. Last, Wilma asks Mark, and Winny proposes to Marv, and both accept. We therefore obtain a different stable matching: (Walda, Mort), (Wanda, Milt), (Wendy, Mack), (Wilma, Mark), and (Winny, Marv). Only Winny and Marv are paired together in both matchings; everyone else receives a higher-ranked partner precisely when he or she is among the proposers. Table 2.9 illustrates this for the two different matchings. The pairing obtained with the men as proposers is in boldface; the matching resulting from the women as proposers is underlined. The next theorem shows that this is no accident. The proposers always obtain the best possible stable matching, and those in the other group, which we call the proposees, always receive the worst possible stable matching. We define two terms before stating this theorem. We say a stable matching is optimal for a person p if p can do no better in any stable matching. Thus, if p is matched with q in an optimal matching for p, and p prefers r over q, then there is no stable matching
2.9 Stable Marriage
Mack Mark Marv Milt Mort
1 Winny Wanda Winny Winny Wanda
2 Wilma Winny Walda Wilma Winny
3 Wanda Wendy Wanda Wanda Walda
4 Walda Wilma Wilma Wendy Wilma
5 Wendy Walda Wendy Walda Wendy
Walda Wanda Wendy Wilma Winny
Milt Milt Mort Mark Marv
Mort Marv Mack Mort Mort
Mack Mort Milt Milt Mark
Mark Mark Mark Mack Milt
Marv Mack Marv Marv Mack
253
TABLE 2.9. Two stable matchings.
where p is paired with r. Similarly, a stable matching is pessimal for p if p can do no worse in any stable matching. So if p is matched with q in a pessimal matching for p, and p prefers q over r, then there is no stable matching where p is paired with r. Finally, a stable matching is optimal for a set of people P if it is optimal for every person p in P , and likewise for a pessimal matching. Theorem 2.19. The stable matching produced by the Gale–Shapley algorithm is independent of the order of proposers, optimal for the proposers, and pessimal for the proposees. Proof. Suppose the men are the proposers. We first prove that the matching produced by the Gale–Shapley algorithm is optimal for the men, regardless of the order of the proposers. Order the men in an arbitrary manner, and suppose that a man m and woman w are matched by the algorithm. Suppose also that m prefers a woman w over w, denoted by m : w > w, and assume that there exists a stable matching M with m paired with w . Then m was rejected by w at some time during the execution of the algorithm. We may assume that this was the first time a potentially stable couple was rejected by the algorithm. Say w rejected m in favor of another man m , so w : m > m. Then m has no stable partner he prefers over w , by our assumption. Let w be the partner of m in the matching M . Then w = w , since m is matched with w in M , and so m : w > w . But then m and w prefer each other to their partners in M , and this contradicts the stability of M . The optimality of the matching for the proposers is independent of the order of the proposers, so the first statement in the theorem follows immediately. Finally, we show that the algorithm is pessimal for the proposees. Suppose again that the men are the proposers. Assume that m and w are matched by the algorithm, and that there exists a stable matching M where w is matched with a man m and w : m > m . Let w be the partner of m in M . Since the Gale– Shapley algorithm produces a matching that is optimal for the men, we have m :
254
2. Combinatorics
w > w . Therefore, m and w prefer each other over their partners in M , and this contradicts the stability of M . Exercises 1. Our four fraternity brothers, Austin, Bryan, Conroe, and Dallas, plan to ask four women from the neighboring sorority, Willa, Xena, Yvette, and Zelda, to a dance on Friday night. Each person’s preferences are listed in the following table.
Austin Bryan Conroe Dallas
1 Yvette Willa Yvette Willa
2 Xena Yvette Xena Zelda
3 Zelda Xena Zelda Yvette
4 Willa Zelda Willa Xena
Willa Xena Yvette Zelda
Austin Dallas Dallas Austin
Dallas Bryan Bryan Dallas
Conroe Austin Conroe Conroe
Bryan Conroe Austin Bryan
(a) What couples attend the dance, if each man asks the women in his order of preference, and each woman accepts the best offer she receives? (b) Suppose the sorority hosts a “Sadie Hawkins” dance the following weekend, where the women ask the men out. Which couples attend this dance? 2. Determine the total number of stable matchings that pair the four men Axel, Buzz, Clay, and Drew with the four women Willow, Xuxa, Yetty, and Zizi, given the following preference lists.
Axel Buzz Clay Drew
1 Yetty Yetty Zizi Xuxa
2 Willow Xuxa Yetty Zizi
3 Zizi Zizi Xuxa Willow
4 Xuxa Willow Willow Yetty
Willow Xuxa Yetty Zizi
Buzz Buzz Drew Axel
Drew Axel Clay Drew
Axel Clay Axel Buzz
Clay Drew Buzz Clay
3. Determine a list of preferences for four men and four women where no one obtains his or her first choice, regardless of who proposes.
2.9 Stable Marriage
255
4. Determine a list of preferences for four men and four women where one proposer receives his or her lowest-ranked choice. 5. Determine a list of preferences for four men and four women where one proposer receives his or her lowest-ranked choice, and the rest of the proposers receive their penultimate choice. 6. Suppose that all the men have identical preference lists in an instance of the stable marriage problem. Show that there exists exactly one stable matching by completing the following argument. Let M be the matching obtained by the Gale-Shapley algorithm using the men as proposers, and suppose another stable matching M exists. Among all women who change partners between M and M , let w be the woman who ranks lowest on the men’s common preference list. Suppose m and w are matched in M , and m and w in M . Determine a contradiction. 7. Suppose that the preference lists of the men m1 , . . . , mn and the women w1 , . . . , wn have the property that mi ranks wi ahead of each of the women wi+1 , . . . , wn , and wi ranks mi ahead of each of the men mi+1 , . . . , mn , for each i. (a) Show that the matching (m1 , w1 ), . . . , (mn , wn ) is stable. (b) (Eeckhout [86].) Show that this is the unique stable matching in this case. (c) Prove that there are (n!)n−1 different sets of preference lists for m1 , . . . , mn that have the property that mi ranks wi ahead of each of the women wi+1 , . . . , wn , for each i. (d) Prove that at least 1/n! of the possible instances of the stable marriage problem for n couples admits a unique solution. 8. (Knuth [178].) Prove that the Gale–Shapley algorithm terminates after at most n2 − n + 1 proposals by showing that at most one proposer receives his or her lowest-ranked choice. 9. Suppose that more than one woman receives her lowest-ranked choice when the men propose. Prove that there exist at least two stable matchings between the men and the women.
2.9.2 Variations on Stable Marriage I want what any princess wants—to live happily ever after, with the ogre I married. — Princess Fiona, Shrek 2 The stable marriage problem solves matching problems of a rather special sort. Each member of one set must rank all the members of the other set, and the two
256
2. Combinatorics
sets must have the same number of elements. In this section, we consider several variations of the stable marriage problem, in order to apply this theory much more broadly. In each case, we study two main questions. First, how does the change affect the existence and structure of the stable pairings? Second, can we amend the Gale-Shapley algorithm to construct a stable matching in the new setting? Unacceptable Partners Suppose each of n men and n women ranks only a subset of their potential mates. Potential partners omitted from a person’s list are deemed unacceptable to that person, and we do not allow any pairing in which either party is unacceptable to the other. Clearly, we cannot in general guarantee even a complete matching, since for instance a confirmed bachelor could mark all women as unacceptable. This suggests a modification of our notion of a stable matching for this problem. We say a matching (or partial matching) M is unstable if there exists a man m and woman w who are unmatched in M , each of whom is acceptable to the other, and each is either single in M , or prefers the other to their partner in M . We will show that every such problem admits a matching that is stable in this sense, and further that every stable matching pairs the same subcollection of men and women. We first require a preliminary observation. We say a person p prefers a matching M1 over a matching M2 if p strictly prefers his or her partner in M1 to p’s match in M2 . Lemma 2.20. Suppose M1 and M2 are stable matchings of n men and n women, whose preference lists may include unacceptable partners. If m and w are matched in M1 but not in M2 , then one of m or w prefers M1 over M2 , and the other prefers M2 over M1 . Proof. Suppose m0 and w0 are paired in M1 but not M2 . Then m0 and w0 cannot both prefer M1 , since otherwise M2 would not be stable. Suppose that both prefer M2 . Then both have partners in M2 , so suppose (m0 , w1 ) and (m1 , w0 ) are in M2 . Both m0 and w1 cannot prefer M2 , since M1 is stable, so w1 must prefer M1 , and likewise m1 must prefer M1 . These two cannot be paired in M1 , so denote their partners in M1 by m2 and w2 . By the same reasoning, both of these people must prefer M2 , but cannot be matched together in M2 , so we obtain m3 and w3 , who prefer M1 , but are not paired to each other in M1 . We can continue this process indefinitely, obtaining a sequence m0 , w0 , m2 , w2 , m4 , w4 , . . . of distinct men and women who prefer M2 over M1 , and another sequence m1 , w1 , m3 , w3 , . . . of different people who prefer M1 over M2 . This is impossible, since there are only finitely many men and women. We can now establish an important property of stable matchings when some unacceptable partners may be included: For a given set of preferences, every stable matching leaves the same group of men and women single. Theorem 2.21. Suppose each of n women ranks a subset of n men as potential partners, with the remaining men deemed unacceptable, and suppose each of the
2.9 Stable Marriage
257
men rank the women in the same way. Then there exists a subset X0 of the women and a subset Y0 of the men such that every stable matching of the n men and n women leaves precisely the members of X0 and Y0 unassigned. Proof. Suppose M1 and M2 are distinct stable matchings, and suppose m1 is matched in M1 but not in M2 . Let w1 be the partner of m1 in M1 . Since m1 clearly prefers M1 over M2 , by Lemma 2.20 w1 must prefer M2 over M1 . Let m2 be the partner of w1 in M2 . Then m2 prefers M1 , and so his partner w2 in M1 must prefer M2 over M1 . Continuing in this way, we obtain an infinite sequence (m1 , w1 ), (m2 , w2 ), (m3 , w3 ), . . . of distinct couples in M1 (and another sequence (m2 , w1 ), (m3 , w2 ), (m4 , w3 ), . . . in M2 ), which is impossible. We still need to show that at least one stable matching exists, and we can do this by altering the Gale-Shapley algorithm for preference lists that may include unacceptable partners. We require just two modifications. First, we terminate the loop either when all proposers are engaged, or when no free proposer has any remaining acceptable partners to ask. Second, proposals from unacceptable partners are always rejected. It is straightforward to show that this amended procedure always produces a stable matching (see Exercise 1). We can illustrate it with an example. Suppose the four men Iago, Julius, Kent, and Laertes each rank a subset of the four women Silvia, Thaisa, Ursula, and Viola, and each of the women ranks a subset of the men, as shown in Figure 2.21. Potential partners omitted from a person’s list are deemed unacceptable to that person, so for example Iago would not consider marrying Thaisa or Ursula.
I J K L
1 V S U S
2 S V T T
3
S V
S T U V
1 I J L K
2 K K I J
3 L
4 J
J
FIGURE 2.21. Preferences with unacceptable partners.
Suppose the men propose. Iago first asks Viola, but she rejects him as an unacceptable partner, so he asks Silvia, who happily accepts. Next, Julius asks Silvia, who rejects him in favor of Iago, so he proposes to Viola, who now accepts. Ursula then rejects Kent, then Thaisa accepts his proposal. Finally, Laertes proposes to Silvia, then Thaisa, then Viola, but each rejects him. Our stable matching is then (Iago, Silvia), (Julius, Viola), and (Kent, Thaisa). The set X0 of unmatchable bachelorettes contains only Ursula, and Y0 = {Laertes}. We have shown how to adapt the Gale-Shapley algorithm to handle incomplete preference lists, but we can also describe a way to alter the data in such a way that we can apply the Gale-Shapley algorithm without any modifications. To do this, we introduce a fictitious man to mark the boundary between the acceptable and unacceptable partners on each woman’s list, and similarly introduce a fictitious
258
2. Combinatorics
woman for the men’s lists. We’ll call our invented man the ogre, and our fictitious woman, the ogress. Append the ogre to each woman’s ranked list of acceptable partners, then add her unacceptable partners afterwards in an arbitrary order. Thus, each woman would sooner marry an ogre than one of her unacceptable partners. Do the same for the men with the ogress. The ogre prefers any woman over the ogress, and the ogress prefers any man over the ogre (people are tastier!), but the rankings of the humans on the ogre’s and ogress’ lists are immaterial. For example, we can augment the preference lists of Figure 2.21 to obtain the 5 × 5 system of Figure 2.22, using M to denote the ogre and W for the ogress.
I J K L M
1 V S U S S
2 S V T T T
3 W W S V U
4 T T W W V
5 U U V U W
S T U V W
1 I J L K I
2 K K I J J
3 L M J M K
4 J I M I L
5 M L K L M
FIGURE 2.22. Augmented preference lists.
We can now characterize when the original configuration has a complete stable matching, that is, a stable pairing where no one is left single. Theorem 2.22. Suppose each of n men ranks some subset of n women as acceptable partners, and each of the women does the same for the men. Suppose further that we obtain an instance of the standard stable marriage problem on n + 1 men and women by adding an ogre M and ogress W, and augmenting the preference lists in the manner described above. Then the original system has a complete stable matching if and only if the augmented system has a stable matching where M is paired with W. Proof. Suppose the original system has a complete stable matching. Then each woman prefers her partner in this matching to the ogre under the augmented preferences, and likewise no man would leave his partner for the ogress. Thus, adding (M, W) to this pairing produces a stable matching for the augmented system. Next, suppose the augmented system has a stable matching P that includes (M, W), and let P = P \ {(M, W)}. Suppose (m, w) ∈ P . If m is unacceptable to w, then w would prefer the ogre M over m, and certainly M prefers w over W. This contradicts the stability of P . Similarly, w must be acceptable to m. Thus, P is a complete matching of mutually acceptable partners, and stability follows at once from the stability of P . Exercise 2 asks you to show that M and W must be paired together in all stable matchings of the augmented system, if they are paired in any particular stable matching. Thus, we can determine if a complete stable matching exists by running the original Gale-Shapley algorithm on the augmented preference lists, choosing either set as the proposers.
2.9 Stable Marriage
259
While applying the Gale-Shapley algorithm in this way always produces a matching that is stable with respect to the augmented preferences, it is important to note that restricting such a pairing back to the original preferences might not produce a stable matching! For example, when the men propose using the augmented lists of Figure 2.22, we obtain the stable matching (Iago, Silvia), (Julius, Viola), (Kent, Ursula), (Laertes, Ogress), (Ogre, Thaisa).
(2.130)
However, Kent is not acceptable to Ursula, so we must disband this pair when we restrict to the original preference lists. The surviving pairs are (Iago, Silvia) and (Julius, Viola), and now Kent and Thaisa are unmatched but mutually acceptable. Indifference In the original stable marriage problem, we required that all preferences be strictly ordered, since each person needed to assign each potential partner a different rank. However, rankings often contain items that are valued equally. What happens if we allow weakly ordered rankings, that is, rankings that may contain some elements of the same rank? Suppose that each of n men supplies a weak ordering of a set of n women, and each of the women does the same for the men. We’ll assume for now that all rankings are complete, so there are no unacceptable partners. Must a stable ranking exist? Can we construct one? We first require a clarification of our notion of stability for this situation. We say a matching M of the men and women is unstable if there exists an unmatched couple m and w, each of whom strictly prefers the other to his or her partner in M . For example, if m strictly prefers w to his partner, but w ranks m equal to her partner, then the pair m and w do not violate stability under this definition. One can certainly study this problem with other notions of stability. For instance, one could demand that no unmatched man and woman weakly prefer each other to their assigned partners. A matching with no such couples is called superstable. Or one could require that no unmatched couple prefer each other, one in a strict sense and the other in a weak manner. Such a matching is said to be strongly stable. Since the notion that we employ is the least restrictive, matchings with this property are often called weakly stable. Given a collection of weakly ordered preference lists for n men and n women, we can certainly create a corresponding set of strongly ordered preference lists by breaking each tie in an arbitrary way. We call the strongly ordered preferences a refinement of the original weak preferences. A stable matching for the refined lists certainly exists, and it is easy to see that this matching is also a (weakly) stable matching for the original, weakly ordered lists. Furthermore, every stable matching for the original preferences can be obtained in this way. We can summarize these facts in the following theorem. Theorem 2.23. Suppose each of n men ranks a collection of n women, with tied rankings allowed, and each woman does the same for the men. Then a stable
260
2. Combinatorics
matching for these preferences exists, and further every such stable matching is a stable matching for some refinement of these weakly ordered rankings. Proof. For the first part, let P be a refinement of the given list of preferences P , and let M be a stable matching for P . If m and w are unmatched in M , and according to P strictly prefer each other to their partners in this matching, then they also strictly prefer each other according to P . This is impossible, since M is stable with respect to P . Thus, M is stable with respect to P . For the second part, suppose M is a stable matching with respect to P . We need to construct a refinement P of P where M is stable. If (m, w) ∈ M , and m ranks w equal to w in P , then let m rank w ahead of w in P . Likewise, if w ranks m equal to m in P , then w ranks m ahead of m in P . Any remaining tied rankings are broken arbitrarily to complete P . Suppose then that m0 and w0 are unmatched in P , but prefer each other (according to P ) to their partners in M . Since M is stable with respect to P , then either m0 ranks w0 equal to his partner in M , or w0 ranks m0 equal to her partner in M (or both). We obtain a contradiction in either case, by the construction of P . G H I K
: : : :
D A F D
>A=C =F >C >C >D >A=C
>F =D >A =F
A C D F
: : : :
I H I H
>G >G >K = I
=H = I >H >G
=K >K >G =K
FIGURE 2.23. Preference lists with indifference.
The Gale-Shapley algorithm requires no modifications for this variation, once a refinement is selected. Of course, the algorithm may produce different matchings for different refinements, even when the same group proposes. For example, suppose the four men Gatsby, Hawkeye, Ishmael, and Kino, and four women Apolonia, Cora, Daisy, and Fayaway, submit the preference lists shown in Figure 2.23. Using the refinement obtained by replacing each = in these lists with >, the Gale-Shapley algorithm produces the following matching when the men propose: (Gatsby, Apolonia), (Hawkeye, Fayaway), (2.131) (Ishmael, Cora), (Kino, Daisy). However, if we reverse the order of Apolonia and Cora in the refinement of Gatsby’s list, and the order of Apolonia and Fayaway in Hawkeye’s, we then obtain a very different stable matching: (Gatsby, Cora), (Hawkeye, Fayaway), (Ishmael, Daisy), (Kino, Apolonia).
(2.132)
Finally, we may also ask about combining this extension of the stable marriage problem with the prior one. Suppose the men and women supply weakly ordered
2.9 Stable Marriage
261
rankings, and may also declare some potential partners as unacceptable. The stable matching problem becomes much more complicated in this case. Even the size of a stable matching may vary, in contrast to the case of unacceptable partners with strict rankings, where Theorem 2.21 guarantees that all stable matchings have not only the same size, but match exactly the same men and women. For example, consider the following 2 × 2 system from [196], where A finds Y acceptable but not Z, and Z finds B acceptable but not A. A : Y B : Y >Z
Y : A=B Z : B
These preferences admit exactly two stable matchings, which have different sizes: {(A, Y ), (B, Z)} and {(B, Y )}. We might ask if we could determine a stable matching of maximal size in a problem like this, since this would often be desirable. However, no fast algorithm is known for computing this in the general n × n case. (Here, a “fast” algorithm would have its running time bounded by a polynomial in n.) In fact, it is known [196] that this problem belongs to a family of difficult questions known as NPcomplete problems. The problem remains hard even if ties are allowed in only the men’s or only the women’s preferences, and all ties occur at the end of each list, even if each person is allowed at most one tied ranking. Sets of Different Sizes Every stable marriage problem we have considered so far required an equal number of men and women. Suppose now that one group is larger than the other. Of course, we could not possibly match everyone with a partner now, but can we find a stable matching that pairs everyone in the smaller set? Here, we say a matching (or partial matching) M is unstable if there exists a man m and woman w, unmatched in M , such that each is either single in M , or prefers the other to his or her partner in M . We can solve this variation by considering it to be a special case of the problem with unacceptable partners. Suppose we have k men and n women, with n > k. Suppose also that each of the men rank each of the women in strict order, and each of the women reciprocate for the men. We introduce n−k ghosts to the set of men. Each ghost finds no woman to be an acceptable partner, and each women would not accept any ghost. Then a stable matching exists by the modified Gale-Shapley algorithm for unacceptable partners, and by Theorem 2.21 there exists a set X0 of women and Y0 of ghosts and men such that the members of X0 and Y0 are precisely the unassigned parties in any stable matching. Certainly Y0 includes all the ghosts, since they have no acceptable partners. But no man can be unassigned in a stable matching, since each man is acceptable to all the women. Thus, X0 is empty and Y0 is precisely the set of ghosts, and we obtain the following theorem. Theorem 2.24. Suppose each of k men ranks each of n women in a strict ordering, and each of the women ranks the men in the same way. Then (i) a stable matching exists,
262
2. Combinatorics
(ii) every stable matching pairs every member of the smaller set, and (iii) there exists a subset X of the larger set such that every stable matching leaves the members of X unassigned, and the others all matched. An example with groups of different sizes appears in Exercise 6. Some other interesting variations (and combinations of variations) on the stable marriage problem are introduced in the exercises too. We will study marriage problems further in Chapter 3, where in Section 3.8 we investigate matchings for various infinite sets. Exercises 1. Prove that the Gale-Shapley algorithm, amended to handle unacceptable partners, always produces a stable matching. 2. Prove that if the ogre and ogress are paired in some stable matching for an augmented system of preferences as in Theorem 2.22, then they must be paired in every such stable matching. 3.
(a) Verify the stable matching (2.130) produced by the Gale-Shapley algorithm when the men propose using the preferences in Figure 2.22. (b) Compute the stable matching obtained when the women propose using these preferences. Does this pairing restrict to a stable matching for Figure 2.21? (c) In the augmentation procedure for the case of unacceptable partners, we can list the unacceptable partners for each person in any order after the ogre or ogress, and we can list the humans in any order in the lists for the ogre and ogress. Show that one can select orderings when augmenting the preferences of Figure 2.21 so that when the men propose in the Gale-Shapley algorithm, one obtains a pairing that restricts to a stable matching of Figure 2.21.
4. The following problems all refer to the weakly ordered preference lists of Figure 2.23. (a) Verify the matching (2.131) obtained from the refinement obtained by replacing each = with >, when the men propose in the Gale-Shapley algorithm. Then determine the matching obtained when the women propose. (b) Verify (2.132) using the refinement obtained from the previous one by reversing the order of Apolonia and Cora in Gatsby’s list, and Apolonia and Fayaway in Hawkeye’s. Then determine the matching obtained when the women propose. (c) Construct another refinement by ranking any tied names in reverse alphabetical order. Compute the stable matchings constructed by the
2.9 Stable Marriage
263
Gale-Shapley algorithm when the men propose, then when the women propose. 5. Construct three refinements of the following preference lists so that the Gale-Shapley algorithm, amended for unacceptable partners, produces a stable matching of a different size in each case. A B C D
: : : :
W X Y Z
W W >X W >X>Y W >X>Y >Z
: : : :
A=B=C =D B=C =D C =D D
6. Suppose the five men Arceneaux, Boudreaux, Comeaux, Duriaux, and Gautreaux, each rank the three women Marteaux, Robichaux, and Thibodeaux in order of preference, and the women each rank the men, as shown in the following tables.
A B C D G
1 R T M T R
2 T R T M T
3 M M R R M
M R T
1 A D G
2 D G A
3 B A D
4 C C C
5 G B B
Determine the stable matching obtained when the men propose, then the matching found when the women propose. What is the set X of Theorem 2.24 for these preferences? 7. Suppose we allow weakly ordered rankings in the hypothesis of Theorem 2.24. Determine which of the conclusions still hold, and which do not necessarily follow. Supply a proof for any parts that do hold, and supply a counterexample for any parts that do not. 8. Suppose that each of n students, denoted S1 , S2 , . . . , Sn , ranks each of m universities, U1 , U2 , . . . , Um , and each university does the same for the students. Suppose also that university Uk has pk open positions. We say an assignment of students to universities is unstable if there exists an unpaired student Si and university Uj such that Si is either unassigned, or prefers Uj to his assignment, and Uj either has an unfilled position, or prefers Si to some student in the new class. m (a) Assume that k=1 pk = n. Explain how to amend the preference lists so that the Gale-Shapley algorithm may be used to compute a stable assignment of students to universities, with no university exceeding its capacity.
264
2. Combinatorics
(b) Repeat this problem without assuming that the number of students matches the total number of open positions. (c) Suppose each student ranks only a subset of the universities, and each university ranks only a subset of the students who apply to that school. Assume that unranked possibilities are unacceptable choices. Modify the definition of stability for this case, then describe how to use the Gale-Shapley algorithm to determine a stable assignment. 9. Suppose that each of n students, denoted S1 , S2 , . . . , Sn , needs to enroll in a number of courses from among m possible offerings, denoted C1 , C2 , . . . , Cm . Assume that student Si can register for up to qi courses, and course Cj can admit up to rj students. An enrollment is a set of pairs (Si , Cj ) where each student Si appears in at most qi such pairs, and each course Cj appears in at most rj pairs. Suppose each student ranks a subset of acceptable courses in order of preference, and the supervising professor of each course ranks a subset of acceptable students. Define a stable enrollment in an appropriate way.
2.10 Combinatorial Geometry We should expose the student to some material that has strong intuitive appeal, is currently of research interest to professional mathematicians, and in which the student himself may discover interesting problems that even the experts are unable to solve. — Victor Klee, from the translator’s preface to Combinatorial Geometry in the Plane [144] The subject of combinatorial geometry studies combinatorial problems regarding arrangements of points in space, and the geometric figures obtained from them. Such figures include lines and polygons in two dimensions, planes and polyhedra in three, and hyperplanes and polytopes in n-dimensional space. This subject has much in common with the somewhat broader subject of discrete geometry, which treats all sorts of geometric problems on discrete sets of points in Euclidean space, especially extremal problems concerning quantities such as distance, direction, area, volume, perimeter, intersection counts, and packing density. In this section, we provide an introduction to the field of combinatorial geometry by describing two famous problems regarding points in the plane: a question of Sylvester concerning the collection of lines determined by a set of points, and a problem of Erd˝os, Klein, and Szekeres on the existence of certain polygons that can be formed from large collections of points in the plane. The latter problem leads us again to Ramsey’s theorem, and we prove this statement in a more general form than what we described in Section 1.8. (Ramsey theory is developed further in Chapter 3.) In particular, we establish some of the bounds on the Ramsey numbers R(p, q) that were cited in Section 1.8.
2.10 Combinatorial Geometry
265
2.10.1 Sylvester’s Problem Thufferin’ thuccotash! — Sylvester the cat, Looney Tunes James Joseph Sylvester, a British-born mathematician, spent the latter part of his career at Johns Hopkins University, where he founded the first research school in mathematics in America, and established the first American research journal in the subject, The American Journal of Mathematics. Toward the end of his career, Sylvester posed the following problem in 1893, in the “Mathematical Questions” column of the British journal, Educational Times [265]. Sylvester’s Problem. Given n ≥ 3 points in the plane which do not all lie on the same line, must there exist a line that passes through exactly two of them? Given a collection of points in the plane, we say a line is ordinary if it passes through exactly two of the points. Thus, Sylvester’s problem asks if an ordinary line always exists, as long as the points are not all on the same line. This problem remained unsolved for many years, and seemed to have been largely forgotten until Erd˝os rediscovered it in 1933. Tibor Gallai, a friend of Erd˝os’ who is also known as T. Gr¨unwald, found the first proof in the same year. Erd˝os helped to revive the problem by posing it in the “Problems” section of the American Mathematical Monthly in 1933 [89], and Gallai’s solution was published in the solution the following year [264]. Kelly also produced a clever solution, which was published in a short article by Coxeter in 1948 [62], along with a version of Gallai’s argument. Forty years later, the computer scientist Edsger Dijkstra derived a similar proof, but with a more algorithmic viewpoint [76]. The proof we present here is based on Dijkstra’s algorithm. Given any collection of three or more points which do not all lie on the same line, it constructs a line with the required property. In this method, we start with an arbitrary line 1 connecting at least two points of the set, and some point S1 from the set that does not lie on 1 . If 1 contains just two of the points, we are done, so suppose that at least three of the points lie on
1 . The main idea of the method is to construct from the current line 1 and point S1 another line 2 and point S2 , with S2 not on 2 . Then we iterate this process, constructing 3 and S3 , then 4 and S4 , etc., until one is assured of obtaining a line that connects exactly two of the points of the original collection. In order to ensure that the procedure does not cycle endlessly, we introduce a termination argument: a strictly monotone function of the state of the algorithm. A natural candidate is the distance dk from the point Sk to the line k , so dk = d(Sk , k ). We therefore aim to construct k+1 and Sk+1 from k and Sk in such a way that dk+1 < dk . Since there are only finitely many points, there are only finitely many possible values for dk , so if we can achieve this monotonicity, then it would follow that the procedure must terminate. We derive a procedure that produces a strictly decreasing sequence {dk }. Suppose the line k contains the points Pk , Qk , and Rk from our original collection, and Sk is a point from the set that does not lie on k . We need to choose k+1 and
266
2. Combinatorics
Sk+1 so that dk+1 < dk . Suppose we set Sk+1 to be one of the points that we labeled on k , say Sk+1 = Qk . Certainly Qk does not lie on either of the lines Pk Sk or Rk Sk , so we might choose one of these two lines for our k+1 . Can we guarantee that one of these choices will produce a good value for dk+1 ? To test this, let pk = d(Qk , Pk Sk ) and rk = d(Qk , Rk Sk ). We require then that min(pk , rk ) < dk .
(2.133)
Sk
dk Pk
Qk pk
FIGURE 2.24. Similar triangles in the construction.
Using similar triangles in Figure 2.24, we see that the inequality pk < dk is equivalent to the statement d(Pk , Qk ) < d(Pk , Sk ),
(2.134)
and likewise rk < dk is equivalent to the inequality d(Qk , Rk ) < d(Sk , Rk ).
(2.135)
Now at least one of (2.134) or (2.135) must hold if d(Pk , Qk ) + d(Qk , Rk ) < d(Pk , Sk ) + d(Sk , Rk ). Further, since Sk does not lie on k , by the triangle inequality we know that d(Pk , Rk ) < d(Pk , Sk ) + d(Sk , Rk ). Therefore, inequality (2.133) follows from the statement d(Pk , Qk ) + d(Qk , Rk ) ≤ d(Pk , Rk ). However, by the triangle inequality, we know that d(Pk , Qk ) + d(Qk , Rk ) ≥ d(Pk , Rk ).
2.10 Combinatorial Geometry
267
Thus, we require that d(Pk , Qk ) + d(Qk , Rk ) = d(Pk , Rk ). Clearly, this latter condition holds if and only if Qk lies between Pk and Rk on
k . We therefore obtain the following algorithm for solving Sylvester’s problem. Algorithm 2.25. Construct an ordinary line. Input.
A set of n ≥ 3 points in the plane, not all on the same line.
Output.
A line connecting exactly two of the points.
Description. Step 1. Let 1 be a line connecting at least two of the points in the given set, and let S1 be a point from the collection that does not lie on 1 . Set k = 1, then perform Step 2. Step 2. If k contains exactly two points from the original collection, then output k and stop. Otherwise, perform Step 3. Step 3. Let Pk , Qk , and Rk be three points from the given set that lie on k , with Qk lying between Pk and Rk . Set Sk+1 = Qk , and set k+1 = Pk Sk if d(Qk , Pk Sk ) < d(Qk , Pk Rk ); otherwise set k+1 = Rk Sk . Then increment k by 1 and repeat Step 2. Now Sylvester’s problem is readily solved: The monotonicity of the sequence {dk } guarantees that the algorithm must terminate, so it must produce a line connecting just two points of the given set. An ordinary line must therefore always exist. We can illustrate Dijkstra’s algorithm with an example. Figure 2.25 shows a collection of thirteen points that produce just six ordinary lines (shown in bold), along with 21 lines that connect at least three of the points. Figure 2.26 illustrates the action of Algorithm 2.25 on these points, using a particular initial configuration. Each successive diagram shows the line k , the point Sk off the line, and the points Pk , Qk , and Rk on the line. Much more is now known about Sylvester’s problem. For example, Csima and Sawyer [64, 65] proved that every arrangement of n ≥ 3 points in the plane, not all on the same line, must produce at least 6n/13 ordinary lines, except for certain arrangements of n = 7 points. Figure 2.25 shows that this bound is best possible, and Exercise 2 asks you to determine an exceptional configuration for n = 7. Also, it has long been conjectured that there are always at least n/2 ordinary lines for a set of n non-colinear points, except for n = 7 and n = 13, but this remains unresolved. For additional information on Sylvester’s problem and several of its generalizations, see the survey article by Borwein and Moser [34], or the book by Brass, Moser, and Pach [37, sec. 7.2].
268
2. Combinatorics
FIGURE 2.25. A collection of thirteen points with just six ordinary lines.
Exercises 1. Exhibit an arrangement of six points in the plane that produce exactly three ordinary lines. 2. Exhibit an arrangement of seven points in the plane that produce exactly three ordinary lines. 3. Exhibit an arrangement of eight points in the plane that produce exactly four ordinary lines. 4. Exhibit an arrangement of nine points in the plane that produce exactly six ordinary lines. 5. Suppose n ≥ 3 points in the plane do not all lie on the same line. Show that if one joins each pair of points with a straight line, then one must obtain at least n distinct lines. 6. We say a set of points B is separated if there exists a positive number δ such that the distance d(P, Q) ≥ δ for every pair of points P and Q in B. Describe an infinite, separated set of points in the plane, not all on the same line, for which no ordinary line exists. What happens if you apply Dijkstra’s algorithm to this set of points? 7. Repeat problem 6, if each of the points (x, y) must in addition satisfy |y| ≤ 1.
2.10 Combinatorial Geometry
k=1
k=2
k=3
k=4
k=5
k=6
k=7 FIGURE 2.26. Dijkstra’s algorithm.
269
270
2. Combinatorics
8. Let the set S consist of the point (0, 0), together with all the points in the 1 1 −1 1 2 plane of the form ( 3k−1 , 3k−1 ), ( 3k−1 , 3k−1 ), or (0, 3k−2 ), where k is an arbitrary integer. Show that every line connecting two points of S must intersect a third point of S. 9. Consider the following collection T of three-element subsets of the sevenelement set S = {a, b, c, d, e, f, g}: T = {{a, b, c}, {a, d, e}, {a, f, g}, {b, d, f }, {b, e, g}, {c, d, g}, {c, e, f }}. (a) Verify that each two-element subset of S is in fact a subset of one of the members of T , and that any two distinct sets in T have at most one element in common. (b) Explain how this example is germane to Sylvester’s problem. Hint: Try thinking of the elements of S as points, and the elements of T as lines.
2.10.2 Convex Polygons I would certainly pay $500 for a proof of Szekeres’ conjecture. — Paul Erd˝os, [92, p. 66] A set of points S in the plane is said to be convex if for each pair of points a and b in S, the line segment joining a to b lies entirely in S. Loosely, then, a convex set has no “holes” in its interior, and no “dents” in its boundary. Line segments, triangles, rectangles, and ellipses are thus all examples of convex sets. The convex hull of a finite collection of points T in the plane is defined as the intersection of all closed convex sets which contain T . Less formally, if one imagines T represented by a set of pushpins in a bulletin board, then the convex hull of T is the shape enclosed by a rubber band when it is snapped around all the pushpins. The convex hull of a set of three points then is either a triangle or a line segment, and for four points we may obtain one of these shapes, or a convex quadrilateral. In order to avoid degenerate cases, we will assume in this section that our given collection of points is in general position, which means that no three points lie on the same line, or, using the term from the previous section, that each line connecting two of the points is ordinary. Thus, the convex hull of a set of four points in general position forms either a quadrilateral, or a triangle whose interior contains the fourth point of the collection. In the early 1930s, Esther Klein observed that one can always find a convex quadrilateral in a collection of five points in general position. Theorem 2.26. Any collection of five points in the plane in general position contains a four-element subset whose convex hull is a quadrilateral. Proof. Suppose we are given a collection of five points in the plane, with no three on the same line. If their convex hull is a pentagon or a quadrilateral, then the
2.10 Combinatorial Geometry
271
statement follows, so suppose that it forms a triangle. Let a and b be the two points of the collection lying inside the triangle, and let be the line connecting a and b. Since the points are in general position, two of the vertices of the triangle lie on one side of . Label them c and d. Then the convex hull of {a, b, c, d} is a quadrilateral. See Figure 2.27.
FIGURE 2.27. A convex quadrilateral may always be found among five points in general position.
Klein then asked about a natural generalization. How many points in the plane (in general position) are required in order to be certain that some subset forms the convex hull of a polygon with n sides? Does such a number exist for each n? For example, Figure 2.28 illustrates a collection of eight points, no five of which produce a convex pentagon, and a set of sixteen points, no six of which forms a convex hexagon. Thus, at least nine points are needed for n = 5, and at least seventeen for n = 6.
FIGURE 2.28. Eight points with no convex pentagon, and sixteen points with no convex hexagon.
Erd˝os and Szekeres studied this problem in their first joint paper, in 1935 [94]. There they independently developed a version of Ramsey’s theorem, and the proof we describe in this section is based on their argument. The statement we develop here is much more general than the special case of Ramsey’s theorem that we described in Section 1.8, although Ramsey in fact established a still more general
272
2. Combinatorics
result in his seminal paper of 1930 [232] (see Exercise 7). We will also derive the bounds on the ordinary Ramsey numbers R(m, n) stated in Theorems 1.63 and 1.64 of Section 1.8 as special cases. Let ES(n) denote the minimal number of points in the plane in general position that are required so that there must exist a subcollection of n points whose convex hull is a polygon with n sides (an n-gon). Thus, we have seen that ES(3) = 3, ES(4) = 5, and, from Figure 2.28, that ES(5) ≥ 9 and ES(6) ≥ 17. We aim to show that ES(n) exists for each n by obtaining an upper bound on its value, in terms of n. As a first step, we show that it is enough to find a collection of n points, each of whose four-element subsets forms a convex quadrilateral. Theorem 2.27. Suppose S is a set of n points in the plane in general position with the property that each four-element subset of S is the vertex set of a convex quadrilateral. Then S is the set of vertices of a convex n-gon. Proof. Let H denote the convex hull of S, and suppose a ∈ S lies in the interior of H. Let b ∈ S with a = b. Divide H into triangles by joining b to each vertex of H. Then a lies in the interior of one of these triangles, and we label its vertices b, c, and d. But then {a, b, c, d} is a four-element subset of S whose convex hull is a triangle, contradicting our assumption. Next, we develop the more general version of Ramsey’s theorem. Recall that in Section 1.8 we defined R(m, n) to be the smallest positive integer N such that any 2-coloring of the edges of the complete graph KN (using the colors red and blue) must produce either a red Km or a blue Kn as a subgraph. Coloring each edge of KN is certainly equivalent to assigning a color to each of the N2 subsets of size 2 of the set {1, 2, . . . , N }, and so we might consider what happens more generally when we assign a color to each of the N k subsets of size k, for a fixed positive integer k. We call such a subset a k-subset of the original set. Ramsey’s theorem extends in a natural way to this setting. For convenience, we let [N ] denote the set {1, 2, . . . , N }, and we define the generalized Ramsey numbers in the following way. Definition. For positive integers k, m, and n, with m ≥ k and n ≥ k, the Ramsey number Rk (m, n) is defined as the smallest positive integer N such that in any 2-coloring of the k-subsets of [N ] (using the colors red and blue) there must exist either a subset of m elements, each of whose k-subsets is red, or a subset of n elements, each of whose k-subsets is blue. Thus, the Ramsey numbers R(m, n) of Section 1.8 are denoted by R2 (m, n) here. Also, just as the ordinary Ramsey numbers can be described in terms of coloring edges of complete graphs, so too can we describe Rk (m, n) in terms of coloring edges of certain hypergraphs (see Exercise 1). The next theorem establishes that the Ramsey numbers Rk (m, n) always exist, and provides an upper bound on their values.
2.10 Combinatorial Geometry
273
Theorem 2.28 (Ramsey’s Theorem). Let k, m, and n be positive integers, with min{m, n} ≥ k. Then the Ramsey number Rk (m, n) exists. Furthermore, for each such k, m, and n, we have R1 (m, n) = m + n − 1,
(2.136)
Rk (k, n) = n, Rk (m, k) = m,
(2.137) (2.138)
and, if min{m, n} > k ≥ 2, then
Rk (m, n) ≤ Rk−1 Rk (m − 1, n) + Rk (m, n − 1) + 1.
(2.139)
Proof. First, consider the case k = 1. If the elements of [N ] are each colored red or blue, and there are fewer than m red elements and fewer than n blue elements, then certainly N ≤ m + n − 2, and (2.136) follows. Second, suppose k = m, and suppose that each k-subset of [N ] is colored red or blue. If any is red then we have a qualifying m-subset, so suppose all are blue. Then we have a qualifying n-subset precisely when N ≥ n. Thus, the formula (2.137) follows, and by symmetry so does (2.138). To establish (2.139), suppose min{m, n} > k ≥ 2. Using induction on k, we may assume that Rk−1 (a, b) exists for all integers a and b with min{a, b} ≥ k − 1, and further by induction on m + n we may assume that Rk (m − 1, n) and Rk (m, n − 1) both exist. Let m = Rk (m − 1, n), n = Rk (m, n − 1), and N = Rk−1 (m , n ) + 1, and consider an arbitrary 2-coloring C of the k-subsets of [N ] using the colors red and blue. Create a coloring C of the (k − 1)-subsets of [N − 1] by assigning a subset X of size k − 1 the color of the set X ∪ {N } in C. Since N − 1 = Rk−1 (m , n ), the coloring C must produce either a subset of [N − 1] of cardinality m , each of whose (k − 1)-subsets is red, or a subset of [N − 1] of cardinality n , each of whose (k − 1)-subsets is blue. Suppose the first possibility occurs (the argument for the second case is symmetric), and let S be a qualifying subset of [N − 1]. Since S has m = Rk (m − 1, n) elements, there must exist either a subset of size m − 1 of S, each of whose k-subsets is red in the original coloring C, or a subset of size n of S, each of whose k-subsets is blue in C. In the latter case, we are done, so suppose the former case occurs, and let T be such a subset of [N − 1]. Let T = T ∪ {N }, and suppose X is a k-subset of T . If N ∈ X, then X ⊆ S, so X is red in C. If N ∈ X, then X \ {N } is a (k − 1)-subset of S and so is red in C , and thus X is red in C. Using this result, we can now establish the upper bound for the original Ramsey numbers R2 (m, n) that was cited in Section 1.8. Corollary 2.29. Suppose m and n are integers with min{m, n} ≥ 2. Then
and
R2 (m, n) ≤ R2 (m − 1, n) + R2 (m, n − 1)
(2.140)
m+n−2 . R2 (m, n) ≤ m−1
(2.141)
274
2. Combinatorics
Proof. The inequality (2.140) follows at once from (2.136) and (2.139). The formulas (2.137) and (2.138) produce equality in (2.141) for the cases m = 2 and n = 2 respectively, and the general inequality follows by induction on m + n (see Exercise 3). Armed with Ramsey’s theorem, we may now prove that a sufficiently large collection of points in the plane in general position must contain a subset that forms the vertices of a convex n-gon, for any positive integer n. Theorem 2.30. If n ≥ 3 is an integer, then ES(n) ≤ R4 (5, n). Proof. Let S be a collection of N = R4 (5, n) points in the plane in general position. For each four-element subset T of S, assign T the color red if its convex hull is a triangle, and assign it the color blue if it is a quadrilateral. By Ramsey’s Theorem, there must exist either a five-element subset of S whose 4-subsets are all red, or an n-element subset of S whose 4-subsets are all blue. The former case is impossible by Theorem 2.26, so the latter case must occur, and this implies that the n points form the vertex set of a convex n-gon by Theorem 2.27. Much more is known about the quantity ES(n). In the same article [94], Erd˝os and Szekeres employ a separate geometric argument to show that in fact 2n − 4 ES(n) ≤ + 1. n−2 Since then, this bound has been improved several times. For example, in 2005 T´oth and Valtr [268] proved that 2n − 5 ES(n) ≤ +1 n−2 for n ≥ 5. Few exact values of ES(n) have been determined. In [94], Erd˝os and Szekeres noted that Makai first proved that ES(5) = 9, so Figure 2.28 exhibits an extremal configuration. Proofs of this statement were published later in [171] and [30]. In 2006, Szekeres and Peters [266] employed a computational strategy to establish that ES(6) = 17. Thus, again Figure 2.28 illustrates an optimal arrangement. Erd˝os and Szekeres conjectured that in fact ES(n) = 2n−2 + 1 for all n ≥ 3, and this problem remains open. This is the $500 conjecture that Erd˝os was referring to in the quote that opens this section. It is known that ES(n) cannot be any smaller than the conjectured value. In 1961, Erd˝os and Szekeres [95] described a method for placing 2n−2 points in the plane in general position so that no convex n-gon appears. Their construction was later corrected by Kalbfleisch and Stanton [172]. Thus, certainly ES(n) ≥ 2n−2 + 1 for n ≥ 7. For additional information on this problem and many of its generalizations, see for instance the books by Brass, Moser, and Pach [37, sec. 8.2] and
2.10 Combinatorial Geometry
275
Matouˇsek [200, chap. 3], the survey article by Morris and Soltan [208], or the note by Dumitrescu [82]. Exercises 1. State Ramsey’s theorem in terms of coloring edges of certain hypergraphs. 2. Exhibit a collection of eight points in general position in the plane whose convex hull is a triangle, so that no subset of four points forms the vertex set of a convex quadrilateral. 3. Complete the proof of Corollary 2.29. 4. (Johnson [169].) If S is a finite set of points in the plane in general position, and T is a subset of S of size 3, let ψS (T ) denote the number of points of S that lie in the interior of the triangle determined by T . Complete the following argument to establish a different upper bound on ES(n). (a) Let n ≥ 3 be an integer. Prove that if S is sufficiently large, then there exists a subset U of S of size n such that either every 3-subset T of U has ψS (T ) even, or every such subset has ψS (T ) odd. (b) If U does not form the vertex set of a convex n-gon, then by Theorem 2.27 there exist four points a, b, c, and d of U , with d lying inside the triangle determined by a, b, and c. Show that ψS ({a, b, c}) = ψS ({a, b, d}) + ψS ({b, c, d}) + ψS ({a, c, d}) + 1. (c) Establish a contradiction and conclude that ES(n) ≤ R3 (n, n). 5. (Tarsy [188].) If a, b, and c form the vertices of a triangle in the plane, let θ(a, b, c) = 1 if the path a → b → c → a induces a clockwise orientation of the boundary, and let θ(a, b, c) = −1 if it is counterclockwise. Thus, for example, θ(a, b, c) = −θ(a, c, b). Complete the following argument to establish an upper bound on ES(n). (a) Let n ≥ 3 be an integer, and let S = {v1 , v2 , . . . , vN } be a set of labeled points in the plane in general position. Prove that if N is sufficiently large, then there exists a subset U of S of size n such that either every 3-subset {vi , vj , vk } of U with i < j < k has θ(vi , vj , vk ) = 1, or every such subset has θ(vi , vj , vk ) = −1. (b) Prove that if S contains a 4-subset whose convex hull is a triangle, then this subset must contain triangles of both orientations with respect to the ordering of the vertices. (c) Conclude that ES(n) ≤ R3 (n, n).
276
2. Combinatorics
6. Complete the proof of Theorem 1.64 by proving that if m and n are positive integers with min{m, n} ≥ 2, and R2 (m−1, n) and R2 (m, n−1) are both even, then R2 (m, n) ≤ R2 (m − 1, n) + R2 (m, n − 1) − 1. Use the following strategy. Let r1 = R2 (m − 1, n), r2 = R2 (m, n − 1), and N = r1 + r2 − 1. Suppose that the edges of KN are 2-colored, using the colors red and blue, in such a way that no red Km nor blue Kn appears. (a) Show that the red degree of any vertex in the graph must be less than r1 . (b) Show that the red degree of any vertex in the graph must equal r1 − 1. (c) Compute the number of red edges in the graph, and establish a contradiction. 7. Prove the following more general version of Ramsey’s theorem. Let k, n1 , n2 , . . . , nr be positive integers, with min{n1 , . . . , nr } ≥ k, and let c1 , c2 , . . . , cr denote r different colors. Then there exists a positive integer Rk (n1 , . . . , nr ) such that in any r-coloring of the k-subsets of a set with N ≥ Rk (n1 , . . . , nr ) elements, there must exist a subset of ni elements, each of whose k-subsets has color ci , for some i with 1 ≤ i ≤ r. 8. (Schur [251].) If C is an r-coloring of the elements of [N ], then let C be the r-coloring of 2-subsets of [N ] ∪ {0} obtained by assigning the pair {a, b} the color of |b − a| in C. (a) Use the generalized Ramsey’s Theorem of Exercise 7 to assert that if N is sufficiently large then in [N ] ∪ {0} there must exist a set of three nonnegative integers, each of whose 2-subsets has the same color in C. (b) Conclude that if N is sufficiently large then there exist integers a and b in [N ], with a + b ≤ N , such that a, b, and a + b all have the same color in C. 9. Let S be a finite set of points in the plane, and let P be a convex polygon whose vertices are all selected from S. We say P is empty (with respect to S) if its interior contains no points of S. Erd˝os asked if for each integer n ≥ 3 there exists a positive integer ES0 (n) such that any set of at least ES0 (n) points in general position in the plane must contain an empty ngon, but this need not be the case for sets with fewer than ES0 (n) points. (a) Compute ES0 (3) and ES0 (4). (b) (Ehrenfeucht [91].) Prove that ES0 (5) exists by completing the following argument. Let S be a set of ES(6) points in general position in the plane, and let P be a convex hexagon whose vertices lie in S, selected so that its interior contains a minimal number of points of S. Denote this number by m.
2.11 References
277
i. Complete the proof if m = 0 or m = 1. ii. If m ≥ 2, let H be the convex hull of the points of S lying inside P , and let be a line determined by two points on the boundary of H. Finish the proof for this case. The argument above establishes that ES0 (5) ≤ 17; in 1978 Harborth [151] showed that in fact ES0 (5) = 10. Horton [164] in 1983 proved the surprising result that ES0 (n) does not exist for n ≥ 7. More recently, Gerken [121] and Nicol´as [215] solved the problem for n = 6: A sufficiently large set of points in the plane in general position must contain an empty convex hexagon. The precise value of ES0 (6) remains unknown, though it must satisfy 30 ≤ ES0 (6) ≤ ES(9) ≤ 1717. (An example by Overmars [219] establishes the lower bound; additional information on the upper bound can be found in [182, 271].)
2.11 References You may talk too much on the best of subjects. — Benjamin Franklin, Poor Richard’s Almanack We list several additional references for the reader who wishes to embark on further study. General References The text by van Lint and Wilson [273] is a broad and thorough introduction to the field of combinatorics, covering many additional topics. Classical introductions to combinatorial analysis include Riordan [235] and Ryser [246], and many topics in discrete mathematics and enumerative combinatorics are developed extensively in Graham, Knuth, and Patashnik [133]. The text by P´olya, Tarjan, and Woods [227] is a set of notes from a course in enumerative and constructive combinatorics. A problems-oriented introduction to many topics in combinatorics and graph theory can be found in Lov´asz [191]. The book by Nijenhuis and Wilf [216] describes efficient algorithms for solving a number of problems in combinatorics and graph theory, and a constructive view of the subject is developed in Stanton and White [263]. Texts by Aigner [4, 5], Berge [24], Comtet [60], Hall [146], and Stanley [261, 262] present more advanced treatments of many aspects of combinatorics. Combinatorial Identities The history of binomial coefficients and Pascal’s triangle is studied in Edwards [85], and some interesting patterns in the rows of Pascal’s triangle are observed by Granville [138]. Combinatorial identities are studied in Riordan [236], and automated techniques for deriving and proving identities involving binomial coefficients and other quantities are developed in Petkovˇsek, Wilf, and Zeilberger
278
2. Combinatorics
[222]. Combinatorial proofs for many identities are also developed in the book by Benjamin and Quinn [22]. Pigeonhole Principle More nice applications of the pigeonhole principle, together with many other succinct proofs in combinatorics and other subjects, are described in Aigner and Ziegler [6]. An interesting card trick based in part on a special case of Theorem 2.4 is described by Mulcahy [210]. Polynomials with {−1, 0, 1} coefficients and a root of prescribed order m at x = 1, as in Exercise 14 of Section 2.4, are studied by Borwein and Mossinghoff [35]. Generating Functions More details on generating functions and their applications can be found for instance in the texts by Wilf [284] and Graham, Knuth, and Patashnik [133], and in the survey article by Stanley [260]. The problem of determining the minimal degree dk of a polynomial with {0, 1} coefficients that is divisible by (x + 1)k , as in Exercise 5 of Section 2.6.5, is studied by Borwein and Mossinghoff [36]. Some properties of the generalized Fibonacci numbers (Exercise 8b of Section 2.6.5) are investigated by Miles [203]. P´olya’s Theory of Counting P´olya’s seminal paper on enumeration in the presence of symmetry is translated into English by Read in [226]. Redfield [233] independently devised the notion of a cycle index for a group, which he termed the group reduction formula, ten years before P´olya’s paper. As a result, many texts call this topic P´olya-Redfield theory. This theory, along with the generalization incorporating a color group, is also described in the expository article by de Bruijn [68], and his research article [69]. Further generalizations of this theory are explored by de Bruijn in [70], culminating in a “monster theorem.” Another view of de Bruijn’s theorem is developed by Harary and Palmer in [149; 150, chap. 6]. Applications of this theory in chemistry are described in the text by Fujita [116], and additional references for enumeration problems in this field are collected in the survey article [13]. Some applications of P´olya’s and de Bruijn’s theorems in computer graphics appear for example in articles by Banks, Linton, and Stockmeyer [15, 16]. More Numbers The book [10] by Andrews and Eriksson is an introduction to the theory of partitions of integers, directed toward undergraduates. A more advanced treatment is developed by Andrews [9]. Euler’s original proof of the pentagonal number theorem, along with some of its additional ramifications, is described by Andrews in [8].
2.11 References
279
The history of Stirling numbers, the notations developed for them, and many interesting identities they satisfy are discussed by Knuth in [177]. Rhyming schemes, as in Exercise 7d of Section 2.8.3 and Exercise 8 of Section 2.8.4, are analyzed by Riordan [237]. Stirling set numbers arise in a natural way in an interesting problem on juggling in an article by Warrington [280]. Some identities involving the complementary Bell numbers (Exercise 6 of Section 2.8.4) are established in the article by Uppuluri and Carpenter [270]. Eulerian numbers appear in the computation of the volume of certain slabs of ndimensional cubes in articles by Chakerian and Logothetti [51] and Marichal and Mossinghoff [197], and in the solution to a problem concerning a novel graduation ceremony in an article by Gessel [122]. The reference book by Sloane and Plouffe [258] and website by Sloane [257] catalog thousands of integer sequences, many of which arise in combinatorics and graph theory, and list references to the literature for almost all of these sequences. The book by Conway and Guy [61] is an informal discussion of several kinds of numbers, including many common combinatorial sequences.
Stable Marriage The important results of Gale and Shapley appeared in [117]. A fast algorithm that solves the “stable roommates” problem whenever a solution exists was first described by Irving in [166]. Stable matching problems are studied in Knuth [178] as motivation for the mathematical analysis of algorithms, and the structure of stable matchings in marriage and roommate problems is described in detail by Gusfield and Irving [143], along with algorithms for their computation. A matching algorithm for the “many-to-many” variation of the stable marriage problem, as in Exercise 9 of Section 2.9.2, is developed by Ba¨ıou and Balinski [14]. The monograph by Feder [103] studies extensions of the stable matching problem to more general settings.
Combinatorial Geometry A survey on Sylvester’s problem regarding ordinary lines for collections of points, as well as related problems, appears in Borwein and Moser [34]. A variation of Sylvester’s theorem for an infinite sequence of points lying within a bounded region in the plane is investigated by Borwein [33]. The influential paper of Erd˝os and Szekeres on convex polygons, first published in [94], also appears in the collection by Gessel and Rota [123]. The survey by Morris and Soltan [208] summarizes work on this problem and several of its variations. Dozens of problems in combinatorial geometry, both solved and unsolved, are described in the books by Brass, Moser, and Pach [37], Hadwiger, Debrunner, and Klee [144], Herman, ˇ sa [158], and Matouˇsek [200], as well as the survey article by Kuˇcera, and Simˇ Erd˝os and Purdy [93].
280
2. Combinatorics
Collected Papers The collection [123] by Gessel and Rota contains many influential papers in combinatorics and graph theory, including the important articles by Erd˝os and Szekeres [94], P´olya [225], and Ramsey [232]. The two-volume set edited by Graham and Neˇsetˇril [134,135] is a collection of articles on the mathematics of Paul Erd˝os, including many contributions regarding his work in combinatorics and graph theory. The Handbook of Combinatorics [131, 132] provides an overview of dozens of different areas of combinatorics and graph theory for mathematicians and computer scientists.
3 Infinite Combinatorics and Graphs
. . . the definitive clarification of the nature of the infinite has become necessary. . . — David Hilbert [160] Infinite sets are very peculiar, and remarkably different from finite sets. This can be illustrated with a combinatorial example. Suppose we have four pigeons and two pigeonholes. If we place the pigeons in the pigeonholes, one of the pigeonholes must contain at least two pigeons. This crowding will always occur, regardless of the arrangement we choose for the pigeons. Furthermore, the crowding will occur whenever there are more pigeons than holes. In general, if P (pigeons) is a finite set, and H (pigeonholes) is a proper subset of P , then there is no matching between the elements of P and H. Now suppose that we have a pigeon for each real number in the closed interval P = [0, 2]. Put a leg tag on each pigeon with its real number. Also suppose that we have a pigeonhole for each real number in the interval H = [0, 1]. Put an address plate on each pigeonhole with its real number. Note that H P , so the set of address plate numbers is a proper subset of the set of leg tag numbers. For each x ∈ [0, 2], place the pigeon tagged x in the pigeonhole with address x/2. Using this arrangement, no two pigeons will be assigned to the same pigeonhole. Thus, if P is infinite and H is a proper subset of P , there may be a matching between the elements of P and those of H. Infinite sets behave differently from finite sets, and we have used ideas from graph theory and combinatorics to illustrate this difference. One of the justifications for studying infinite versions of combinatorial and graph-theoretic theorems is to gain more insight into the behavior of infinite sets and, by contrast, more J.M. Harris et al., Combinatorics and Graph Theory, DOI: 10.1007/978-0-387-79711-3 3, c Springer Science+Business Media, LLC 2008
282
3. Infinite Combinatorics and Graphs A
B
C
D
1
2
3
FIGURE 3.1. A matching.
insight into finite sets. Sections 3.1 and 3.2 follow this agenda, culminating in a proof of a finite combinatorial statement using infinite tools. We can also use combinatorial properties to distinguish between different sizes of infinite sets, as is done in Section 3.7. This requires the deeper understanding of the axioms for manipulating infinite sets provided by Sections 3.3 and 3.4, and a precise notion of size that appears in Section 3.5. Combinatorial and graph-theoretic properties can also illuminate the limitations of our axiom systems, as shown in Sections 3.6 and 3.9. The chapter concludes with a hint at the wealth of related topics and a list of references.
3.1 Pigeons and Trees I wonder about the trees. — Robert Frost, The Sound of Trees The chapter introduction shows one way to use pigeons to distinguish between some finite and infinite sets. We could use this as a basis for defining finite sets, but this approach has some drawbacks that we will see in Section 3.4. It is more straightforward to say that a set is infinite if its not finite, and that a set is finite if its elements can be matched with a bounded initial segment of N. For example, the set {A, B, C, D} is finite, because the matching in Figure 3.1 exists. Note that the least integer not used in this matching is 4, which is also the size of the set {A, B, C, D}. This nifty trick, the result of using 0 in our matchings, reappears in Section 3.5. Using the preceding notion of infinite and finite sets, we can propose another pigeonhole principle. Suppose we have an infinite number of pigeons that we stuff into a finite number of pigeonholes. Momentarily disregarding physical considerations, we must have at least one pigeonhole that contains an infinite number of pigeons. Letting P be the set of pigeons, H the set of holes, and f the stuffing function, we obtain the following theorem. Theorem 3.1 (Infinite Pigeonhole Principle). Suppose P is infinite, H is finite, and f : P → H. Then there is an element h ∈ H such that the pre-image set {p ∈ P | f (p) = h} is infinite. Proof. Let P , H, and f be as in the hypothesis of the theorem. In particular, let H = {h0 , h1 , . . . , hn }. Suppose, by way of contradiction, that for each hi ∈ H,
3.1 Pigeons and Trees
283
b0 a0 c0 r
b1 c1
a1 b2
c2
FIGURE 3.2. A tree with labels.
the set Pi = {p ∈ P | f (p) = hi } has si elements. Because P can be written as P = P0 ∪ P1 ∪ · · · ∪ Pn , we see that i≤n si is the size of P . Thus P is finite, providing the desired contradiction. A physicist might suggest that the density of matter resulting from cramming an unbounded number of pigeons into a bounded pigeonhole would yield a fusion explosion, obliterating any evidence that could be used by litigious animal rights advocates. Home experiments with actual live pigeons are strongly discouraged. Despite the physical impracticality of our theorem, it is handy for proving a very nice theorem about trees. As stated in Chapter 1, a tree is a connected acyclic graph. For big trees, it is handy to designate a root and label the vertices. Figure 3.2 is an example. As a convenient convention, we always think of the root r as the bottom of the tree and vertices farther from r as being higher in the tree. A path through a tree is a path leading up and away from the root. For example, r, a1 , b2 and r, a1 , b1 , c0 are paths in the tree above. The sequence r, a1 , b0 is not a path, because a1 b0 is not an edge in the graph. If we add the edge a1 b0 , the resulting graph is not a tree. (Find the cycle!) A level in a tree is the collection of all vertices at a fixed distance from the root. The levels in our sample tree are {r}, {a0 , a1 }, {b0 , b1 , b2 } and {c0 , c1 , c2 }. If v is a vertex and w is a neighboring vertex in the next higher level, then we call w an immediate successor of v. In the sample, b1 is an immediate successor of a1 , and b0 is not. We can even say that c1 is a successor of a1 , but not an immediate successor. The vertex labels in the sample tree are arbitrary; if we want more than 26 levels, we could use a different labeling scheme. It is even possible to reuse labels in some circumstances, as shown in Exercise 2. Now we are ready to state K¨onig’s Lemma. The result concerns infinite trees, that is, trees with an infinite number of vertices. Essentially, K¨onig’s Lemma says that big skinny trees are tall.
284
3. Infinite Combinatorics and Graphs
Theorem 3.2 (K¨onig’s Lemma). If T is an infinite tree and each level of T is finite, then T contains an infinite path. Proof. Let T be an infinite tree in which every level is finite. Let L0 = {r}, L1 , L2 , . . . be the levels of T . We will construct a path as follows. Let r be the first element of the path. There are infinitely many vertices in T above r. Each of these vertices is either in L1 or above a unique vertex in L1 . Map each of the vertices above r to the vertex of L1 that it is equal to or above. We have mapped infinitely many vertices (pigeons) to the finitely many vertices of L1 (pigeonholes). By Theorem 3.1, there is at least one vertex of L1 that is above r and has infinitely many vertices above it; pick one and call it v1 . The path so far is r, v1 . Since there are infinitely many vertices above v1 , we can replace r by v1 in the preceding argument and select v2 . Similarly, for each n ∈ N, when we have found vn we can find vn+1 . Thus T contains an infinite path. K¨onig’s Lemma appears in the 1927 paper of D´enes K¨onig [179]. Some authors (e.g [218]) refer to the lemma as K¨onig’s Infinity Theorem. The name K¨onig’s Theorem is usually reserved for an unrelated result on cardinal numbers proved by Julius K¨onig, another (earlier) famous Hungarian mathematician. Exercises 1. Suppose we arrange finitely many pigeons in infinitely many pigeon holes. Use the Infinite Pigeonhole Principle to prove that there are infinitely many pigeonholes that contain no pigeons. 2. Reusing labels in trees. Figure 3.3 shows an example of a tree where labels are reused. 0 0 0 r
1 1 1 0
FIGURE 3.3. A tree with reused labels.
Note that in this tree, each vertex can be reached by a path corresponding to a unique sequence of labels. For example, there is exactly one vertex corresponding to r, 0, 1.
3.2 Ramsey Revisited
285
(a) Give an example of a tree with badly assigned labels, resulting in two vertices that have the same sequence of labels. (b) Prove that if the immediate successors of each vertex in a tree have distinct labels, then no two vertices can have matching sequences of labels. (c) Prove the converse of part 2b. 3. 2-coloring an infinite graph. Suppose G is a graph with vertices V = {vi | i ∈ N} and every finite subgraph of G can be 2-colored. Use K¨onig’s Lemma to prove that G is 2-colorable. (Hint: Build a tree of partial colorings. Put the vertex root, red, blue, blue in the tree if and only if assigning red to v0 , blue to v1 , and blue to v2 yields a 2-coloring of the subgraph with vertices {v0 , v1 , v2 }. An infinite path through such a tree will be a coloring of G. You must prove that the tree is infinite and that each level is finite.) 4. Construct an infinite graph where each finite subgraph can be colored using a finite number of colors, but where infinitely many colors are needed to color the entire graph. (Hint: Use lots of edges.) 5. Heine–Borel Theorem on compactness of the real interval [0, 1]. Use K¨onig’s Lemma to prove that if (a0 , b0 ), (a1 , b1 ), . . . are open intervals in R and [0, 1] ⊂ (a0 , b0 ) ∪ (a1 , b1 ) ∪ · · · , then for some finite value n, [0, 1] ⊂ (a0 , b0 ) ∪ (a1 , b1 ) ∪ · · · ∪ (an , bn ). (Hint: Build a tree where the labels in the ith level are the closed intervals obtained by removing (a0 , b0 ) ∪ (a1 , b1 ) ∪ · · · ∪ (ai , bi ) from [0, 1] and the successors of a vertex v are labeled with subintervals of the interval for v. Use the fact that the intersection of any sequence of nested closed intervals is nonempty to show that the tree contains no infinite paths. Apply the contrapositive of K¨onig’s Lemma.)
3.2 Ramsey Revisited Ah! the singing, fatal arrow, Like a wasp it buzzed and stung him! — H. W. Longfellow, The Song of Hiawatha Suppose that we 2-color the edges of K6 , the complete graph with six vertices, using the colors red and blue. As we proved in Chapter 1, the colored graph must contain a red K3 or a blue K3 . Since we can 2-color K5 in a way that prevents monochromatic triangles, K6 is the smallest graph that must contain a monochromatic triangle. Thus, the Ramsey number R(3, 3) is 6, as noted in Theorem 1.61. If we want to guarantee a monochromatic K4 subgraph then we must 2-color K18 , because R(4, 4) = 18. Exact values for R(p, p) when p ≥ 5 are not known, but by
286
3. Infinite Combinatorics and Graphs
the Erd˝os–Szekeres bound (Theorem 1.63) we know that these Ramsey numbers exist. Suppose that G is the complete graph with vertices V = {vi | i ∈ N}. If we 2color the edges of G, what can we say about monochromatic complete subgraphs? Since G contains K6 , it must contain a monochromatic K3 . Similarly, since G contains K18 , it must contain a monochromatic K4 . For p ≥ 5, we know that R(p, p) is finite and that G contains KR(p,p) as a subgraph, so G must contain a monochromatic Kp . So far we know that G must contain arbitrarily large finite monochromatic complete subgraphs. As a matter of fact, G contains an infinite complete monochromatic subgraph, though this requires some proof. Theorem 3.3. Let G be a complete infinite graph with vertices V = {vi | i ∈ N}. Given any 2-coloring of the edges, G will contain an infinite complete monochromatic subgraph. Proof. Suppose the edges of G are colored using red and blue. We will build an infinite subsequence wi | i ∈ N of V by repeatedly applying the pigeonhole principle (Theorem 3.1). Let w0 = v0 . For each i > 0, the edge v0 vi is either red or blue. Since this assigns vi to one of two colors for each i > 0, there is an infinite set of vertices V0 such that all the edges {v0 v | v ∈ V0 } are the same color. Suppose we have selected wn and Vn . Let wn+1 be the lowest-numbered vertex in Vn , and let Vn+1 be an infinite subset of Vn such that the edges in the set {wn+1 v | v ∈ Vn+1 } are the same color. This completes the construction of the sequence. This sequence wi | i ∈ N has a very interesting property. If i < j < k, then wj and wk are both in Vi , and consequently wi wj and wi wk are the same color! We will say that a vertex wi is blue-based if j > i implies wi wj is blue, and red-based if j > i implies wi wj is red. Each vertex in the infinite sequence wi | i ∈ N is blue-based or red-based, so by the pigeonhole principle there must be an infinite subsequence wi0 , wi1 , . . . where each element has the same color base. As a sample case, suppose the vertices in the subsequence are all bluebased. Then for each j < k, since wij is blue-based, the edge wij wik is blue. Thus all the edges of the complete subgraph with vertices {wi0 , wi1 , . . . } are blue. If the subsequence vertices are red-based, then the edges of the associated infinite complete subgraph are red. Using the preceding theorem, we can prove that the finite Ramsey numbers exist without relying on the Erd˝os–Szekeres bound. Theorem 3.4. For each n ∈ N there is an m ∈ N such that R(n, n) = m. Proof. By way of contradiction, suppose that there is an n such that for every m there is a 2-coloring of the edges of Km that contains no monochromatic Kn subgraph. Let G be the complete graph with vertices V = {vi | i ∈ N}. Suppose E = {ei | i ∈ N} is an enumeration of the edges of G. Construct a tree T of partial edge colorings of G as follows. Include the sequence r oot, c0 , c1 , c2 , . . . , ck in T if and only if whenever edge ei is colored color ci for all i ≤ k, the subgraph of
3.2 Ramsey Revisited
287
G containing e0 , e1 , . . . , ek contains no monochromatic Kn . The kth level of T contains at most 2k vertices, so each level is finite. Since we have assumed that there is a way of coloring any Km so that no monochromatic Kn appears, T is infinite. By K¨onig’s Lemma (Theorem 3.2), T has an infinite path. This infinite path provides a 2-coloring of G that contains no monochromatic Kn . Thus for this coloring, G has no infinite complete monochromatic subgraph, contradicting the preceding theorem. Our initial supposition must be false, and so for each n, there is an m such that R(n, n) = m. We just used the infinite pigeonhole principle, infinite trees, and colorings of infinite graphs to prove a result about finite graphs! (In doing so, we are imitating Ramsey [232].) Besides being inherently fascinating, infinite constructions are very handy. Furthermore, the arguments are easily generalized. In order to take full advantage of our work, we need some new notation. Here come the arrows! The notation κ → (λ)2c means that every c-colored complete graph on κ vertices contains a monochromatic complete subgraph with λ vertices. Most people pronounce κ → (λ)2c as “kappa arrows lambda 2 c.” The statement that R(3, 3) = 6 combines the facts that 6 → (3)22 (K6 is big enough) and 5 → (3)22 (K5 is not big enough). If we imitate set theorists and write ω for the size of the set V = {vi | i ∈ N}, we can rewrite Theorem 3.3 as ω → ω22 . Abbreviating “for all n” by ∀n and “there exists an m” by ∃m, Theorem 3.4 becomes ∀n∃m m → (n)22 . Arrow notation is particularly useful if we want to use lots of colors. It is easy to check that if every use of two colors is replaced by some finite value c in the proof of Theorem 3.3, the result still holds. The same can be said for Theorem 3.4. Consequently, for any c ∈ N we have ω → (ω)2c
and ∀n∃m m → (n)2c .
Note that when c is largish, the arrow notation is particularly convenient. For example, the statement “m is the least number such that m → (3)29 ” translates into Ramsey number notation as the unwieldy formula R(3, 3, 3, 3, 3, 3, 3, 3, 3) = m. Nobody would want to translate m → (3)21000 . On the other hand, R(3, 4) = 9 does not translate into our arrow notation. The 2 in κ → (λ)2c indicates that we are coloring unordered pairs of elements taken from a set of size κ. When we edge color a graph, we are indeed assigning colors to the pairs of vertices corresponding to the edges. However, we can extend Ramsey’s theorem by coloring larger subsets. The resulting statements are still very combinatorial in flavor, though they no longer refer to edge colorings. For example, the notation κ → (λ)nc means that for any assignment of c colors to the unordered n-tuples of κ, there is a particular color (say lime) and a subset X ⊂ κ of size λ such that no matter how we select n elements from X, the corresponding n-tuple will be lime colored. The proofs of Theorems 3.3 and 3.4 can be modified to prove the following theorems. Theorem 3.5 (Infinite Ramsey’s Theorem). For all n ∈ N and c ∈ N, ω → (ω)nc .
288
3. Infinite Combinatorics and Graphs
Proof. By induction on n. Exercise 2 gives hints. Theorem 3.6 (Finite Ramsey’s Theorem). For all k, n, c ∈ N, there is an m ∈ N such that m → (k)nc . Proof. Follows from Theorem 3.5. Exercise 3 gives hints. Throughout this section we have been very picky about our infinite sets. For example, V = {vi | i ∈ N} has a built-in matching with N. What happens if we look at graphs with a vertex for each real number? In Section 3.7 we will learn that the analog of Theorem 3.3 fails for an infinite graph of this sort. For what sorts of infinite graphs does Theorem 3.3 hold? To answer this question, we need a deeper understanding of the infinite. Exercises 1. Let X = {xi | i ∈ N} be a set. Suppose that the relation ≤ is a partial ordering on X. That is, for any a, b, c ∈ X, suppose that • a ≤ a, • if a ≤ b and b ≤ a, then a = b, and • if a ≤ b ≤ c, then a ≤ c. Use Theorem 3.3 to prove that there is an infinite subset Y ⊂ X such that either • for every a, b ∈ Y , either a ≤ b or b ≤ a, or • for every a, b ∈ Y , both a ≤ b and b ≤ a. A subset of the first type is called a chain, and a subset of the second type is called an antichain. 2. Prove Theorem 3.5. Begin by proving Theorem 3.5 for 2 colors. Proceed by induction on n. For n = 1, use the pigeonhole principle as a base case. For the induction step, assume that ω → (ω)n2 , and prove that ω → (ω)n+1 by 2 imitating the proof of Theorem 3.3, substituting applications of ω → (ω)n2 for the use of the pigeonhole principle. Given the theorem for 2 colors, there are many ways to prove it for other finite numbers of colors. You could replace 2 by c everywhere in the proof you just did, or you could try proving the theorem for c colors and n-tuples by using the theorem for 2 colors and 2n-tuples. 3. Prove Theorem 3.6. Imitate the proof of Theorem 3.4, using Theorem 3.5 in place of Theorem 3.3.
3.2 Ramsey Revisited
289
Red
1
2
3
4
Blue FIGURE 3.4. A tripartite graph representing a 2-coloring.
4. One way to visualize coloring triples. We can represent a coloring of triples by attaching a claw to a triple that points in a particular direction. For example, the tripartite graph in Figure 3.4 represents coloring {0, 1, 2} red and {1, 3, 4} blue. Figure 3.5 represents a 2-coloring of the ten triples that can be formed from the set V = {0, 1, 2, 3, 4}. You can check that every four-element subset of V contains a triple with a claw on the blue side and a triple with a claw on the red side. Thus, Figure 3.5 illustrates that 5 → (4)32 . Red
1
2
3
4
Blue FIGURE 3.5. A 2-coloring of the triples from {0, 1, 2, 3, 4}.
(a) Find a different coloring that shows that 5 → (4)32 and represent it as a tripartite graph. (How do you know that your coloring is significantly different?) (b) Find a tripartite graph that shows that 5 → (3)22 . (c) Devise a way to draw a similar graph that shows that 6 → (3)23 . (d) Find a tripartite graph that shows that 6 → (4)32 . Since every triple gets a claw, make your life easier by drawing only the red claws.
290
3. Infinite Combinatorics and Graphs
3.3 ZFC No one shall be able to drive us from the paradise that Cantor created for us. — David Hilbert [160] Paraphrasing Hilbert, in Cantor’s paradise mathematicians can joyfully prove new and rich results by employing infinite sets. Since we have been living reasonably comfortably in this paradise since the beginning of the chapter, Hilbert’s anxiety about eviction may seem misplaced. However, Russell and other mathematicians discovered some set-theoretic paradoxes that made the na¨ıve use of infinite sets very questionable. Hilbert responded by calling for a careful investigation with the goal of completely clarifying the nature of the infinite. One could argue that Hilbert’s call (made in 1925) had already been answered by Zermelo in 1908. In the introduction to [293], Zermelo claimed to have reduced the entire theory created by Cantor and Dedekind to seven axioms and a few definitions. Although we now use formulations of the axioms of separation and replacement that more closely resemble those of Fraenkel and Skolem, the most commonly used axiomatization of set theory, ZFC, consists primarily of axioms proposed by Zermelo. The letters ZFC stand for Zermelo, Fraenkel, and Axiom of Choice. Although Skolem does not get a letter, it would be hard to overestimate his influence in recasting ZFC as a first order theory. ZFC succinctly axiomatizes what has become the de facto foundation for standard mathematical practice. With sufficient diligence, it would be possible to formalize every theorem appearing so far in this book and prove each of them from the axioms of ZFC. Since these proofs can be carried out in a less formal setting, foundational concerns are insufficient motivation for adopting an axiomatic approach. However, many of the results in Sections 3.4 through 3.10 cannot even be stated without referring to ZFC. We will use ZFC as a base theory to explore the relative strength of some very interesting statements about sets. In particular, ZFC will be central to our discussion of large cardinals and infinite combinatorics.
3.3.1 Language and Logical Axioms The comfort of the typesetter is certainly not the summum bonum. — Gottlob Frege [112] Before we discuss the axioms of ZFC, we need to list the symbols we will use. Although some of these symbols may be unfamiliar, they can be used as a very convenient shorthand. Variables can be uppercase or lowercase letters with subscripts tacked on if we please. Good examples of variables include A, B, x, and y3 . The symbol ∅ denotes the empty set, and P and ∪ are function symbols for the power set and union. The exact meaning of ∅, P(x), and ∪x are determined by the axioms in the next section. (∪x is not a typographical error; a discussion appears later.) A
3.3 ZFC
Formula ¬θ θ∧ψ θ∨ψ θ→ψ θ↔ψ ∀xθ ∃xθ
291
Translation not θ θ and ψ θ or ψ if θ then ψ θ if and only if ψ for all sets x, θ holds there is a set x such that θ holds
TABLE 3.1. Translations of connectives and quantifiers.
term is a variable, the symbol ∅, or the result of applying a function to a term. In ZFC, terms always denote sets. Consequently, all the objects discussed in ZFC are sets. Some early formalizations of set theory include distinct objects with no elements. These objects are usually called atoms or urelements. They do not show up in ZFC. The atomic formulas of ZFC are x ∈ y and x = y, where x and y could be any terms. As one would expect, the formula x ∈ y means x is an element of y. The connection between ∈ and = is partly determined by the axiom of extensionality (in the next section) and partly determined by the fact that = really does denote the familiar equality relation. All other formulas of ZFC are built up by repeatedly applying logical connectives and quantifiers to the atomic formulas. Table 3.1 lists typical formulas and their translations. The letters θ and ψ denote formulas of ZFC. Specifying that ZFC is a first order theory implicitly appends the axioms for predicate calculus with equality to the axioms for ZFC. In a nutshell, these logical axioms tell us that the connectives and quantifiers have the meanings shown in Table 3.1, and that = is well behaved. In particular, we can substitute equal terms. Thus, if x = y and θ(x) both hold, then θ(y) holds, too. As a consequence, we can prove the following theorem. Theorem 3.7. Equal sets have the same elements. Formally, x = y → ∀t(t ∈ x ↔ t ∈ y). Proof. Suppose x = y. Fix t. If t ∈ x, then by substitution, t ∈ y. Similarly, if t ∈ y, then t ∈ x. Our choice of t was arbitrary, so ∀t(t ∈ x ↔ t ∈ y). We could completely formalize the preceding argument as a symbolic logic proof in any axiom system for predicate calculus with equality. Some good formal axiom systems can be found in Mendelson [201] or Kleene [176] by readers with a frighteningly technical bent. It is very convenient to write x ⊂ y for the formula ∀t(t ∈ x → t ∈ y). Using this abbreviation and only the axioms of predicate calculus, we could prove that ∀x(x ⊂ x), showing that every set is a subset of itself. We could also prove that
292
3. Infinite Combinatorics and Graphs
containment is a transitive relation, which can be formalized as ∀x∀y∀z((x ⊂ y ∧ y ⊂ z) → x ⊂ z). The preceding results (which appear in the exercises) rely on logical axioms rather than on the actual nature of sets. To prove meaty theorems, we need more axioms.
3.3.2 Proper Axioms . . . I tasted the pleasures of Paradise, which produced these Hell torments. . . — Pangloss, in Candide The axiom system ZFC consists of nine basic axioms plus the axiom of choice. Typically, the nine basic axioms are referred to as ZF. In this section, we will examine the axioms of ZF, including their formalizations, some immediate applications, and a few random historical comments. This should be less painful than the affliction of Pangloss. 1. Axiom of extensionality: If a and b have the same elements, then a = b. Formally, ∀x(x ∈ a ↔ x ∈ b) → a = b. This axiom is the converse of Theorem 3.7, so ZF can prove that a = b if and only if a and b have exactly the same elements. Using this, we can prove the following familiar theorem about the connection between subsets and equality. Theorem 3.8. For all sets a and b, a = b if and only if a ⊂ b and b ⊂ a. Formally, ∀a∀b(a = b ↔ (a ⊂ b ∧ b ⊂ a)). Proof. First suppose that a = b. Since a ⊂ a (see Exercise 1), by substitution we have a ⊂ b and b ⊂ a. Thus, a = b → (a ⊂ b ∧ b ⊂ a). To prove the converse, suppose a ⊂ b and b ⊂ a. Since a ⊂ b, for every x we have that if x ∈ a then x ∈ b. Similarly, since b ⊂ a, x ∈ b implies x ∈ a. Summarizing, for all x, x ∈ a ↔ x ∈ b. By the axiom of extensionality, a = b. The axiom of extensionality and the preceding theorem give us strategies for proving that sets are equal. Most proofs of set equality apply one of these two approaches. 2. Empty set axiom: ∅ has no elements. Formally, ∀x(x ∈ / ∅). The empty set has some unusual containment properties. For example, it is a subset of every set. Theorem 3.9. ∅ is a subset of every set. Formally, ∀t(∅ ⊂ t).
3.3 ZFC
293
Proof. The proof relies on the mathematical meaning of implication. Suppose t is a set. Pick any set x. By the empty set axiom, x ∈ / ∅, so x ∈ ∅ implies x ∈ t. (When the hypothesis is false, the implication is automatically true. If I am the king of the world, then you will send me all your money. The statement is true, but no checks have arrived.) Formally, ∀x(x ∈ ∅ → x ∈ t), so ∅ ⊂ t. The preceding proof also implies that ∅ ⊂ ∅, although Exercise 1 provides a more direct proof. 3. Pairing axiom: For every x and y, the pair set {x, y} exists. Formally, ∀x∀y∃z∀t(t ∈ z ↔ (t = x ∨ t = y)). In the formal version of the axiom, the set z has x and y as its only elements. Thus, z is {x, y}. The pair sets provided by the pairing axiom are unordered, so {x, y} = {y, x}. The pairing axiom can be used to prove the existence of singleelement sets, which are often called singletons. Theorem 3.10. For every x, the set {x} exists. That is, ∀x∃z∀t(t ∈ z ↔ t = x). Proof. Fix x. Substituting x for y in the pairing axiom yields a set z such that ∀t(t ∈ z ↔ (t = x ∨ t = x)). By the axiom of extensionality, z = {x}. The empty set axiom, the pairing axiom, and Theorem 3.10 on the existence of singletons are all combined in Zermelo’s original axiom of elementary sets [293]. As an immediate consequence he solves Exercise 4, showing that singleton sets have no proper subsets. The statement of the next axiom uses the union symbol in an unusual way. In particular, we will write ∪{x, y} to denote the familiar x ∪ y. This prefix notation is very convenient for writing unions of infinite collections of sets. For example, if X = {xi | i ∈ N}, then the infinite union x0 ∪ x1 ∪ x2 ∪ · · · can be written as ∪X, eliminating the use of pesky dots. The union axiom says that ∪X contains the appropriate elements. 4. Union axiom: The elements of ∪X are precisely those sets that are elements of the elements of X. Formally, ∀t(t ∈ ∪X ↔ ∃y(t ∈ y ∧ y ∈ X)). Exercise 5 is a verification that ∪{x, y} is exactly the familiar set x ∪ y. The notion of union extends naturally to collections of fewer than two sets, also. By the union axiom, t ∈ ∪{x} if and only if there is a y ∈ {x} such that t ∈ y, that is, if and only if t ∈ x. Thus, ∪{x} = x. For an exercise in wildly vacuous reasoning, try out Exercise 6, showing that ∪∅ = ∅. Like the union axiom, the power set axiom defines one of our built-in functions.
294
3. Infinite Combinatorics and Graphs
5. Power set axiom: The elements of P(X) are precisely the subsets of X. Formally, ∀t(t ∈ P(X) ↔ t ⊂ X). This is the same power set operator that appears in the first chapter of dozens of mathematics texts. For example, P({a, b}) = {∅, {a}, {b}, {a, b}}. If X is a finite set of size n, then P(X) has 2n elements. Thus for finite sets, the size of P(X) is always larger than the size of X. In Section 3.5 we will prove that this relation continues to hold when X is infinite. It may seem odd that we do not have other built-in functions, like intersection, set-theoretic difference, or Cartesian products. However, all these operations can be defined using the next axiom and are omitted in order to reduce redundancy in the axioms. Our version of the separation axiom is the invention of Skolem [255]. Both Skolem and Fraenkel [109] proposed emendations to Zermelo’s version of the separation axiom. 6. Separation axiom: If ψ(x) is a formula and X is a set, then the set denoted by {x ∈ X | ψ(x)} exists. More formally, given any set X and any formula ψ(x) in the language of ZFC, if ψ(x) does not contain the variable S, then ∃S∀x(x ∈ S ↔ (x ∈ X ∧ ψ(x))). Note that ψ(x) may contain unquantified variables that can be viewed as parameters. Thus S can be defined in terms of X and other given sets. We can use the separation axiom to prove that intersections exist. It is nice to use intersection notation that is parallel to our union notation, so we write ∩{a, b} for a ∩ b. In general, an element should be in ∩X precisely when it is in every element of X. Theorem 3.11. For any nonempty set X, ∩X exists. That is, for any set X there is a set Y such that ∀x(x ∈ Y ↔ ∀t(t ∈ X → x ∈ t)). Proof. Fix X. Let Y = {x ∈ ∪X | ∀t(t ∈ X → x ∈ t)}. By the separation axiom, Y exists. We still need to show that Y is the desired set. By the definition of Y , if x ∈ Y , then ∀t(t ∈ X → x ∈ t). Conversely, if ∀t(t ∈ X → x ∈ t), then since X is nonempty, ∃t(t ∈ X ∧ x ∈ t). Thus x ∈ ∪X. Because x ∈ ∪X and ∀t(t ∈ X → x ∈ t), we have x ∈ Y . Summarizing, x ∈ Y if and only if ∀t(t ∈ X → x ∈ t). It is also possible to show that ∩X is unique. (See Exercise 8.) Since we can show that for all X the set ∩X exists and is unique, we can add the function
3.3 ZFC
295
symbol ∩ to the language of ZFC. Of course, the symbol itself could be subject to misinterpretation, so we need to add a defining axiom. The formula ∀x(x ∈ ∩X ↔ ∀t(t ∈ X → x ∈ t)) will do nicely. The resulting extended theory is more convenient to use, but proves exactly the same theorems, except for theorems actually containing the symbol ∩. Mathematical logicians would say that ZFC with ∩ is a conservative extension of ZFC. Using the same process, we can introduce other set-theoretic functions. For example, we can specify a set that represents the ordered pair (x, y), and define the Cartesian product X × Y = {(x, y) | x ∈ X ∧ y ∈ Y }. Ordered n-tuples can be defined in a number of reasonable ways from ordered pairs. We could define the relative complement of Y in X by X − Y = {x ∈ X | x ∈ / Y }. See Exercises 9, 10, and 11 for more discussion of these operations. There are some significant restrictions in the sorts of functions that could be conservatively added to ZFC. For example, as above it is acceptable to introduce the relative complement, but not a full-blown general complement. (Books usually use X or X c to denote a general complement.) Given a general complement, we could prove that X ∪ X c existed. This would give us a set of all sets, but that is prohibited by the separation axiom. Theorem 3.12. There is no universal set. That is, there is no set U such that ∀x(x ∈ U ). Proof. Suppose by way of contradiction that ∀x(x ∈ U ). Applying the separation axiom, there is a set X such that X = {z ∈ U | z ∈ / z}. Note that for all z, z ∈ X if and only if z ∈ U and z ∈ / z. Furthermore, z ∈ U and z ∈ / z if and only if z∈ / z. Thus, z ∈ X if and only if z ∈ / z for any z we care to choose. In particular, substituting X for z gives us X ∈ X if and only if X ∈ / X, yielding the desired contradiction. The preceding proof contains the gist of Russell’s paradox. Briefly, Russell’s paradox says that the existence of {z | z ∈ / z} leads inexorably to contradictions. Note that the existence of {z | z ∈ / z} is not proved by the separation axiom, because the specified set is not bounded. For any bound X, we can prove that {z ∈ X | z ∈ / z} exists; it is just a harmless subset of X. By requiring bounds on definable sets, we cleverly sidestep paradoxes that ensnare the users of na¨ıve set theory. For another experiment with Russell’s style of argument, try Exercise 12. Part of Hilbert’s motivation for the rigorous study of set theory was to gain a deeper understanding of infinite sets. So far, our axioms do not guarantee the existence of a single infinite set. (Readers who love technical details may want to construct a model of axioms 1 through 6 in which every set is finite. The universe for this model will be infinite, but each element in the universe will be finite.) One way to construct an infinite set is to start with ∅ and successively apply Theorem 3.10. If we let x0 = ∅ and xn+1 = {xn } for each n, this yields a set for
296
3. Infinite Combinatorics and Graphs
each natural number. In particular, x0 = ∅, x1 = {∅}, x2 = {{∅}}, and so on. The next axiom affirms the existence of a set containing all these sets as elements. 7. Infinity axiom: There is a set Z such that (i) ∅ ∈ Z and (ii) if x ∈ Z, then {x} ∈ Z. Formally, ∃Z(∅ ∈ Z ∧ ∀x(x ∈ Z → ∃y(y ∈ Z ∧ ∀t(t ∈ y ↔ t = x)))). The axiom of infinity guarantees the existence of some set satisfying properties (i) and (ii). By applying the power set axiom, the separation axiom, and taking an intersection, we can find the smallest set with this property. For details, see Exercise 13. Zermelo’s axiomatization of set theory consists of axioms 1 through 7 plus the axiom of choice. We will discuss the axiom of choice shortly. In the meantime, there are two more axioms that have been appended to ZF that should be mentioned. The first of these is the axiom of replacement, proposed in various versions by Fraenkel ([107], [108], and [110]), Skolem [255], and Lennes [186]. 8. Replacement axiom: Ranges of functions restricted to sets exist. That is, if f (x) is a function and D is a set, then the set R = {f (x) | x ∈ D} exists. More formally, if ψ(x, y) is a formula of set theory such that ∀x∀y∀z((ψ(x, y) ∧ ψ(x, z)) → y = z), then for every set D there is a set R such that ∀y(y ∈ R ↔ ∃x(x ∈ D ∧ ψ(x, y)). Note that the formula ψ(x, y) in the formal statement of the axiom can be viewed as defining the relation f (x) = y. The replacement axiom is useful for proving the existence of large sets. In particular, if we assume that ZFC and the continuum hypothesis are consistent, in the absence of the replacement axiom it is impossible to prove that any sets of size greater than or equal to ℵω exist. (To find out what ℵω is, you have to stick around until Section 3.5.) The final axiom of ZF is the regularity axiom. In a nutshell, it outlaws some rather bizarre behavior, for example having x ∈ y ∈ x. Attempts to avoid these strange constructs can be found in the work of Mirimanoff [207], but Skolem [255] and von Neumann [276] are usually given credit for proposing the actual axiom. 9. Regularity axiom: Every nonempty set x contains an element y such that x ∩ y = ∅. Formally, ∀x(x = ∅ → ∃y(y ∈ x ∧ x ∩ y = ∅)).
3.3 ZFC
297
The idea here is that ∈ can be viewed as a partial ordering on any set by letting x < y mean x ∈ y. The regularity axiom says that every set has a minimal element in this ordering. This rules out loops (like x ∈ y ∈ x) and infinite descending chains (like · · · ∈ x3 ∈ x2 ∈ x1 ∈ x0 ). The following theorem shows that tight loops are outlawed. Theorem 3.13. For all x, x ∈ / x. Proof. By way of contradiction, suppose x ∈ x. By Theorem 3.10, we know the set X = {x} exists. The set X is nonempty, so by the regularity axiom, there is an element y ∈ X such that X ∩ y = ∅. The only element of X is x, so y = x and X ∩ x = ∅. However, x ∈ X and x ∈ x, so x ∈ X ∩ x = ∅, a contradiction. Summarizing this section, the proper axioms of ZF are: 1. Axiom of extensionality, 2. Empty set axiom, 3. Pairing axiom, 4. Union axiom, 5. Power set axiom, 6. Separation axiom, 7. Infinity axiom, 8. Replacement axiom, and 9. Regularity axiom. We are still missing one axiom from Zermelo’s list, the axiom of choice.
3.3.3 Axiom of Choice Vizzini: . . . so I can clearly not choose the wine in front of me. Man in black: You’ve made your decision then? Vizzini: [happily] Not remotely! — The Princess Bride Suppose that we, like Vizzini, are faced with the task of selecting one glass from a set of two glasses. Since the set of glasses is nonempty, we can select one element and get on with our lives, which hopefully will be much longer than Vizzini’s. To be very technical, the justification for our selection is the logical principle of existential instantiation. Similarly, using only axioms of ZF, we can always select one element from any nonempty set, without regard for the size of the set. Furthermore, we could repeat this process any finite number of times, so we can choose one element from each set in any finite list of nonempty sets.
298
3. Infinite Combinatorics and Graphs
By contrast, making an infinite number of choices simultaneously can often be problematic, depending on the circumstances. Suppose that we have an infinite collection of pairs of boots. We can pick one boot from each pair by specifying that we will select the left boot from each pair. Because each nonempty set (pair of boots) has a designated element (left boot), ZF suffices to prove the existence of the set of selected boots. Working in ZF, we cannot carry out the same process with an infinite collection of pairs of socks, because socks are not footed. We need a new axiom. In [244], Russell discusses this boot problem, though rather than selecting socks, he considers the case where “the left and right boots in each pair are indistinguishable.” Cruel shoes indeed! The axiom of choice guarantees the existence of a set of selected socks. The following version of the axiom is very close to that of Zermelo [293]. 10. Axiom of choice (AC): If T is a set whose elements are all sets that are nonempty and mutually disjoint, then ∪T contains at least one subset with exactly one element in common with each element of T . Most recent works use a formulation of the axiom of choice that asserts the existence of choice functions. In terms of socks, when a choice function is applied to a pair of socks, it outputs a designated sock. In the following statement, if T is a set of pairs of socks, t would be a pair of socks, and f (t) would be a sock. 10 . Axiom of choice (AC2): If T is a set of nonempty sets, then there is a function f such that for every t ∈ T , f (t) ∈ t. We use ZFC to denote ZF plus either version of AC. This is not imprecise, since we can prove that the two versions of the axiom of choice are interchangeable. Theorem 3.14. ZF proves that AC holds if and only if AC2 holds. Proof. First assume all the axioms of ZF plus AC. Let T be a set of nonempty sets. Define the function g with domain T by setting g(t) = {(t, y) | y ∈ t} for each t ∈ T . Essentially, g(t) looks like the set t with a flag saying “I’m in t” attached to each element. By the replacement axiom, the set Y = {g(t) | t ∈ T } exists. The elements of Y are nonempty and disjoint, so by AC there is a set S that contains exactly one element from each element of Y . Thus S is a set of ordered pairs of the form (t, y), where exactly one pair is included for each t ∈ T . Let f (t) be the unique y such that (t, y) ∈ S. Then f is the desired choice function. To prove the converse, assume ZF plus AC2. Let T be a set whose elements are nonempty and disjoint. By AC2, there is a function f such that for each t ∈ T , f (t) ∈ t. By the replacement axiom, S = {f (t) | t ∈ T } exists. S is the desired subset of ∪T .
3.3 ZFC
299
Zermelo ([291], [292]) used AC to prove that every set can be well-ordered. Hartogs [155] extended Zermelo’s result by proving that AC is equivalent to this well-ordering principle. Hartogs’ result is identical in format to the equivalence result that we just proved. What really makes Hartogs’ result and our equivalence theorem interesting is the fact that AC can neither be proved nor disproved in ZF. (Technically, we just implicitly assumed that ZF is consistent. I assure you that many people make much more bizarre assumptions in their daily lives.) G¨odel [125] proved that ZF cannot disprove AC, and Cohen ([58], [59]) showed that ZF cannot prove AC. Thus our equivalence theorem and the theorem of Hartogs list statements that we can add interchangeably to strengthen ZF. In later sections we will see more examples of equivalence theorems and more examples of statements that strengthen ZF and ZFC. Exercises 1. Prove that set containment is reflexive. That is, prove ∀x(x ⊂ x). (This requires only logical properties.) 2. Prove that set containment is transitive. That is, prove ∀x∀y∀z((x ⊂ y ∧ y ⊂ z) → x ⊂ z). (This requires only logical properties.) 3. Prove that the empty set is unique. That is, if ∀x(x ∈ / y), then y = ∅. 4. Prove that if y ⊂ {x}, then y = ∅ or y = {x}. 5. Prove that ∪{x, y} is exactly the familiar set x ∪ y. That is, prove that t ∈ ∪{x, y} if and only if t ∈ x or t ∈ y. 6. Prove that ∪∅ = ∅. 7. Find P(∅), P(P(∅)), and P(P(P(∅))). (To make your answers look really bizarre and drive your instructor nuts, write { } for ∅.) 8. Prove that ∩X is unique. That is, show that if Y is a set that satisfies the formula ∀x(x ∈ Y ↔ ∀t(t ∈ X → x ∈ t)) and Z is a set that satisfies the formula ∀x(x ∈ Z ↔ ∀t(t ∈ X → x ∈ t)), then Y = Z. (Proving the existence of Y and Z requires the separation axiom (see Theorem 3.11), but this problem uses the axiom of extensionality.) 9. Let X − Y denote the set {x ∈ X | x ∈ / Y }. (a) Prove that for every X and Y , X − Y exists. (b) Prove that for every X and Y , X − Y is unique. (c) Under what circumstances does X − Y = Y − X?
300
3. Infinite Combinatorics and Graphs
10. Representations of ordered pairs. (a) Kuratowski [184] suggested that the ordered pair (a, b) can be represented by the set {{a, b}, a}. (This encoding is still in use.) Using this definition, prove that (a, b) = (c, d) if and only if a = c and b = d. (b) Using Kuratowski’s encoding, show that if X and Y are sets, then the set X × Y defined by X × Y = {(x, y) | x ∈ X ∧ y ∈ Y } exists and is uniquely determined by X and Y . (c) Wiener [283] suggested that the ordered pair (x, y) can be represented by the set {{{x}, ∅}, {{y}}}. If you dare, repeat parts 10a and 10b using this encoding. (d) Show that encoding (a, b) by {a, {b}} leads to difficulties. (Find two distinct ordered pairs that have the same representation in this encoding.) 11. Representations of n-tuples. (a) Usually, set theorists represent (a, b, c) by ((a, b), c), where pairs are represented using the Kuratowski encoding from Exercise 10. Using this representation prove the following: (i) (a, b, c) = (d, e, f ) ↔ (a = d ∧ b = e ∧ c = f ), (ii) X × Y × Z exists, and (iii) X × Y × Z is unique. (b) To address type-theoretic concerns, Skolem [256] suggested representing (a, b, c) by ((a, c), (b, c)). Repeat part 11a with this encoding. (c) Using parts 11a and 11b as the base cases in an induction argument, extend the statements in part 11a to n-tuples for each natural number n. (If you do this, you clearly have a great love for long technical arguments. You might as well repeat the whole mess with the Wiener encoding.) (d) Show that encoding (a, b, c) by {{a, b, c}, {a, b}, {a}} leads to difficulties. (You can find distinct triples with the same representation, or you can find an ordered pair that has the same representation as an ordered triple.) 12. Prove that for all X, P(X) ⊂ X. (Hint: Suppose that for some X, P(X) ⊂ X. Define Y = {t ∈ X | t ∈ / t}. Show that Y ∈ X and shop for a contradiction.) 13. Let Z be the set provided by the infinity axiom. Let T be the set of subsets of Z that satisfy properties (i) and (ii) of the infinity axiom. Let Z0 = ∩T . (a) Prove that T exists. (Hint: T ⊂ P(Z).)
3.4 The Return of der K¨onig
301
(b) Prove that Z0 exists. (c) Prove that if X satisfies properties (i) and (ii) of the infinity axiom, then Z0 ⊂ X. 14. Use the regularity axiom to prove that for all x and y either x ∈ / y or y ∈ / x.
3.4 The Return of der K¨onig And Aragorn planted the new tree in the court by the fountain. — J. R. R. Tolkien, The Return of the King It may seem that the discussion of the last section strayed from our original topics in graph theory and combinatorics. However, AC is actually a statement about infinite systems of distinct representatives (SDR). As defined in Section 1.7.2, an SDR for a family of sets T is a set that contains a distinct element from each set in T . For disjoint families, we have the following theorem. Theorem 3.15. ZF proves that the following are equivalent: 1. AC. 2. If T is a family of disjoint nonempty sets, then there is a set Y that is an SDR for T . Proof. First, assume ZF and AC and suppose T is a family of disjoint nonempty sets. By AC, there is a set Y ⊂ ∪T that has exactly one element in common with each element of T . Since the elements of T are disjoint, Y is an SDR for T . To prove the converse, suppose T is a family of disjoint nonempty sets. Let Y be an SDR for T . Then Y ⊂ ∪T , and Y has exactly one element in common with each element of T , as required by AC. What if T is not disjoint? For finite families of sets, it is sufficient to know that every union of k sets has at least k elements. This is still necessary for infinite families, but no longer sufficient. Consider the family of sets T = {X0 , X1 , X2 , . . . } defined by X0 = {1, 2, 3, . . . }, X1 = {1}, X2 = {2}, and so on. The union of any k sets from T has at least k elements. As a matter of fact, any collection of k sets from T has an SDR. However, the whole of T has no SDR. To build an SDR for T , we must pick some n as a representative for X0 . This immediately leaves us with no element to represent Xn . We are out of luck. Note that if we chuck X0 , we can find an SDR for the remaining sets. (There are not many options for the representatives; it is hard to go wrong.) The infinite set X0 is the source of all our problems. If we allow only finite sets in the family, then we get a nice SDR existence theorem originally proved by Marshall Hall [145]. Theorem 3.16. Suppose T = {X0 , X1 , X2 , . . . } is a family of finite sets. T has an SDR if and only if for every k ∈ N and every collection of k sets from T , the union of these sets contains at least k elements.
302
3. Infinite Combinatorics and Graphs
Proof. Let T = {X0 , X1 , X2 , . . . } and suppose that each Xi is finite. If T has an SDR, then for any collection of k sets, their representatives form a k element subset of their union. To prove the converse, assume that for every k ∈ N, the union of any k elements of T contains at least k elements. By Theorem 1.52, for each k the subfamily {X0 , X1 , . . . , Xk } has an SDR. Let Y be the tree whose paths are of the form r, x0 , x1 , . . . , xk , where xi ∈ Xi for i ≤ k and {x0 , x1 , . . . , xk } is an SDR for {X0 , X1 , . . . , Xk }. Since arbitrarily large finite subfamilies of T have SDRs, the tree Y is infinite. Furthermore, the size of the kth level of the tree Y is at most |X0 | · |X1 | · · · |Xk |, where |Xi | denotes the size of Xi . Since these sets are all finite, each level is finite. By K¨onig’s Lemma, Y has an infinite path, and that path is an SDR for T . In the preceding proof we made no immediately obvious use of AC. Here is a question: Have we actually avoided the use of AC, or did we merely disguise it? The answer is that we have used some of the strength of AC in a disguised form. There are two very natural ways to restrict AC. Recall that AC considers a family of sets. We can either restrict the size of the sets or restrict the size of the family. If we require that each set is finite, we get the following statement. Axiom of choice for finite sets (ACF): If T is a family of finite, nonempty, mutually disjoint sets, then ∪T contains at least one subset having exactly one element in common with each element of T . If we specify that the family can be enumerated, we get the following statement. (We say that an infinite set is countable if it can be written in the form {x0 , x1 , x2 , . . . }.) Countable axiom of choice (CAC): If T = {X0 , X1 , X2 , . . . } is a family of nonempty, mutually disjoint sets, then ∪T contains at least one subset having exactly one element in common with each element of T . Combining both restrictions gives us CACF, the countable axiom of choice for finite sets. The statement of CACF looks like CAC with the added hypothesis that each Xi is finite. This weak version of AC is exactly what we used in proving Theorem 3.16. Theorem 3.17. ZF proves that the following are equivalent: 1. K¨onig’s Lemma. 2. Theorem 3.16. 3. CACF. Proof. The proof of Theorem 3.16 shows 1 implies 2. The proofs that 2 implies 3 and 3 implies 1 are Exercises 1 and 2.
3.4 The Return of der K¨onig
303
The relationships between our various versions of choice are very interesting. It is easy to see that ZF proves AC→CAC, AC→ACF, CAC→CACF, and ACF→CACF. It is not at all obvious, but can be shown, that not a single one of the converses of these implications is provable in ZF, and also that CACF is not a theorem of ZF. To prove that ZF cannot prove these statements we would assume that ZF is consistent and build special models where each particular statement fails. The models are obtained by lifting results from permutation models or by forcing. Jech’s book The Axiom of Choice [167] is an excellent reference. Since ZF proves that K¨onig’s Lemma is equivalent to CACF and CACF is not a theorem of ZF, we know that K¨onig’s Lemma is not a theorem of ZF. Of course, ZFC can prove K¨onig’s Lemma, so it is perfectly reasonable to think of it as a theorem of mathematics. Also, ZF can prove some restrictions of K¨onig’s Lemma, for example if all the labels in the tree are natural numbers. Many applications of K¨onig’s Lemma can be carried out with a restricted version. Our proof closely ties K¨onig’s Lemma to countable families of sets. As we will see in the next section, not all families are countable. We will see bigger sets where the lemma fails, and still bigger sets where it holds again. This is not the last return of K¨onig. (K¨onig means “king” in German.) In the introduction to this chapter we noted that if P is finite, then whenever H is a proper subset of P there is no matching between P and H. A set X is called Dedekind finite if no proper subset of X can be matched with X. Thus, the introduction shows that if X is finite, then X is Dedekind finite. Exercise 4 shows that CAC implies the converse. Thus, in ZFC, the finite sets are exactly the Dedekind finite sets. This characterization of the finite sets requires use of a statement that is weaker than CAC, but not provable in ZF [167]. Exercises 1. Prove in ZF that Theorem 3.16 implies CACF. (Hint: Use disjointness to show that the union of any k sets contains at least k elements.) 2. Challenging exercise. Prove K¨onig’s Lemma using ZF and CACF. To do this, let S be the set of nodes in the tree that have infinitely many successors. Find an enumeration for S. (It is easy to slip up and use full AC when finding the enumeration.) For each s ∈ S, let Xs be the set of immediate successors of s that have infinitely many successors. Apply CACF to the family {Xs | x ∈ S}. Use the selected vertices to construct a path through the tree. 3. Disjointification trick. Suppose that {Xn | n ∈ N} is a family of sets. For each n ∈ N let X n = {(n, x) | x ∈ Xn }. Show that {X n | n ∈ N} exists and is a disjoint family of sets. 4. Use CAC to prove that every infinite set has a countable subset. (Hint: Suppose that W is infinite. For each k ∈ N let Wk be the set of all subsets of W of size k. Apply CAC to a disjointified version of the family {Wk | k ∈ N}. Show that the union of the selected elements is a countable subset of W .)
304
3. Infinite Combinatorics and Graphs
5. Assume that every infinite set has a countable subset. Prove that if X cannot be matched with any proper subset of itself, then X is finite. (Hint: Suppose X is infinite and use a countable subset of X to find a matching between X and a proper subset of X.)
3.5 Ordinals, Cardinals, and Many Pigeons Whenever Gutei Osh¯o was asked about Zen, he simply raised his finger. Once a visitor asked Gutei’s boy attendant, “What does your master teach?” The boy too raised his finger. Hearing of this, Gutei cut off the boy’s finger with a knife. The boy, screaming with pain, began to run away. Gutei called to him, and when he turned around, Gutei raised his finger. The boy suddenly became enlightened. — Mumon Ekai, The Gateless Gate The previous section contains some references to infinite sets of different sizes. To make sense of this we need to know what it means for sets to be the same size. We can illustrate two approaches by considering some familiar sets. Thanks to the gentleness of my religious training, I have the same number of fingers on my left and right hands. This can be verified in two ways. I can count the fingers on my left hand, count the fingers on my right hand, and check that the results match. Note that in the process of counting, I am matching fingers with elements of a canonical ordered set, probably {1, 2, 3, 4, 5}. By emphasizing the matching process, I can verify the equinumerousness of my fingers without using any canonical set middleman. To do this, I match left thumb with right thumb, left forefinger with right forefinger, and so on. When my pinkies match, I know that I have the same number of fingers on my left and right hands. One advantage of this technique is that it works without modification for people with six or more fingers on each hand. For infinite sets, either method works well. We will start by comparing sets directly, then study some canonical ordered sets, and finish the section off with some applications to pigeons and trees.
3.5.1 Cardinality The big one! — Connie Conehead Suppose we write X Y if there is a one-to-one function from X into Y , and X ∼ Y if there is a one-to-one function from X onto Y . Thus X ∼ Y means that there is a matching between X and Y . If X Y and X Y , so X can be embedded into but not onto Y , we will write X ≺ Y . With this notation, we can describe relative sizes of some infinite sets.
3.5 Ordinals, Cardinals, and Many Pigeons
305
First consider the sets N = {0, 1, 2, . . . } and Z = {. . . , −2, −1, 0, 1, 2, . . . }. Define the function f : N → Z by 1 2n + 1 n+1 + . f (n) = (−1) 4 4 It is not hard to verify that if f (j) = f (k), then j = k, proving that f is a oneto-one function. Additionally, if m > 0, then f (2m − 1) = m, and if t ≤ 0, then f (−2t) = t, so f maps the odd natural numbers onto the positive integers and the even natural numbers onto the negative integers and 0. Thus, f witnesses that N ∼ Z, and we now know that N and Z are the same size. If X is a set satisfying N ∼ X, then we say that X is countable (or countably infinite if we are being very precise.) We just prove that Z is countable. Not every infinite set is countable, as shown by the following theorem of Cantor. Theorem 3.18 (Cantor’s Theorem). For any set X, X ≺ P(X). In particular, N ≺ P(N). Proof. Define f : X → P(X) by setting f (t) = {t} for each t ∈ X. Since f is one-to-one, it witnesses that X P(X). It remains to show that X P(X). Suppose g : X → P(X) is any one-to-one function. We will show that g is not onto. Let y = {t ∈ X | t ∈ / g(t)}. Suppose by way of contradiction that for some x ∈ X, g(x) = y. Because g(x) = y, x ∈ g(x) if and only if x ∈ y, and by the definition of y, x ∈ y if and only if x ∈ / g(x). Concatenating, we get x ∈ g(x) if and only if x ∈ / g(x), a clear contradiction. Thus y is not in the range of g, completing the proof. One consequence of Cantor’s Theorem is that any function from P(N) into N must not be one-to-one. More combinatorially stated, if we try to ram a pigeon for each element of P(N) into pigeonholes corresponding to the elements of N, some pigeonhole must contain at least two pigeons. Another consequence is that by sequentially applying Cantor’s Theorem to an infinite set, we get lots of infinite sets, including some very big ones. Corollary 3.19. There are infinitely many infinite sets of different sizes. Proof. N is infinite, and N ≺ P(N) ≺ P(P(N)) · · · by Cantor’s Theorem. Using only the definition of ∼ and chasing some functions, we can prove that ∼ is an equivalence relation. (See Exercise 2.) In particular, for any sets A, B, and C, we have • A ∼ A, • if A ∼ B then B ∼ A, and • if A ∼ B and B ∼ C, then A ∼ C.
306
3. Infinite Combinatorics and Graphs
These are handy shortcuts, and it would be nice to have analogous statements for the relation. We can easily show that A A and that if A B and B C, then A C. (See Exercise 3.) Symmetry does not hold for the relation, but we can prove that if A B and B A then A ∼ B. This last statement is the Cantor–Bernstein Theorem, an incredibly handy shortcut for showing that sets are the same size. After discussing the proof and history of the theorem, we will look at some nice applications. Theorem 3.20 (Cantor–Bernstein Theorem). If both X Y and Y X, then X ∼Y. Proof. Suppose f : A → B and g : B → A are one-to-one functions. We will sketch the construction of a function h : A → B that is one-to-one and onto. Define a set of subsets of A as follows. Let A0 = A, A1 = g(B), and An = g(f (An−2 )) for n ≥ 2. In particular, writing g ◦ f (A) for g(f (A)), we have A0 = A, A1 = g(B), A2 = g ◦ f (A), A3 = g ◦ f ◦ g(B), A4 = g ◦ f ◦ g ◦ f (A), and A5 = g ◦ f ◦ g ◦ f ◦ g(B). Note that An is defined with n function applications. It goes “back and forth” n times. Using induction as described in Exercise 4a, it is fairly easy to prove the following claim. Claim 1: For all n, An ⊃ An+1 . Given Claim 1, define the sets An = An − An+1 for each n. Also define the set Aω = ∩n∈N An . These sets form a partition of A into disjoint pieces, as claimed below. Hints for the proof of this claim appear in Exercise 4b. Claim 2: For every x ∈ A there is a unique n ∈ {ω, 0, 1, 2, . . . } such that x ∈ An . Define the function h : A → B by the following formula: f (x) if x ∈ ∪{Aω , A0 , A2 , . . . }, h(x) = −1 g (x) if x ∈ ∪{A1 , A3 , A5 , . . . }. By Claim 2, h(x) is well-defined and has all of A as its domain. It remains to show that h(x) is one-to-one and onto. This can be accomplished by defining B0 = B, and Bn+1 = f (An ) for each n ≥ 0. Imitating our work with the An , in Exercise 4c we prove the following.
3.5 Ordinals, Cardinals, and Many Pigeons
307
Claim 3: For all n, Bn ⊇ Bn+1 . Furthermore, if we define the prime sets Bn = Bn − Bn+1 and B ω = ∩n∈N Bn , then for every y ∈ B, there is a unique n ∈ {ω, 0, 1, 2, . . . } such that y ∈ Bn . The partitions of A and B are closely related. In particular, Exercise 4d gives hints for proving the following claim. Claim 4: For each n ∈ N, h(A2n ) = B2n+1 and h(A2n+1 ) = B2n . Also, h(Aω ) = Bω .
Since h matches the A pieces with the B pieces and is one-to-one and onto on these pieces, h is the desired one-to-one and onto function. One indication of the importance of the Cantor–Bernstein Theorem is the number of mathematicians who have produced proofs of it. The following is a partial listing. According to Levy [187], Dedekind proved the theorem in 1887. Writing in 1895, Cantor [47] described the theorem as an easy consequence of a version of the axiom of choice. In the endnotes of [49], Jourdain refers to an 1896 proof by Schr¨oder. Some texts, [209] for example, refer to the theorem as the Schr¨oder– Bernstein Theorem. Bernstein proved the theorem without using the axiom of choice in 1898; this proof appears in Borel’s book [32]. Additional later proofs were published by Peano [220], J. K¨onig [181], and Zermelo [292]. It is good to remember that the axioms for set theory were in flux during this period. These mathematicians were making sure that this very applicable theorem was supported by the axioms du jour. Now we will examine a pair of applications of the Cantor–Bernstein Theorem. Note that we are freed of the tedium of constructing onto maps. Corollary 3.21. N ∼ Z. Proof. Define f : N → Z by f (n) = n. Note that f is one-to-one, so N Z. Define g : Z → N by 2z if z ≥ 0, g(z) = 2|z| + 1 if z < 0. Note that g is one-to-one, so Z N. Applying the Cantor–Bernstein Theorem, N ∼ Z. Corollary 3.22. N ∼ N × N. Proof. The function f : N → N × N defined by f (n) = (0, n) is one-to-one, so N N×N. The function g : N×N → N defined by g(m, n) = 2m+1 ·3n+1 is also one-to-one, so N × N N. By the Cantor–Bernstein Theorem, N ∼ N × N. Corollary 3.23. P(N) ∼ R. Consequently, R is uncountable.
308
3. Infinite Combinatorics and Graphs
Proof. First prove that P(N) R. Define f : P(N) → R by setting we will−n f (X) = for each X ∈ P(N). As an example of how this map n∈X 10 works, if X consists of the odd natural numbers, then f (X) = 0.1010. If X and Y are distinct subsets of N, then they differ at some least natural number n, and f (X) and f (Y ) will differ in the nth decimal place. Thus, f is one-to-one, and so P(N) R. Now we must construct a one-to-one function g : R → P(N). Let r be a real number. If we avoid decimal expansions that terminate in an infinite sequence of 9’s, we can assume that r has a unique decimal expansion of the form ⎛ ⎞
(−1) ⎝ ki 10i + dj 10−j ⎠ , i∈X1
j∈X2
where ∈ {0, 1}, each ki and dj is between 1 and 9, X1 is a set of natural numbers, and X (−1) 2 is a set of nonzero natural numbers. In this representation, is the sign of r, i∈X1 ki 10i is the integer portion of r, and j∈X2 dj 10−j is the fractional portion of r. Define the function g by setting g(r) = {} ∪ {102i+1 + ki | i ∈ X1 } ∪ {102j + dj | j ∈ X2 } for each r ∈ R. As a concrete example of the behavior of this map, consider g(−12.305) = {1, 1001, 12, 103, 1000005}. Since different reals differ in some decimal place, g is one-to-one. By the Cantor–Bernstein Theorem, P(N) ∼ R. By Theorem 3.18, N ≺ P(N). Together with P(N) ∼ R, this implies that N ≺ R, so R is uncountable. Note that we did not construct a one-to-one function from P(N) onto R. The Cantor–Bernstein Theorem tells us that such a function must exist, so we are not obligated to construct it. (If you are not already convinced that existence theorems are tremendously convenient, try doing a direct construction for the preceding corollary. This is intentionally not listed in the exercises.)
3.5.2 Ordinals and Cardinals The aleph was heavy, like trying to carry a small engine block. — William Gibson, Mona Lisa Overdrive For Gibson, an aleph is a huge biochip of virtually infinite storage capacity. For a linguist, aleph is ℵ, the first letter of the Hebrew alphabet. For a set theorist, an aleph is a cardinal number. Saying that there are ℵ0 natural numbers is like saying that there are five fingers on my right hand. Alephs are special sorts of ordinals, and ordinals are special sorts of well-ordered sets. Suppose that X is set and ≤ is an ordering relation on X. We write x < y when x ≤ y and x = y. The relation ≤ is a linear ordering on X if the following properties hold for all x, y, and z in X.
3.5 Ordinals, Cardinals, and Many Pigeons
309
Antisymmetry: (x ≤ y ∧ y ≤ x) → x = y. Transitivity: x ≤ y → (y ≤ z → x ≤ z). Trichotomy: x < y ∨ x = y ∨ y < x. Familiar examples of linear orderings include N, Z, Q, and R with the typical orderings. We say that a linear ordering is a well-ordering if every nonempty subset has a least element. Since every subset of N has a least element, N is a well-ordering (using the usual ordering). Since the open interval (0, 1) has no least element, the usual ordering does not well-order R. An analyst would say that 0 is the greatest lower bound of (0, 1), but 0 is not the least element of (0, 1) because 0 ∈ / (0, 1). The following theorem gives a handy characterization of wellordered sets. Theorem 3.24. Suppose X with ≤ is a linearly ordered set. X is well-ordered if and only if X contains no infinite descending sequences. Proof. We will prove the contrapositive version, that is, X is not well-ordered if and only if X contains an infinite descending sequence. First suppose X is not well-ordered. Then X has a nonempty subset Y with no least element. Pick an element x0 in Y . Since x0 is not the least element of Y , there is an element x1 in Y such that x0 > x1 . Continuing in this fashion, we obtain x0 > x1 > x2 > · · · , an infinite descending sequence. To prove the converse, suppose X contains x0 > x1 > x2 > · · · , an infinite descending sequence. Then the set Y = {xi | i ∈ N} is a nonempty subset of X with no least element. Thus, X is not well-ordered. For any set X, the ∈ relation defines an ordering on X. To see this, for each x, y ∈ X, let x ≤∈ y if x ∈ y or x = y. In general, this is not a particularly pretty ordering. For example, if a = b then the set X = {a, b, {a, b}} is not linearly ordered by the ≤∈ relation. On the other hand, Y = {a, {a, b}, {a, {a, b}}} is well-ordered by the ≤∈ relation. In a moment, we will use this property as part of the definition of an ordinal number. A set X is transitive if for all y ∈ X, if x ∈ y then x ∈ X. A transitive set that is well-ordered by ≤∈ is called an ordinal. The ordinals have some interesting properties. Theorem 3.25. Suppose X is a set of ordinals and α and β are ordinals. Then the following hold: 1. ∪X is an ordinal. 2. α ∪ {α} is an ordinal. 3. α ∈ β or α = β or β ∈ α. Proof. See Exercises 10, 13, 14, 15, and 16.
310
3. Infinite Combinatorics and Graphs
The first two properties in the preceding theorem give good ways to build new ordinals from old ones. For example, a little vacuous reasoning shows that ∅ is an ordinal. By the theorem, the sets ∅ ∪ {∅} = {∅}, {∅} ∪ {{∅}} = {∅, {∅}}, and {∅, {∅}} ∪ {{∅, {∅}}} = {∅, {∅}, {∅, {∅}}} are all ordinals. Set theorists have special names for these finite ordinals. They write ∅ = 0, {∅} = {0} = 1, {∅, {∅}} = {0, 1} = 2, {∅, {∅}, {∅, {∅}}} = {0, 1, 2} = 3, and so on for all k ∈ N. Since each k is a set, we can define ω by ω = ∪k∈N k, and use the first property in the theorem to see that ω is an ordinal. We do not have to stop here. Since ω is an ordinal, so is ω ∪ {ω} = {ω, 0, 1, 2, . . . }, and we start all over. Sometimes, texts write α + 1 for the ordinal α ∪ {α} and call ordinals like 1, 2, 3, and ω + 1 successor ordinals. Ordinals that are not successors are called limit ordinals. The set ω is a good example of a limit ordinal. Traditionally, greek letters are used to denote ordinals. Also, we usually write α ≤ β rather than α ≤∈ β. Consequently, for ordinals the formula α < β means the same thing as α ∈ β. Because ordinals are transitive, α ∈ β implies α ⊂ β, although the converse is not always true. There are three ways to think about ordinals and well-orderings. First, every ordinal is a well-ordered set under the ≤ relation. Second, the class of all ordinals is well-ordered by the ≤ relation. Third, every well-ordered set looks just like an ordinal. The next theorem is a precise expression of the way that ordinals act as canonical well-orderings. Theorem 3.26. Every nonempty well-ordered set is order isomorphic to an ordinal. That is, if X is well-ordered by ≤, then there is an ordinal α and a function h : X → α such that h is one-to-one and onto, and for all x and y in X, x ≤ y implies h(x) ≤ h(y). Proof. Let X be a well-ordered set. For each x ∈ X, define the initial segment for x by Ix = {t ∈ X | t ≤ x}. Let W be the subset of X consisting of all elements x such that Ix is order isomorphic to an ordinal. Note that for each x ∈ W , Ix is order isomorphic to a unique ordinal. By the replacement axiom, we can construct a set A of all the ordinals isomorphic to initial segments of X. Let α = ∪A; by Theorem 3.25, α is an ordinal. If x, y ∈ W , x ≤ y, γ and δ are ordinals, and hx and hy are order isomorphisms such that hx : Ix → γ and hy : Iy → δ, then for all t < x, hy (t) = hx (t). Using the replacement axiom, we can form the set of all the order isomorphisms corresponding to the initial segments, and concatenate them to build a new function h. This new function is an order isomorphism from W onto α. To complete the proof, we claim that W = X. Suppose not; since X is well-ordered, we can find a least t in X such that t ∈ / W . If we extend h by setting h(t) = α, then h witnesses that It is order isomorphic to α + 1. Thus t ∈ W , yielding a contradiction and completing the proof.
3.5 Ordinals, Cardinals, and Many Pigeons
311
The next theorem shows that using AC we can well-order any set, widening the applicability of the preceding theorem. Our proof of the “well-ordering principle” uses ideas from Zermelo’s [291] original proof. The proof can also be viewed as a special case of Zorn’s Lemma. See Exercise 18 for more about Zorn’s Lemma. Theorem 3.27. Every set can be well-ordered. Proof. Let X be a set. We will construct a one-to-one map h : α → X from an ordinal α onto X. This suffices to prove the theorem, since the elements of α are well-ordered and h matches elements of α with elements of X. By AC we can pick x ∈ X − t for each nonempty t ⊂ X. There are two things to note here. First, xt is never an element of t. This is important later in the proof. Second, this is the only use of AC in this entire proof. This is handy for the exercises. Suppose that f : α → Y is a one-to-one map of an ordinal α onto a set Y ⊂ X. For each β < α, let f [β] denote {f (δ) | δ ∈ β}. (Remember, since β and α are ordinals, β < α is the same thing as β ∈ α.) We say that f is a γ-function if f (β) = xf [β] for every β ∈ α. Let Γ be the set of all γ-functions. The γ-functions cohere nicely; if f and g are γ-functions and β is in both of their domains, then f (β) = g(β). (See Exercise 17.) If we view the functions in Γ as sets of ordered pairs, ∪Γ is also a set of ordered pairs. Since the functions cohere and are one-toone, ∪Γ is actually a one-to-one function; call it h. By Theorem 3.25, the union of the ordinals that are domains of the functions in Γ is also an ordinal, so for some ordinal α, h : α → X. Furthermore, h is a γ-function. It gets better. Suppose that h does not map α onto X, so h[α] X. Then we can define an extension h by setting h (β) = h(β) for β < α and h (α) = xh[α] . This extension h is also a γ-function, so h ∈ Γ. Applying the definition of h, we find that h (α) is in the range of h. But h (α) = xh[α] and the range of h is h[α], so we have xh[α] ∈ h[α], contradicting the statement two paragraphs back. Summarizing, h is a one-to-one map of α onto X, so X is well-ordered. Combining the last two theorems yields the following corollary. Corollary 3.28. For every X there is a unique least ordinal α such that X ∼ α. Proof. Fix X. By Theorem 3.27, X can be well-ordered. By Theorem 3.26, X ∼ β for some ordinal β. Let A = {γ ≤ β | γ ∼ X} be the set of ordinals less than or equal to β that are equinumerous with X. Since A is a nonempty set of ordinals well-ordered by ≤, A contains a least element, α. Let δ be any ordinal such that X ∼ δ. By Theorem 3.25, δ < α or α ≤ δ. If δ < α, then δ ≤ β and we have δ ∈ A, contradicting the minimality of α. Thus α ≤ δ, and α is unique. Since every set has a unique least equinumerous ordinal, we can define |X| as the least ordinal α such that X ∼ α. We say that an ordinal κ is a cardinal number if |κ| = κ. In slogan form, a cardinal number is the least ordinal of its cardinality. The finite pigeonhole principle asserts that every finite ordinal is a cardinal. Thus, 0, 1, and 17324 are all cardinals. The infinite pigeonhole principle shows that ω
312
3. Infinite Combinatorics and Graphs
cannot be mapped one-to-one into any finite cardinal, so ω is a cardinal number; indeed, it is the least infinite cardinal. On the other hand, ω+1 ∼ ω and ω+2 ∼ ω, so ω+1 and ω+2 are not cardinals. The elements of the next larger cardinal cannot be matched with the elements of ω, so the next larger cardinal is uncountable. Even though every cardinal number is an ordinal, we have special notation to distinguish the cardinals. When we are thinking of ω as a cardinal, we denote it with an aleph, so ω = ℵ0 . The next larger (and consequently uncountable) cardinal is ℵ1 . Proceeding in this way, and using unions at limit ordinals, we can define ℵα for every ordinal number α. For example, the least cardinal bigger than ℵ0 , ℵ1 , ℵ2 , . . . is ℵω . Assuming AC, for every infinite set X, there is an ordinal α such that |X| = ℵα . The ordinals are like a long string of beads. The infinite cardinals, which are the alephs, appear like infrequent pearls along the string. The ordinals are good for counting steps in order (like rosary beads), and the cardinals are ideal for summing up sizes (like abacus beads). For finite sets, cardinals and ordinals are identical. Thus |{A, B, C, D}| = 4 = {0, 1, 2, 3} and {A, B, C, D} ∼ {0, 1, 2, 3}. In general, the matching approach to measuring the sizes of sets agrees with the cardinality approach. This is formalized in the following theorem. Theorem 3.29. For all sets X and Y , |X| = |Y | if and only if X ∼ Y . Proof. Suppose |X| = |Y | = κ. Then X ∼ κ and Y ∼ κ, so X ∼ Y . Conversely, suppose X ∼ Y , and let κ1 = |X| and κ2 = |Y |. Since κ1 ∼ X ∼ Y ∼ κ2 , we have κ1 ∼ κ2 . Since κ1 and κ2 are cardinals, κ1 ∼ κ2 implies κ1 = κ2 . Thus |X| = |Y |.
3.5.3 Pigeons Finished Off Every Sunday you’ll see My sweetheart and me, As we poison the pigeons in the park. — Tom Lehrer At this point, we know quite a bit about stuffing pigeons into pigeonholes. For example, if p and h are both finite cardinal numbers, we have the following finite pigeonhole principle. • If we put p pigeons into h pigeonholes and h < p, then some pigeonhole contains at least two pigeons. The idea here is that any function from the set of larger cardinality into the set of smaller cardinality must fail to be one-to-one. By the Cantor–Bernstein Theorem, this holds for infinite cardinals as well. Thus for any cardinals κ and λ, we get the following analogue of the finite pigeonhole principle. • If we put κ pigeons into λ pigeonholes and λ < κ, then some pigeonhole contains at least two pigeons.
3.5 Ordinals, Cardinals, and Many Pigeons
313
The preceding infinite analogue of the finite pigeonhole principle is not the same as the infinite pigeonhole principle of Theorem 3.1. Here is a restatement of Theorem 3.1 using our notation for cardinals. • If we put ℵ0 pigeons into h pigeonholes and h < ℵ0 , then some pigeonhole contains ℵ0 pigeons. The infinite pigeonhole principle says that some pigeonhole is infinitely crowded. This does not transfer directly to higher cardinalities. For example, we can put ℵω pigeons into ℵ0 pigeonholes is such a way that every pigeonhole has fewer than ℵω pigeons in it. To do this, put ℵ0 pigeons in the 0th hole, ℵ1 pigeons in the 1st hole, ℵ2 pigeons in the 2nd hole, and so on. The total number of pigeons is ℵω = ∪n∈ω ℵn , but each hole contains ℵn pigeons for some n < ω. This peculiar behavior stems from the singular nature of ℵω . A cardinal κ is called singular if there is a cardinal λ < κ and a function f : λ → κ such that ∪α