0% found this document useful (0 votes)
58 views

10.12 References: Class Problems

Uploaded by

tripathiaryashi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

10.12 References: Class Problems

Uploaded by

tripathiaryashi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

“mcs” — 2018/6/6 — 13:43 — page 449 — #457 “mcs” — 2018/6/6 — 13:43 — page 450 — #458

10.12. References 449 450 Chapter 10 Directed graphs & Partial Orders

equality holds iff x is on a shortest path from u to v.


10.12 References (a) Prove the “iff” statement from left to right.

[9], [15], [24], [27], [29] (b) Prove the “iff” from right to left.

Class Problems
Problem 10.4. (a) Give an example of a digraph that has a closed walk including
Problems for Section 10.1 two vertices but has no cycle including those vertices.

Practice Problems (b) Prove Lemma 10.2.6:


Problem 10.1. Lemma. The shortest positive length closed walk through a vertex is a cycle.
Let S be a nonempty set of size n 2 ZC , and let f W S ! S be total function. Let
Df be the digraph with vertices S whose edges are fhs ! f .s/i j s 2 S g.
Problem 10.5.
(a) What are the possible values of the out-degrees of vertices of Df ?
A 3-bit string is a string made up of 3 characters, each a 0 or a 1. Suppose you’d
(b) What are the possible values of the in-degrees of the vertices? like to write out, in one string, all eight of the 3-bit strings in any convenient order.
For example, if you wrote out the 3-bit strings in the usual order starting with 000
(c) Suppose f is a surjection. Now what are the possible values of the in-degrees 001 010. . . , you could concatenate them together to get a length 3  8 D 24 string
of the vertices? that started 000001010. . . .
But you can get a shorter string containing all eight 3-bit strings by starting with
Exam Problems 00010. . . . Now 000 is present as bits 1 through 3, and 001 is present as bits 2
Problem 10.2. through 4, and 010 is present as bits 3 through 5, . . . .
The proof of the Handshaking Lemma 10.1.2 invoked the “obvious” fact that in any (a) Say a string is 3-good if it contains every 3-bit string as 3 consecutive bits
finite digraph, the sum of the in-degrees of the vertices equals the number of arrows somewhere in it. Find a 3-good string of length 10, and explain why this is the
in the graph. That is, minimum length for any string that is 3-good.
Claim. For any finite digraph G (b) Explain how any walk that includes every edge in the graph shown in Fig-
X
indeg.v/ D j graph.G/j; (10.10) ure 10.10 determines a string that is 3-good. Find the walk in this graph that deter-
v2V .G/ mines your 3-good string from part (a).
But this Claim might not be obvious to everyone. So prove it by induction on the (c) Explain why a walk in the graph of Figure 10.10 that includes every every
number j graph.G/j of arrows. edge exactly once provides a minimum-length 3-good string.12

(d) Generalize the 2-bit graph to a k-bit digraph Bk for k  2, where V .Bk / WWD
f0; 1gk , and any walk through Bk that contains every edge exactly once determines
Problems for Section 10.2 a minimum length .k C 1/-good bit-string.13
12 The 3-good strings explained here generalize to n-good strings for n  3. They were studied by
Practice Problems the great Dutch mathematician/logician Nicolaas de Bruijn, and are known as de Bruijn sequences.
Problem 10.3. de Bruijn died in February, 2012 at the age of 94.
13 Problem 10.7 explains why such “Eulerian” paths exist.
Lemma 10.2.5 states that dist .u; v/  dist .u; x/ C dist .x; v/. It also states that
“mcs” — 2018/6/6 — 13:43 — page 451 — #459 “mcs” — 2018/6/6 — 13:43 — page 452 — #460

10.12. References 451 452 Chapter 10 Directed graphs & Partial Orders

+1 Such walks are named after the famous 17th century mathematician Leonhard Eu-
ler. (Same Euler as for the constant e  2:718 and the totient function —he did a
10 +0
lot of stuff.)
11 So how do you tell in general whether a graph has an Euler tour? At first glance
this may seem like a daunting problem (the similar sounding problem of finding
+1 a cycle that touches every vertex exactly once is one of those million dollar NP-
complete problems known as the Hamiltonian Cycle Problem)—but it turns out to
+0 be easy.
+1
(a) Show that if a graph has an Euler tour, then the in-degree of each vertex equals
+0 its out-degree.
A digraph is weakly connected if there is a “path” between any two vertices that
00 may follow edges backwards or forwards.15 In the remaining parts, we’ll work out
the converse. Suppose a graph is weakly connected, and the in-degree of every
01 vertex equals its out-degree. We will show that the graph has an Euler tour.
A trail is a walk in which each edge occurs at most once.
+0 +1
(b) Suppose that a trail in a weakly connected graph does not include every edge.
Figure 10.10 The 2-bit graph. Explain why there must be an edge not on the trail that starts or ends at a vertex on
the trail.
In the remaining parts, assume the graph is weakly connected, and the in-degree
What is this minimum length?
of every vertex equals its out-degree. Let w be the longest trail in the graph.
Define the transitions of Bk . Verify that the in-degree of each vertex is the same as
(c) Show that if w is closed, then it must be an Euler tour.
its out-degree and that there is a positive length path from any vertex to any other
vertex (including itself) of length at most k. Hint: part (b)

(d) Explain why all the edges starting at the end of w must be on w.
Homework Problems
(e) Show that if w was not closed, then the in-degree of the end would be bigger
Problem 10.6. (a) Give an example of a digraph in which a vertex v is on a positive
than its out-degree.
even-length closed walk, but no vertex is on an even-length cycle.
Hint: part (d)
(b) Give an example of a digraph in which a vertex v is on an odd-length closed
walk but not on an odd-length cycle. (f) Conclude that if the in-degree of every vertex equals its out-degree in a finite,
weakly connected digraph, then the digraph has an Euler tour.
(c) Prove that every odd-length closed walk contains a vertex that is on an odd- 15 More precisely, a graph G is weakly connected iff there is a path from any vertex to any other
length cycle. vertex in the graph H with

V .H / D V .G/; and
E.H / D E.G/ [ fhv ! ui j hu ! vi 2 E.G/g:
Problem 10.7.
An Euler tour14 of a graph is a closed walk that includes every edge exactly once. In other words H D G [ G 1.

14 In some other texts, this is called an Euler circuit.


“mcs” — 2018/6/6 — 13:43 — page 453 — #461 “mcs” — 2018/6/6 — 13:43 — page 454 — #462

10.12. References 453 454 Chapter 10 Directed graphs & Partial Orders

(a) S ı R.
Problems for Section 10.3 (b) S ı S .
Homework Problems (c) S 1 ı R.
Problem 10.8.
The weight of a walk in a weighted graph is the sum of the weights of the successive
edges in the walk. The minimum weight matrix for length k walks in an n-vertex Problem 10.10.
graph G is the n  n matrix W such that for u; v 2 V .G/, In a round-robin tournament, every two distinct players play against each other
( just once. For a round-robin tournament with no tied games, a record of who beat
w if w is the minimum weight among length k walks from u to v; whom can be described with a tournament digraph, where the vertices correspond
Wuv WWD
1 if there is no length k walk from u to v: to players and there is an edge hx ! yi iff x beat y in their game.
A ranking is a path that includes all the players. So in a ranking, each player won
The min+ product of two n  n matrices W and M with entries in R [ f1g is the the game against the next lowest ranked player, but may very well have lost their
n  n matrix W  M whose ij entry is games against much lower ranked players—whoever does the ranking may have a
min+
lot of room to play favorites.
.W  V /ij WWD minfWik C Vkj j 1  k  ng : (a) Give an example of a tournament digraph with more than one ranking.
min+

Prove the following theorem. (b) Prove that if a tournament digraph is a DAG, then it has at most one ranking.

Theorem. If W is the minimum weight matrix for length k walks in a weighted (c) Prove that every finite tournament digraph has a ranking.
graph G, and V is the minimum weight matrix for length m walks, then W  V is
min+
the minimum weight matrix for length k C m walks. Homework Problems
Problem 10.11.
Let R be a binary relation on a set A. Regarding R as a digraph, let W .n/ denote
the length-n walk relation in the digraph R, that is,
Problems for Section 10.4
a W .n/ b WWD there is a length n walk from a to b in R:
Practice Problems
Problem 10.9. (a) Prove that
Let W .n/ ı W .m/ D W .mCn/ (10.11)
for all m; n 2 N, where ı denotes relational composition.
A WWD f1; 2; 3g
B WWD f4; 5; 6g (b) Let Rn be the composition of R with itself n times for n  0. So R0 WWD IdA ,
R WWD f.1; 4/; .1; 5/; .2; 5/; .3; 6/g and RnC1 WWD R ı Rn .
S WWD f.4; 5/; .4; 6/; .5; 4/g: Conclude that
Rn D W .n/ (10.12)
for all n 2 N.
Note that R is a relation from A to B and S is a relation from B to B.
List the pairs in each of the relations below.
“mcs” — 2018/6/6 — 13:43 — page 455 — #463 “mcs” — 2018/6/6 — 13:43 — page 456 — #464

10.12. References 455 456 Chapter 10 Directed graphs & Partial Orders

(c) Conclude that in Figure 10.11, three of the four chickens are kings. Chicken c is not a king in
jAj
[ this example since it does not peck chicken b and it does not peck any chicken that
C i
R D R pecks chicken b. Chicken a is a king since it pecks chicken d , who in turn pecks
i D1 chickens b and c.
where RC is the positive length walk relation determined by R on the set A. In general, a tournament digraph is a digraph with exactly one edge between
each pair of distinct vertices.

a b
Problem 10.12. king king
We can represent a relation S between two sets A D fa1 ; : : : ; an g and B D
fb1 ; : : : ; bm g as an n  m matrix MS of zeroes and ones, with the elements of
MS defined by the rule

MS .i; j / D 1 ai S bj :
IFF
king not a king
d c
If we represent relations as matrices this way, then we can compute the com-
position of two relations R and S by a “boolean” matrix multiplication ˝ of their Figure 10.11 A 4-chicken tournament in which chickens a, b and d are kings.
matrices. Boolean matrix multiplication is the same as matrix multiplication except .
that addition is replaced by OR, multiplication is replaced by AND, and 0 and 1 are
used as the Boolean values False and True. Namely, suppose R W B ! C is a bi- (a) Define a 10-chicken tournament graph with a king chicken that has outdegree
nary relation with C D fc1 ; : : : ; cp g. So MR is an m  p matrix. Then MS ˝ MR 1.
is an n  p matrix defined by the rule:
(b) Describe a 5-chicken tournament graph in which every player is a king.
ŒMS ˝ MR .i; j / WWD ORm
kD1 ŒMS .i; k/ AND MR .k; j /: (10.13)
(c) Prove
Prove that the matrix representation MRıS of R ı S equals MS ˝ MR (note the Theorem (King Chicken Theorem). Any chicken with maximum out-degree in a
reversal of R and S). tournament is a king.
The King Chicken Theorem means that if the player with the most victories is
defeated by another player x, then at least he/she defeats some third player that
Problem 10.13. defeats x. In this sense, the player with the most victories has some sort of bragging
Chickens are rather aggressive birds that tend to establish dominance over other rights over every other player. Unfortunately, as Figure 10.11 illustrates, there can
chickens by pecking them—hence the term “pecking order.” So for any two chick- be many other players with such bragging rights, even some with fewer victories.
ens in a farmyard, either the first pecks the second, or the second pecks the first, but
not both. We say that chicken u virtually pecks chicken v if either:

 Chicken u pecks chicken v, or Problems for Section 10.5


 Chicken u pecks some other chicken w who in turn pecks chicken v.
Practice Problems
A chicken that virtually pecks every other chicken is called a king chicken. Problem 10.14.
We can model this situation with a chicken digraph whose vertices are chickens, What is the size of the longest chain that is guaranteed to exist in any partially
with an edge from chicken u to chicken v precisely when u pecks v. In the graph ordered set of n elements? What about the largest antichain?
“mcs” — 2018/6/6 — 13:43 — page 457 — #465 “mcs” — 2018/6/6 — 13:43 — page 458 — #466

10.12. References 457 458 Chapter 10 Directed graphs & Partial Orders

Problem 10.15. Problem 10.18.


Let fA; :::; H g be a set of tasks that we must complete. The following DAG de- The following DAG describes the prerequisites among tasks f1; : : : ; 9g.
scribes which tasks must be done before others, where there is an arrow from S to
T iff S must be done before T .
9

3 5 7

2 4 6

(a) If each task takes one hour to complete, what is the minimum parallel time to
complete all the tasks? Briefly explain.

(b) What is the minimum parallel time if no more than two tasks can be completed
in parallel? Briefly explain.
(a) Write the longest chain.

(b) Write the longest antichain. Problem 10.19.


(c) If we allow parallel scheduling, and each task takes 1 minute to complete, The following DAG describes the prerequisites among tasks f1; : : : ; 9g.
what is the minimum amount of time needed to complete all tasks? (a) If each task takes unit time to complete, what is the minimum time to complete
all the tasks? Briefly explain.

(b) What is the minimum time if no more than two tasks can be completed in
Problem 10.16.
parallel? Briefly explain.
Describe a sequence consisting of the integers from 1 to 10,000 in some order so
that there is no increasing or decreasing subsequence of size 101.
Problem 10.20.
Answer the following questions about the dependency DAG shown in Figure 10.12.
Problem 10.17.
Assume each node is a task that takes 1 second.
Suppose the vertices of a DAG represent tasks taking unit time to complete, and
the edges indicate prerequisites among the tasks. Assume there is no bound on how (a) What is the largest chain in this DAG? If there is more than one, only give one.
many tasks may be performed in parallel.
(b) What is the largest antichain? (Again, give only one if you find there are more
What is the smallest number of vertices (tasks) possible in a DAG for which there
than one). Prove there isn’t a larger antichain.
is more than one minimum time schedule? Carefully justify your answer.
(c) How much time would be required to complete all the tasks with a single
processor?
“mcs” — 2018/6/6 — 13:43 — page 459 — #467 “mcs” — 2018/6/6 — 13:43 — page 460 — #468

10.12. References 459 460 Chapter 10 Directed graphs & Partial Orders

8 9

1 2 3 4 5 6 7

3 5 7

2 4 6 8 9 10 11 12 13 14

Figure 10.12 Task DAG


(d) How much time would be required to complete all the tasks if there are unlim-
ited processors available.
strategy, you should take as many subjects as possible each term. Exhibit your
(e) What is the smallest number of processors that would still allow completion complete class schedule each term using a greedy strategy.
of all the tasks in optimal time? Show a schedule proving it.
(b) In the second term of the greedy schedule, you took five subjects including
Class Problems 18.03. Identify a set of five subjects not including 18.03 such that it would be
possible to take them in any one term (using some nongreedy schedule). Can you
Problem 10.21. figure out how many such sets there are?
The table below lists some prerequisite information for some subjects in the MIT
Computer Science program (in 2006). This defines an indirect prerequisite relation (c) Exhibit a schedule for taking all the courses—but only one per term.
that is a DAG with these subjects as vertices.
(d) Suppose that you want to take all of the subjects, but can handle only two per
18:01 ! 6:042 18:01 ! 18:02 term. Exactly how many terms are required to graduate? Explain why.
18:01 ! 18:03 6:046 ! 6:840
(e) What if you could take three subjects per term?
8:01 ! 8:02 6:001 ! 6:034
6:042 ! 6:046 18:03; 8:02 ! 6:002
6:001; 6:002 ! 6:003 6:001; 6:002 ! 6:004 Problem 10.22.
6:004 ! 6:033 6:033 ! 6:857 A pair of Math for Computer Science Teaching Assistants, Lisa and Annie, have
decided to devote some of their spare time this term to establishing dominion over
(a) Explain why exactly six terms are required to finish all these subjects, if you the entire galaxy. Recognizing this as an ambitious project, they worked out the
can take as many subjects as you want per term. Using a greedy subject selection following table of tasks on the back of Annie’s copy of the lecture notes.
“mcs” — 2018/6/6 — 13:43 — page 461 — #469 “mcs” — 2018/6/6 — 13:43 — page 462 — #470

10.12. References 461 462 Chapter 10 Directed graphs & Partial Orders

1. Devise a logo and cool imperial theme music - 8 days. devise logo build fleet
u8 u 18
2. Build a fleet of Hyperwarp Stardestroyers out of eating paraphernalia swiped A E
 E
from Lobdell - 18 days. 
A
A  E
 A  E
3. Seize control of the United Nations - 9 days, after task #1. seize control u9 A uget  E
shots
 11
B  E
4. Get shots for Lisa’s cat, Tailspin - 11 days, after task #1. B  E
  E
B
5. Open a Starbucks chain for the army to get their caffeine - 10 days, after B
  E
task #3. open chain u B 
  E
10 QQ B 
 E
E 
6. Train an army of elite interstellar warriors by dragging people to see The Q
Q B   E
Q B 
Phantom Menace dozens of times - 4 days, after tasks #3, #4, and #5. QQBB u 4  E
train army P QPP  E
7. Launch the fleet of Stardestroyers, crush all sentient alien species, and es- Q PP
Q PP 
 E
tablish a Galactic Empire - 6 days, after tasks #2 and #6. Q
Q
PP
 PP
E
E
6Qu
Q  PP Pu EE defeat
8. Defeat Microsoft - 8 days, after tasks #2 and #6. Microsoft
launch fleet 8
We picture this information in Figure 10.13 below by drawing a point for each
task, and labelling it with the name and weight of the task. An edge between
two points indicates that the task for the higher point must be completed before Figure 10.13 Graph representing the task precedence constraints.
beginning the task for the lower one.
(a) Give some valid order in which the tasks might be completed. (d) What is the minimum number of days that Lisa and Annie need to conquer the
Lisa and Annie want to complete all these tasks in the shortest possible time. galaxy? No proof is required.
However, they have agreed on some constraining work rules.
 Only one person can be assigned to a particular task; they cannot work to-
gether on a single task. Problem 10.23.
Answer the following questions about the powerset pow.f1; 2; 3; 4g/ partially or-
 Once a person is assigned to a task, that person must work exclusively on dered by the strict subset relation .
the assignment until it is completed. So, for example, Lisa cannot work on (a) Give an example of a maximum length chain.
building a fleet for a few days, run to get shots for Tailspin, and then return
to building the fleet. (b) Give an example of an antchain of size 6.
(b) Lisa and Annie want to know how long conquering the galaxy will take. Annie (c) Describe an example of a topological sort of pow.f1; 2; 3; 4g/.
suggests dividing the total number of days of work by the number of workers, which
is two. What lower bound on the time to conquer the galaxy does this give, and why (d) Suppose the partial order describes scheduling constraints on 16 tasks. That
might the actual time required be greater? is, if
A  B  f1; 2; 3; 4g;
(c) Lisa proposes a different method for determining the duration of their project.
then A has to be completed before B starts.16 What is the minimum number of
She suggests looking at the duration of the critical path, the most time-consuming
processors needed to complete all the tasks in minimum parallel time?
sequence of tasks such that each depends on the one before. What lower bound
does this give, and why might it also be too low? 16 As usual, we assume each task requires one time unit to complete.
“mcs” — 2018/6/6 — 13:43 — page 463 — #471 “mcs” — 2018/6/6 — 13:43 — page 464 — #472

10.12. References 463 464 Chapter 10 Directed graphs & Partial Orders

Prove it. (e) Prove that if G is finite, then the procedure terminates.

(e) What is the length of a minimum time 3-processor schedule? Hint: Let s be the number of cycles, e be the number of edges, and p be the number
of pairs of vertices with a directed path (in either direction) between them. Note
Prove it. that p  n2 where n is the number of vertices of G. Find coefficients a; b; c such
that as C bp C e C c is nonnegative integer valued and decreases at each transition.
Homework Problems
Problem 10.24.
The following operations can be applied to any digraph, G: Problem 10.25.
Let  be a strict partial order on a set A and let
1. Delete an edge that is in a cycle.
Ak WWD fa j depth .a/ D kg
2. Delete edge hu ! vi if there is a path from vertex u to vertex v that does not
include hu ! vi. where k 2 N.
3. Add edge hu ! vi if there is no path in either direction between vertex u and (a) Prove that A0 ; A1 ; : : : is a parallel schedule for  according to Definition 10.5.7.
vertex v.
(b) Prove that Ak is an antichain.
The procedure of repeating these operations until none of them are applicable can
be modeled as a state machine. The start state is G, and the states are all possible
digraphs with the same vertices as G. Problem 10.26.
(a) Let G be the graph with vertices f1; 2; 3; 4g and edges We want to schedule n tasks with prerequisite constraints among the tasks defined
by a DAG.
fh1 ! 2i ; h2 ! 3i ; h3 ! 4i ; h3 ! 2i ; h1 ! 4ig (a) Explain why any schedule that requires only p processors must take time at
least dn=pe.
What are the possible final states reachable from G?
A line graph is a graph whose edges are all on one path. All the final graphs in (b) Let Dn;t be the DAG with n elements that consists of a chain of t 1 elements,
part (a) are line graphs. with the bottom element in the chain being a prerequisite of all the remaining ele-
ments as in the following figure:
(b) Prove that if the procedure terminates with a digraph H then H is a line graph
with the same vertices as G. What is the minimum time schedule for Dn;t ? Explain why it is unique. How many
processors does it require?
Hint: Show that if H is not a line graph, then some operation must be applicable.
(c) Write a simple formula M.n; t; p/ for the minimum time of a p-processor
(c) Prove that being a DAG is a preserved invariant of the procedure.
schedule to complete Dn;t .
(d) Prove that if G is a DAG and the procedure terminates, then the walk relation
(d) Show that every partial order with n vertices and maximum chain size t has a
of the final line graph is a topological sort of G.
p-processor schedule that runs in time M.n; t; p/.
Hint: Verify that the predicate
Hint: Use induction on t.
P .u; v/ WWD there is a directed path from u to v

is a preserved invariant of the procedure, for any two vertices u; v of a DAG.


“mcs” — 2018/6/6 — 13:43 — page 465 — #473 “mcs” — 2018/6/6 — 13:43 — page 536 — #544

10.12. References 465 536 Chapter 12 Simple Graphs

of edges per vertex. Explain why. handshaking lemma

Problem 12.2.
t-1 Among connected simple graphs whose sum of vertex degrees is 20:

...
(a) What is the largest possible number of vertices? degree sum = 20 implies edge sum = 10
no of vertices = 11
Briefly explain:

(b) What is the smallest possible number of vertices? 5

... Briefly explain:

n - (t - 1) Class Problems
Problem 12.3. (a) Prove that in every simple graph, there are an even number of
vertices of odd degree. handshaking lemma

Problems for Section 10.6 (b) Conclude that at a party where some people shake hands, the number of people
who shake hands an odd number of times is an even number.
Practice Problems
(c) Call a sequence of people at the party a handshake sequence if each person in
Problem 10.27. the sequence has shaken hands with the next person, if any, in the sequence.
In this DAG (Figure 10.14) for the divisibility relation on f1; : : : ; 12g, there is
an upward path from a to b iff a j b. If 24 was added as a vertex, what is the Suppose George was at the party and has shaken hands with an odd number of
minimum number of edges that must be added to the DAG to represent divisibility people. Explain why, starting with George, there must be a handshake sequence
on set 1; : : : ; 12; 24? What are those edges? ending with a different person who has shaken an odd number of hands.

Exam Problems
8

12 Problem 12.4.
9 4
A researcher analyzing data on heterosexual sexual behavior in a group of m males
6 10
and f females found that within the group, the male average number of female
partners was 10% larger that the female average number of male partners.
11 3 2 5 7

(a) Comment on the following claim. “Since we’re assuming that each encounter
1
involves one man and one woman, the average numbers should be the same, so the
males must be exaggerating.”
Figure 10.14 (b) For what constant c is m D c  f ?

(c) The data shows that approximately 20% of the females were virgins, while
only 5% of the males were. The researcher wonders how excluding virgins from
the population would change the averages. If he knew graph theory, the researcher
Problem 10.28. (a) Prove that every strict partial order is a DAG.
“mcs” — 2018/6/6 — 13:43 — page 537 — #545 “mcs” — 2018/6/6 — 13:43 — page 538 — #546

12.12. References 537 538 Chapter 12 Simple Graphs

would realize that the nonvirgin male average number of partners will be x.f =m/ (a)
times the nonvirgin female average number of partners. What is x?
G1 with V1 D f1; 2; 3; 4; 5; 6g; E1 D f12; 23; 34; 14; 15; 35; 45g
(d) For purposes of further research, it would be helpful to pair each female in the G2 with V2 D f1; 2; 3; 4; 5; 6g; E2 D f12; 23; 34; 45; 51; 24; 25g
group with a unique male in the group. Explain why this is not possible.
(b)

G3 with V3 D f1; 2; 3; 4; 5; 6g; E3 D f12; 23; 34; 14; 45; 56; 26g
Problems for Section 12.4 G4 with V4 D fa; b; c; d; e; f g; E4 D fab; bc; cd; de; ae; ef; cf g

Practice Problems
Problem 12.5. Problem 12.7.
Which of the items below are simple-graph properties preserved under isomor- List all the isomorphisms between the two graphs given in Figure 12.23. Explain
phism? why there are no others.
(a) There is a cycle that includes all the vertices. t 1 a

(b) The vertices are numbered 1 through 7. f

(c) The vertices can be numbered 1 through 7. t 3 2 4 c b d

(d) There are two degree 8 vertices. t

(e) Two edges are of equal length. f 5 6 e f

(f) No matter which edge is removed, there is a path between any two vertices. t Figure 12.23 Graphs with several isomorphisms
(g) There are two cycles that do not share any vertices. t

(h) The vertices are sets. Homework Problems


Problem 12.8.
(i) The graph can be drawn in a way that all the edges have the same length. t
Determine which among the four graphs pictured in Figure 12.24 are isomorphic.
(j) No two edges cross. f
For each pair of isomorphic graphs, describe an isomorphism between them. For
each pair of graphs that are not isomorphic, give a property that is preserved under
(k) The OR of two properties that are preserved under isomorphism. t isomorphism such that one graph has the property, but the other does not. For
at least one of the properties you choose, prove that it is indeed preserved under
(l) The negation of a property that is preserved under isomorphism. f
isomorphism (you only need prove one of them).

Class Problems
Problem 12.6. Problem 12.9. (a) For any vertex v in a graph, let N.v/ be the set of neighbors of
For each of the following pairs of simple graphs, either define an isomorphism v, namely, the vertices adjacent to v:
between them, or prove that there is none. (We write ab as shorthand for ha—bi.)
N.v/ WWD fu j hu—vi is an edge of the graphg:
“mcs” — 2018/6/6 — 13:43 — page 539 — #547 “mcs” — 2018/6/6 — 13:43 — page 540 — #548

12.12. References 539 540 Chapter 12 Simple Graphs

Suppose f is an isomorphism from graph G to graph H . Prove that f .N.v// D


N.f .v// for each vertex v of G. In other words, if f maps vertex v to vertex w D
f .v/, then f maps the set of v’s neighbors to precisely the set of w’s neighbors.
Your proof should follow by simple reasoning using the definitions of isomorphism
and neighbors—no pictures or handwaving.
Hint: Prove by a chain of iff’s that

h 2 N.f .v// iff h 2 f .N.v//


1 1
for every h 2 VH . Use the fact that h D f .u/ for some u 2 VG (why is this true?).
6 6
5 8 9 2 5 9 7 2 (b) Conclude that if G and H are isomorphic graphs, then for each k 2 N, they
have the same number of degree k vertices.

10 7 10 8
Problem 12.10.
4 3 4 3 Let’s say that a graph has “two ends” if it has exactly two vertices of degree 1 and
(a) G1 (b) G2 all its other vertices have degree 2. For example, here is one such graph:

1
1
9 2
6
5 9 7 2 8 3
10 (a) A line graph is a graph whose vertices can be listed in a sequence with edges
between consecutive vertices only. So the two-ended graph above is also a line
10 8 graph of length 4.
7 4
Prove that the following theorem is false by drawing a counterexample.
False Theorem. Every two-ended graph is a line graph.
4 3 6 5
(c) G3 (d) G4
(b) Point out the first erroneous statement in the following bogus proof of the false
theorem and describe the error.
Figure 12.24 Which graphs are isomorphic?
Bogus proof. We use induction. The induction hypothesis is that every two-ended
graph with n edges is a line graph.
Base case (n D 1): The only two-ended graph with a single edge consists of two
vertices joined by an edge:

Sure enough, this is a line graph.


“mcs” — 2018/6/6 — 13:43 — page 541 — #549 “mcs” — 2018/6/6 — 13:43 — page 542 — #550

12.12. References 541 542 Chapter 12 Simple Graphs

Inductive case: We assume that the induction hypothesis holds for some n  1 11
and prove that it holds for n C 1. Let Gn be any two-ended graph with n edges.
By the induction assumption, Gn is a line graph. Now suppose that we create a
two-ended graph GnC1 by adding one more edge to Gn . This can be done in only 8
one way: the new edge must join one of the two endpoints of Gn to a new vertex;
otherwise, GnC1 would not be two-ended. 6 5
gn 3 2

1
9 7
4
12 10

new edge Figure 12.25 The Dürer graph, D.

Clearly, GnC1 is also a line graph. Therefore, the induction hypothesis holds for Hint: If f and g are graph automorphisms, prove that g ı f is, too.
all graphs with n C 1 edges, which completes the proof by induction.
(e) Because R is an equivalence relation, it partitions the vertices into equivalence

classes.12 What are these equivalence classes for the Dürer graph? How do you
know?
Hint: There are only two classes.
Problem 12.11.
If G is any simple graph, then a graph isomorphism from G to the same graph
G is called a graph automorphism11 . As a simple example, the identity function
id W V .G/ ! V .G/ is always a graph automorphism.
Problems for Section 12.5
(a) If D is the Dürer graph pictured in Figure 12.25, briefly describe a graph
automorphism of D that is not the identity function. Practice Problems
Problem 12.12.
(b) Define a relation R on V .G/ by declaring that v R w precisely when there Let B be a bipartite graph with vertex sets L.B/; R.B/. Explain why the sum of
exists a graph automorphism f of G with f .v/ D w. In the special case of the the degrees of the vertices in L.B/ equals the sum of the degrees of the vertices in
Dürer graph, prove that 1 R 10. R.B/.
Hint: Try to map 1; 2; 3 to 10; 11; 12, respectively. Where must the other vertices
go? Class Problems
(c) In the Dürer graph, prove that NOT.1 R 4/. Problem 12.13.
A certain Institute of Technology has a lot of student clubs; these are loosely over-
Hint: Length 3 cycles.
seen by the Student Association. Each eligible club would like to delegate one of its
(d) Prove carefully that for any simple graph G (not necessarily the Dürer graph), members to appeal to the Dean for funding, but the Dean will not allow a student to
the relation R defined above is an equivalence relation. 12 Nodes in the same equivalence class can be thought of, informally, as having the “same role” in

11 So-named because “auto” means “self”, so an automorphism is a “self-isomorphism.” the graph, since you can move one to the other through an isomorphism.
“mcs” — 2018/6/6 — 13:43 — page 543 — #551 “mcs” — 2018/6/6 — 13:43 — page 544 — #552

12.12. References 543 544 Chapter 12 Simple Graphs

be the delegate of more than one club. Fortunately, the Association VP took Math solve the problem.)
for Computer Science and recognizes a matching problem when she sees one.
(b) Suppose 41 students have been selected. Can you guarantee that a matching
(a) Explain how to model the delegate selection problem as a bipartite matching
exists, or are there some situations where not all of the 41 students can be accom-
problem. (This is a modeling problem; we aren’t looking for a description of an
modated? Briefly explain.
algorithm to solve the problem.)
(c) If instead only 40 students are chosen, prove that there is always a matching.
(b) The VP’s records show that no student is a member of more than 9 clubs. The
VP also knows that to be eligible for support from the Dean’s office, a club must Hint: Use Hall’s Theorem or something similar. Is your graph degree constrained?
have at least 13 members. That’s enough for her to guarantee there is a proper
delegate selection. Explain. (If only the VP had taken an Algorithms class, she
could even have found a delegate selection without much effort.) Problem 12.16.
Because of the incredible popularity of his class Math for Computer Science, TA
Mike decides to give up on regular office hours. Instead, he arranges for each
Problem 12.14. student to join some study groups. Each group must choose a representative to talk
A simple graph is called regular when every vertex has the same degree. Call to the staff, but there is a staff rule that a student can only represent one group. The
a graph balanced when it is regular and is also a bipartite graph with the same problem is to find a representative from each group while obeying the staff rule.
number of left and right vertices. (a) Explain how to model the delegate selection problem as a bipartite matching
Prove that if G is a balanced graph, then the edges of G can be partitioned into problem. (This is a modeling problem; we aren’t looking for a description of an
blocks such that each block is a perfect matching. algorithm to solve the problem.)
For example, if G is a balanced graph with 2k vertices each of degree j , then the
edges of G can be partitioned into j blocks, where each block consists of k edges, (b) The staff’s records show that each student is a member of at most 4 groups,
each of which is a perfect matching. and all the groups have 4 or more members. Is that enough to guarantee there is a
proper delegate selection? Explain.
Exam Problems
Problem 12.15. Problem 12.17.
Marvel is staging 4 test screenings of Avengers: 1 War exclusively for a random Let Rb be the “implies” binary relation on propositional formulas defined by the rule
selection of MIT students!13 For scheduling purposes, each of the selected students that
will specify which of the four screenings don’t conflict with their schedule–every F R
b G iff Œ.F IMPLIES G/ is a valid formula: (12.5)
student is available for at least two out of the four screenings. However, each
screening has only 20 available seats, not all of which need to be filled each time. For example, .P AND Q/ R b P , because the formula .P AND Q/ IMPLIES P is
Marvel is thus faced with a difficult scheduling problem: how do they make sure valid. Also, it is not true that .P OR Q/ Rb P since .P OR Q/ IMPLIES P is not
each of the chosen students is able to find a seat at a screening? They’ve recruited valid.
you to help solve this dilemma. (a) Let A and B be the sets of formulas listed below. Explain why R
b is not a weak
(a) Describe how to model this situation as a matching problem. Be sure to specify partial order on the set A [ B.
what the vertices/edges should be and briefly describe how a matching would deter-
(b) Fill in the R
b arrows from A to B.
mine seat assignments for each student in a screening for which they are available.
(This is a modeling problem; we aren’t looking for a description of an algorithm to
13 Sadly this isn’t actually happening, as far as we know.
“mcs” — 2018/6/6 — 13:43 — page 545 — #553 “mcs” — 2018/6/6 — 13:43 — page 546 — #554

12.12. References 545 546 Chapter 12 Simple Graphs

a v
A arrows B
Q b w

P XOR Q c x

P OR Q d y

P AND Q e z
L(G) R(G)
P OR Q OR .P AND Q/

NOT .P AND Q/ Figure 12.26 Bipartite graph G.

P Homework Problems
Problem 12.19.
(c) The diagram in part (b) defines a bipartite graph G with L.G/ D A, R.G/ D
A Latin square is n  n array whose entries are the number 1; : : : ; n. These en-
B and an edge between F and G iff F R b G. Exhibit a subset S of A such that both
tries satisfy two constraints: every row contains all n integers in some order, and
S and A S are nonempty, and the set N.S / of neighbors of S is the same size as
also every column contains all n integers in some order. Latin squares come up
S , that is, jN.S/j D jS j.
frequently in the design of scientific experiments for reasons illustrated by a little
(d) Let G be an arbitrary, finite, bipartite graph. For any subset S  L.G/, let story in a footnote.14
S WWD L.G/ S , and likewise for any M  R.G/, let M WWD R.G/ M . Suppose 14 At Guinness brewery in the eary 1900’s, W. S. Gosset (a chemist) and E. S. Beavan (a “maltster”)
S is a subset of L.G/ such that jN.S /j D jS j, and both S and S are nonempty. were trying to improve the barley used to make the brew. The brewery used different varieties of
Circle the formula that correctly completes the following statement: barley according to price and availability, and their agricultural consultants suggested a different
fertilizer mix and best planting month for each variety.
There is a matching from L.G/ to R.G/ if and only if there is both a matching Somewhat sceptical about paying high prices for customized fertilizer, Gosset and Beavan planned
from S to its neighbors, N.S /, and also a matching from S to a season long test of the influence of fertilizer and planting month on barley yields. For as many
months as there were varieties of barley, they would plant one sample of each variety using a different
1 1 one of the fertilizers. So every month, they would have all the barley varieties planted and all the
N.S / N.S/ N .N.S // N .N.S// N.S / N.S / N.S / N.S /
fertilizers used, which would give them a way to judge the overall quality of that planting month.
But they also wanted to judge the fertilizers, so they wanted each fertilizer to be used on each variety
Hint: The proof of Hall’s Bottleneck Theorem. during the course of the season. Now they had a little mathematical problem, which we can abstract
as follows.
Suppose there are n barley varieties and an equal number of recommended fertilizers. Form an
n  n array with a column for each fertilizer and a row for each planting month. We want to fill in
Problem 12.18. (a) Show that there is no matching for the bipartite graph G in the entries of this array with the integers 1,. . . ,n numbering the barley varieties, so that every row
Figure 12.26 that covers L.G/. contains all n integers in some order (so every month each variety is planted and each fertilizer is
used), and also every column contains all n integers (so each fertilizer is used on all the varieties over
(b) The bipartite graph H in Figure 12.27 has an easily verified property that the course of the growing season).
implies it has a matching that covers L.H /. What is the property?
“mcs” — 2018/6/6 — 13:43 — page 547 — #555 “mcs” — 2018/6/6 — 13:43 — page 548 — #556

12.12. References 547 548 Chapter 12 Simple Graphs

Problem 12.20.
v Take a regular deck of 52 cards. Each card has a suit and a value. The suit is one of
a four possibilities: heart, diamond, club, spade. The value is one of 13 possibilities,
w A; 2; 3; : : : ; 10; J; Q; K. There is exactly one card for each of the 4  13 possible
b combinations of suit and value.
x Ask your friend to lay the cards out into a grid with 4 rows and 13 columns.
c They can fill the cards in any way they’d like. In this problem you will show that
y you can always pick out 13 cards, one from each column of the grid, so that you
d wind up with cards of all 13 possible values.
z (a) Explain how to model this trick as a bipartite matching problem between the
L(H)
R(H) 13 column vertices and the 13 value vertices. Is the graph necessarily degree-
constrained?
Figure 12.27 Bipartite Graph H .
(b) Show that any n columns must contain at least n different values and prove
that a matching must exist.
For example, here is a 4  4 Latin square:

1 2 3 4 Problem 12.21.
3 4 2 1 Scholars through the ages have identified twenty fundamental human virtues: hon-
esty, generosity, loyalty, prudence, completing the weekly course reading-response,
2 1 4 3 etc. At the beginning of the term, every student in Math for Computer Science pos-
4 3 1 2 sessed exactly eight of these virtues. Furthermore, every student was unique; that
is, no two students possessed exactly the same set of virtues. The Math for Com-
puter Science course staff must select one additional virtue to impart to each student
(a) Here are three rows of what could be part of a 5  5 Latin square:
by the end of the term. Prove that there is a way to select an additional virtue for
each student so that every student is unique at the end of the term as well.
2 4 5 3 1 Hint: Look for a matching in an appropriately defined bipartite graph. Be sure
to clearly specify your (left and right) vertices and edges.
4 1 3 2 5
3 2 1 5 4
Problem 12.22.
Suppose n teams play in a round-robin tournament. Each day, each team will play
a match with another team. Over a period of n 1 days, every team plays every
Fill in the last two rows to extend this “Latin rectangle” to a complete Latin square. other team exactly once. There are no ties. Show that for each day we can select a
winning team, without selecting the same team twice.15
(b) Show that filling in the next row of an n  n Latin rectangle is equivalent to Hint: Define a bipartite graph G with L.G/ the set of days and R.G/ the set of
finding a matching in some 2n-vertex bipartite graph. teams. For any set D of days, there may, or may not, have been a team that lost on
(c) Prove that a matching must exist in this bipartite graph and, consequently, a all of those days.
Latin rectangle can always be extended to a Latin square. 15 Based on 2012 Putnam Exam problem B3.
“mcs” — 2018/6/6 — 13:43 — page 549 — #557 “mcs” — 2018/6/6 — 13:43 — page 550 — #558

12.12. References 549 550 Chapter 12 Simple Graphs

other hand, variables b and d may use the same register; after the first step, we no
Problems for Section 12.6 longer need b and can overwrite the register that holds its value. Also, f and h may
use the same register; once f C 1 is evaluated in the last step, the register holding
Class Problems the value of f can be overwritten.
(a) Recast the register allocation problem as a question about graph coloring.
Problem 12.23.
What do the vertices correspond to? Under what conditions should there be an edge
Let G be the graph below.16 Carefully explain why .G/ D 4.
between two vertices? Construct the graph corresponding to the example above.

(b) Color your graph using as few colors as you can. Call the computer’s registers
R1, R2 etc. Describe the assignment of variables to registers implied by your
coloring. How many registers do you need?

(c) Suppose that a variable is assigned a value more than once, as in the code
snippet below:

:::
t Dr Cs
Problem 12.24. uDt 3
A portion of a computer program consists of a sequence of calculations where the t Dm k
results are stored in variables, like this:
v Dt Cu
Inputs: a; b :::
Step 1: c D aCb
2: d D ac How might you cope with this complication?
3: e D cC3
4: f D c e
5: g D aCf Problem 12.25.
6: h D f C1 Suppose an n-vertex bipartite graph has exactly k connected components, each of
Outputs: d; g; h which has two or more vertices. How many ways are there to color it using a given
set of two colors?
A computer can perform such calculations most quickly if the value of each variable
is stored in a register, a chunk of very fast memory inside the microprocessor.
Homework Problems
Programming language compilers face the problem of assigning each variable in a
program to a register. Computers usually have few registers, however, so they must Problem 12.26.
be used wisely and reused often. This is called the register allocation problem. 6.042 is often taught using recitations. Suppose it happened that 8 recitations were
In the example above, variables a and b must be assigned different registers, needed, with two or three staff members running each recitation. The assignment
because they hold distinct input values. Furthermore, c and d must be assigned of staff to recitation sections, using their secret codenames, is as follows:
different registers; if they used the same one, then the value of c would be over-
written in the second step and we’d get the wrong answer in the third step. On the  R1: Maverick, Goose, Iceman
16 From [32], Exercise 13.3.1  R2: Maverick, Stinger, Viper
“mcs” — 2018/6/6 — 13:43 — page 551 — #559 “mcs” — 2018/6/6 — 13:43 — page 552 — #560

12.12. References 551 552 Chapter 12 Simple Graphs

 R3: Goose, Merlin (a) Explain why the width of a graph must be at least the minimum degree of its
vertices.
 R4: Slider, Stinger, Cougar
(b) Prove that if a finite graph has width w, then there is a width-w sequence of
 R5: Slider, Jester, Viper
all its vertices that ends with a minimum degree vertex.
 R6: Jester, Merlin
(c) Describe a simple algorithm to find the minimum width of a graph.
 R7: Jester, Stinger
 R8: Goose, Merlin, Viper
Problem 12.29.
Two recitations can not be held in the same 90-minute time slot if some staff Let G be a simple graph whose vertex degrees are all  k. Prove by induction on
member is assigned to both recitations. The problem is to determine the minimum number of vertices that if every connected component of G has a vertex of degree
number of time slots required to complete all the recitations. strictly less than k, then G is k-colorable.
(a) Recast this problem as a question about coloring the vertices of a particular
graph. Draw the graph and explain what the vertices, edges, and colors represent.
Problem 12.30.
(b) Show a coloring of this graph using the fewest possible colors; explain why A basic example of a simple graph with chromatic number n is the complete graph
no fewer colors will work. What schedule of recitations does this imply? on n vertices, that is .Kn / D n. This implies that any graph with Kn as a subgraph
must have chromatic number at least n. It’s a common misconception to think that,
conversely, graphs with high chromatic number must contain a large complete sub-
Problem 12.27. graph. In this problem we exhibit a simple example countering this misconception,
This problem generalizes the result proved Theorem 12.6.3 that any graph with namely a graph with chromatic number four that contains no triangle—length three
maximum degree at most w is .w C 1/-colorable. cycle—and hence no subgraph isomorphic to Kn for n  3. Namely, let G be the
A simple graph G is said to have width w iff its vertices can be arranged in a 11-vertex graph of Figure 12.28. The reader can verify that G is triangle-free.
sequence such that each vertex is adjacent to at most w vertices that precede it in
the sequence. If the degree of every vertex is at most w, then the graph obviously
has width at most w—just list the vertices in any order.
(a) Prove that every graph with width at most w is .w C 1/-colorable.

(b) Describe a 2-colorable graph with minimum width n.

(c) Prove that the average degree of a graph of width w is at most 2w.

(d) Describe an example of a graph with 100 vertices, width 3, but average degree
more than 5.
Figure 12.28 Graph G with no triangles and .G/ D 4.

(a) Show that G is 4-colorable.


Problem 12.28.
A sequence of vertices of a graph has width w iff each vertex is adjacent to at most (b) Prove that G can’t be colored with 3 colors.
w vertices that precede it in the sequence. A simple graph G has width w if there
is a width-w sequence of all its vertices.
“mcs” — 2018/6/6 — 13:43 — page 553 — #561 “mcs” — 2018/6/6 — 13:43 — page 554 — #562

12.12. References 553 554 Chapter 12 Simple Graphs

Problem 12.31.
This problem will show that 3-coloring a graph is just as difficult as finding a sat-
isfying truth assignment for a propositional formula. The graphs considered will
all be taken to have three designated color-vertices connected in a triangle to force
them to have different colors in any coloring of the graph. The colors assigned to
the color-vertices will be called T; F and N .
Suppose f is an n-argument truth function. That is, NOT(P)

f W fT; F gn ! fT; F g:

A graph G is called a 3-color-f-gate iff G has n designated input vertices and a P N  


designated output vertex, such that
T   F  
 G can be 3-colored only if its input vertices are colored with T ’s and F ’s.

 For every sequence b1 ; b2 ; : : : ; bn 2 fT; F g, there is a 3-coloring of G in


which the input vertices v1 ; v2 ; : : : ; vn 2 V .G/ have the colors b1 ; b2 ; : : : ; bn 2
fT; F g.

 In any 3-coloring of G where the input vertices v1 ; v2 ; : : : ; vn 2 V .G/ have Figure 12.29 A 3-color NOT-gate
colors b1 ; b2 ; : : : ; bn 2 fT; F g, the output vertex has color f .b1 ; b2 ; : : : ; bn /.

For example, a 3-color-NOT-gate consists simply of two adjacent vertices. One


vertex is designated to be the input vertex P and the other is designated to be the
output vertex. Both vertices have to be constrained so they can only be colored with
P OR Q
T ’s or F ’s in any proper 3-coloring. This constraint can be imposed by making
them adjacent to the color-vertex N , as shown in Figure 12.29.
(a) Verify that the graph in Figure 12.30 is a 3-color-OR-gate. (The dotted lines
indicate edges to color-vertex N ; these edges constrain the P , Q and P OR Q N
vertices to be colored T or F in any proper 3-coloring.)
T
(b) Let E be an n-variable propositional formula, and suppose E defines a truth
function f W fT; F gn ! fT; F g. Explain a simple way to construct a graph that is F P Q
a 3-color-f -gate.

(c) Explain why an efficient procedure for determining if a graph was 3-colorable
would lead to an efficient procedure to solve the satisfiability problem, SAT.

Problem 12.32.
The 3-coloring problem for planar graphs turns out to be no easier than the 3- Figure 12.30 A 3-color OR-gate
coloring problem for arbitrary graphs. This claim follows very simply from the
“mcs” — 2018/6/6 — 13:43 — page 555 — #563 “mcs” — 2018/6/6 — 13:43 — page 556 — #564

12.12. References 555 556 Chapter 12 Simple Graphs

u w

Figure 12.32 Replacing an edge-crossing with a planar gadget.


Figure 12.31 A 3-color cross-over gadget.

Exam Problems
existence of a “3-color cross-over gadget.” Such a gadget is a planar graph whose
outer face is a cycle with four designated vertices u; v; w; x occurring in clockwise Problem 12.33.
order such that

(i) Any assignment of colors to vertices u and v can be completed into a 3- False Claim. Let G be a graph whose vertex degrees are all  k. If G has a vertex
coloring of the gadget. of degree strictly less than k, then G is k-colorable.
(a) Give a counterexample to the False Claim when k D 2.
(ii) In every 3-coloring of the gadget, the colors of u and w are the same, and the
colors of v and x are the also same. (b) Underline the exact sentence or part of a sentence that is the first unjustified
step in the following bogus proof of the False Claim.
Figure 12.31 shows such a 3-color cross-over gadget.17
So to find a 3-coloring for any simple graph, simply draw it in the plane with Bogus proof. Proof by induction on the number n of vertices:
edges crossing as needed, and then replace each occurrence of an edge crossing by The induction hypothesis P .n/ is:
a copy of the gadget as shown in Figure 12.32. This yields a planar graph which
Let G be an n-vertex graph whose vertex degrees are all  k. If G
has a 3-coloring iff the original graph had one.
also has a vertex of degree strictly less than k, then G is k-colorable.
(a) Prove that the graph in Figure 12.31 satisfies condition (i) by exhibiting the
claimed 3-colorings. Base case: (n D 1) G has one vertex, the degree of which is 0. Since G is
Hint: Only two colorings are needed, one where u and v are the same color and 1-colorable, P .1/ holds.
another where they are not the same color. Inductive step: We may assume P .n/. To prove P .n C 1/, let GnC1 be a
(b) Prove that the graph in Figure 12.31 satisfies condition (ii). graph with nC1 vertices whose vertex degrees are all k or less. Also, suppose
GnC1 has a vertex v of degree strictly less than k. Now we only need to prove
Hint: The colorings for part (a) are almost completely forced by the coloring of u
that GnC1 is k-colorable.
and v.
To do this, first remove the vertex v to produce a graph Gn with n vertices.
17 The original such gadget and reduction of 3-colorability to planar 3-colorability were due to
Let u be a vertex that is adjacent to v in GnC1 . Removing v reduces the
Larry Stockmeyer [46]. The current simplified gadget is due to M.S. Paterson.
“mcs” — 2018/6/6 — 13:43 — page 557 — #565 “mcs” — 2018/6/6 — 13:43 — page 558 — #566

12.12. References 557 558 Chapter 12 Simple Graphs

degree of u by 1. So in Gn , vertex u has degree strictly less than k. Since no


edges were added, the vertex degrees of Gn remain  k. So Gn satisfies the
conditions of the induction hypothesis P .n/, and so we conclude that Gn is
XOR P ⊕ Q

k-colorable.
Now a k-coloring of Gn gives a coloring of all the vertices of GnC1 , except for
v. Since v has degree less than k, there will be fewer than k colors assigned
N
to the nodes adjacent to v. So among the k possible colors, there will be a
color not used to color these adjacent nodes, and this color can be assigned to T b P e c F
v to form a k-coloring of GnC1 .
 F

(c) With a slightly strengthened condition, the preceding proof of the False Claim a d
could be revised into a sound proof of the following Claim:
Claim. Let G be a graph whose vertex degrees are all  k. Q
If hstatement inserted from belowi has a vertex of degree strictly less than k, then
G is k-colorable.
Indicate each of the statements below that could be inserted to make the proof Figure 12.33 A 3-color XOR-gate
correct.

 G is connected and
 G has no vertex of degree zero and Problems for Section 12.7
 G does not contain a complete graph on k vertices and Practice Problems
 every connected component of G
Problem 12.35.
 some connected component of G Draw a simple graph in which there are at least two distinct paths between two of
the graph’s vertices u and v, but neither u nor v is on a cycle. Be sure to label u
and v on your drawing.
Problem 12.34. Hint: There is a five-vertex graph that exhibits this property.
In the graph shown in Figure 12.33, the vertices connected in the triangle on the left
are called color-vertices; since they form a triangle, they are forced to have different Exam Problems
colors in any coloring of the graph. The colors assigned to the color-vertices will
Problem 12.36.
be called T; F and N. The dotted lines indicate edges to the color-vertex N.
Since you can go back and forth on an edge in a simple graph, every vertex is on
(a) Explain why for any assignment of different truth-colors to P and Q, there is an even length closed walk. So even length closed walks don’t tell you much about
a unique 3-coloring of the graph. even length cycles. The situation with odd-length closed walks is more interesting.
(b) Prove that in any 3-coloring of the whole graph, the vertex labeled P XOR Q (a) Give an example of a simple graph in which every vertex is on a unique odd-
is colored with the XOR of the colors of vertices P and Q. length cycle and a unique even-length cycle.
Hint: Four vertices.
“mcs” — 2018/6/6 — 13:43 — page 559 — #567 “mcs” — 2018/6/6 — 13:43 — page 560 — #568

12.12. References 559 560 Chapter 12 Simple Graphs

(b) Give an example of a simple graph in which every vertex is on a unique odd- (d) Try extending your reasoning to H4 . (In fact, the connectivity of Hn is n for
length cycle and no vertex is on an even-length cycle. all n  1. A proof appears in the problem solution.)

(c) Prove that in a digraph, a smallest size odd-length closed walk must be a cycle.
Note that there will always be lots of even-length closed walks that are shorter than Problem 12.39.
the smallest odd-length one. A set M of vertices of a graph is a maximal connected set if every pair of vertices
Hint: Let e be an odd-length closed walk of minimum size, and suppose it begins in the set are connected, and any set of vertices properly containing M will contain
and ends at vertex a. If it is not a cycle, then it must include a repeated vertex two vertices that are not connected.
b ¤ a. That is, e starts with a walk f from a to b, followed by a walk g from b to (a) What are the maximal connected subsets of the following (unconnected) graph?
b, followed by a walk h from b to a.18

Problems for Section 12.10


Class Problems
Problem 12.37.
A simple graph G is 2-removable iff it contains two vertices v ¤ w such that G v
is connected, and G w is also connected. Prove that every connected graph with
at least two vertices is 2-removable.
Hint: Consider a maximum length path.

(b) Explain the connection between maximal connected sets and connected com-
Problem 12.38. ponents. Prove it.
The n-dimensional hypercube Hn is a graph whose vertices are the binary strings
of length n. Two vertices are adjacent if and only if they differ in exactly 1 bit. For
example, in H3 , vertices 111 and 011 are adjacent because they differ only in the Problem 12.40. (a) Prove that Kn is .n 1/-edge connected for n > 1.
first bit, while vertices 101 and 011 are not adjacent because they differ at both Let Mn be a graph defined as follows: begin by taking n graphs with non-
the first and second bits. overlapping sets of vertices, where each of the n graphs is .n 1/-edge connected
(a) Prove that it is impossible to find two spanning trees of H3 that do not share (they could be disjoint copies of Kn , for example). These will be subgraphs of Mn .
some edge. Then pick n vertices, one from each subgraph, and add enough edges between pairs
of picked vertices that the subgraph of the n picked vertices is also .n 1/-edge
(b) Verify that for any two vertices x ¤ y of H3 , there are 3 paths from x to y in
connected.
H3 , such that, besides x and y, no two of those paths have a vertex in common.
(b) Draw a picture of M3 .: : : M4 /.
(c) Conclude that the connectivity of H3 is 3.
(c) Explain why Mn is .n 1/-edge connected.
18 In the notation of the text
e D a fb
b gb
b h a:

Problem 12.41.
“mcs” — 2018/6/6 — 13:43 — page 561 — #569 “mcs” — 2018/6/6 — 13:43 — page 562 — #570

12.12. References 561 562 Chapter 12 Simple Graphs

Homework Problems
False Claim. If every vertex in a graph has positive degree, then the graph is Problem 12.42.
connected. An edge is said to leave a set of vertices if one end of the edge is in the set and the
other end is not.
(a) Prove that this Claim is indeed false by providing a counterexample.
(a) An n-node graph is said to be mangled if there is an edge leaving every set of
(b) Since the Claim is false, there must be a logical mistake in the following bogus bn=2c or fewer vertices. Prove the following:
proof. Pinpoint the first logical mistake (unjustified step) in the proof. Claim. Every mangled graph is connected.

Bogus proof. We prove the Claim above by induction. Let P .n/ be the proposition An n-node graph is said to be tangled if there is an edge leaving every set of
that if every vertex in an n-vertex graph has positive degree, then the graph is dn=3e or fewer vertices.
connected. (b) Draw a tangled graph that is not connected.
Base cases: (n  2). In a graph with 1 vertex, that vertex cannot have positive (c) Find the error in the bogus proof of the following:
degree, so P .1/ holds vacuously. False Claim. Every tangled graph is connected.
P .2/ holds because there is only one graph with two vertices of positive degree,
namely, the graph with an edge between the vertices, and this graph is connected. Bogus proof. The proof is by strong induction on the number of vertices in the
Inductive step: We must show that P .n/ implies P .n C 1/ for all n  2. Consider graph. Let P .n/ be the proposition that if an n-node graph is tangled, then it is
an n-vertex graph in which every vertex has positive degree. By the assumption connected. In the base case, P .1/ is true because the graph consisting of a single
P .n/, this graph is connected; that is, there is a path between every pair of vertices. node is trivially connected.
Now we add one more vertex x to obtain an .n C 1/-vertex graph: For the inductive case, assume n  1 and P .1/; : : : ; P .n/ hold. We must prove
P .n C 1/, namely, that if an .n C 1/-node graph is tangled, then it is connected.
So let G be a tangled, .n C 1/-node graph. Choose dn=3e of the vertices and let G1
z be the tangled subgraph of G with these vertices and G2 be the tangled subgraph
with the rest of the vertices. Note that since n  1, the graph G has a least two
n-node vertices, and so both G1 and G2 contain at least one vertex. Since G1 and G2 are
x tangled, we may assume by strong induction that both are connected. Also, since
connected
graph G is tangled, there is an edge leaving the vertices of G1 which necessarily connects
y to a vertex of G2 . This means there is a path between any two vertices of G: a path
within one subgraph if both vertices are in the same subgraph, and a path traversing
the connecting edge if the vertices are in separate subgraphs. Therefore, the entire
graph G is connected. This completes the proof of the inductive case, and the Claim
All that remains is to check that there is a path from x to every other vertex z. Since
follows by strong induction. 
x has positive degree, there is an edge from x to some other vertex y. Thus, we can
obtain a path from x to z by going from x to y and then following the path from y
to z. This proves P .n C 1/.
Problem 12.43.
By the principle of induction, P .n/ is true for all n  0, which proves the Claim. In the cycle C2n of length 2n, we’ll call two vertices opposite if they are on opposite
 sides of the cycle, that is that are distance n apart in C2n . Let G be the graph formed
from C2n by adding an edge, which we’ll call a crossing edge, between each pair
of opposite vertices. So G has n crossing edges.
“mcs” — 2018/6/6 — 13:43 — page 563 — #571 “mcs” — 2018/6/6 — 13:43 — page 564 — #572

12.12. References 563 564 Chapter 12 Simple Graphs

(a) Give a simple description of the shortest path between any two vertices of G. Exam Problems
Hint: Argue that a shortest path between two vertices in G uses at most one crossing Problem 12.45.
edge. We apply the following operation to a simple graph G: pick two vertices u ¤ v
such that either
(b) What is the diameter of G, that is, the largest distance between two vertices?
1. there is an edge of G between u and v, and there is also a path from u to v
(c) Prove that the graph is not 4-connected.
which does not include this edge; in this case, delete the edge hu—vi.
(d) Prove that the graph is 3-connected.
2. there is no path from u to v; in this case, add the edge hu—vi.

Keep repeating these operations until it is no longer possible to find two vertices
Problem 12.44. u ¤ v to which an operation applies.
An Euler tour of a graph is a closed walk that includes every edge exactly once.19 Assume the vertices of G are the integers 1; 2; : : : ; n for some n  2. This
In this problem we work out a proof of: procedure can be modelled as a state machine whose states are all possible simple
graphs with vertices 1; 2; : : : ; n. G is the start state, and the final states are the
Theorem. A connected graph has an Euler tour if and only if every vertex has even
graphs on which no operation is possible.
degree.
(a) Let G be the graph with vertices f1; 2; 3; 4g and edges
(a) Show that if a graph has an Euler tour, then the degree of each of its vertices
is even. ff1; 2g; f3; 4gg

In the remaining parts, we’ll work out the converse: if the degree of every vertex How many possible final states are reachable from start state G? 1in
of a connected finite graph is even, then it has an Euler tour. To do this, let’s define
(b) On the line next to each of the derived state variables below, indicate the
an Euler walk to be a walk that includes each edge at most once.
strongest property from the list below that the variable is guaranteed to satisfy,
(b) Suppose that an Euler walk in a connected graph does not include every edge. no matter what the starting graph G is. The properties are:
Explain why there must be an unincluded edge that is incident to a vertex on the
constant increasing decreasing
walk.
nonincreasing nondecreasing none of these
In the remaining parts, let w be the longest Euler walk in some finite, connected
graph. For any state, let e be the number of edges in it, and let c be the number of con-
nected components it has. Since e may increase or decrease in a transition, it does
(c) Show that if w is a closed walk, then it must be an Euler tour.
not have any of the first four properties. The derived variables are:
Hint: part (b)
0) e none of these
(d) Explain why all the edges incident to the end of w must already be in w.
i) c
(e) Show that if the end of w was not equal to the start of w, then the degree of ii) c C e
the end would be odd. iii) 2c C e
Hint: part (d) iv) c C e
eC1
(f) Conclude that if every vertex of a finite, connected graph has even degree, then (c) Explain why, starting from any state G, the procedure terminates. If your ex-
it has an Euler tour. planation depends on answers you gave to part (b), you must justify those answers.
19 In some other texts, this is called an Euler circuit.
“mcs” — 2018/6/6 — 13:43 — page 565 — #573 “mcs” — 2018/6/6 — 13:43 — page 566 — #574

12.12. References 565 566 Chapter 12 Simple Graphs

(d) Prove that any final state must be an unordered tree on the set of vertices, that (b) For G e, the graph G with vertex e deleted, describe two spanning trees that
is, a spanning tree. have no edges in common.

(c) For G e with edge ha—d i deleted, explain why there cannot be two edge-
Problem 12.46. disjoint spanning trees.
If a simple graph has e edges, v vertices, and k connected components, then it has Hint: : Count vertices and edges.
at least e v C k cycles.
Prove this by induction on the number of edges e.
Problem 12.49.
Let H3 be the graph shown in Figure 12.35. Explain why it is impossible to find
two spanning trees of H3 that have no edges in common.
Problems for Section 12.11
000 010

Practice Problems
100 110
Problem 12.47. (a) Prove that the average degree of a tree is less than 2.

(b) Suppose every vertex in a graph has degree at least k. Explain why the graph 101 111

has a path of length k.


001 011
Hint: Consider a longest path.
Figure 12.35 H3 .

Problem 12.50.
c
The diameter of a connected graph is the largest distance between any two vertices.
b d
(a) What is the largest possible diameter in any connected graph with n vertices?
Describe a graph with this maximum diameter.
e
(b) What is the smallest possible diameter of an n-vertex tree for n > 2? Describe
f g an n-vertex tree with this minimum diameter.

h Problem 12.51.

Figure 12.34 The graph G. (a) Indicate all the properties below that are preserved under graph isomorphism.

Problem 12.48. (a) How many spanning trees are there for the graph G in Fig-  There is a cycle that includes all the vertices.
ure 12.34?
 Two edges are of equal length.
“mcs” — 2018/6/6 — 13:43 — page 567 — #575 “mcs” — 2018/6/6 — 13:43 — page 568 — #576

12.12. References 567 568 Chapter 12 Simple Graphs

 The graph remains connected if any two edges are removed. Procedure Mark simply keeps marking eligible edges, and terminates when there
 There exists an edge that is an edge of every spanning tree. are none.
Prove that Mark terminates, and that when it does, the set of marked edges forms
 The negation of a property that is preserved under isomorphism.
a spanning tree of the original graph.
(b) For the following statements about finite trees, indicate whether they are true
or false, and provide counterexamples for those that are false.
Problem 12.54.
 Any connected subgraph is a tree. true false A procedure for connecting up a (possibly disconnected) simple graph and creating
a spanning tree can be modelled as a state machine whose states are finite simple
 Adding an edge between two nonadjacent vertices creates a cycle. true
graphs. A state is final when no further transitions are possible. The transitions are
false
determined by the following rules:
 The number of vertices is one less than twice the number of leaves. true
false Procedure create-spanning-tree
 The number of vertices is one less than the number of edges. true false
1. If there is an edge hu—vi on a cycle, then delete hu—vi.
 For every finite graph (not necessarily a tree), there is one (a finite tree) that
spans it. true false 2. If vertices u and v are not connected, then add the edge hu—vi.

Problem 12.52. (a) Draw all the possible final states reachable starting with the graph with vertices
f1; 2; 3; 4g and edges
Indicate True or False for the following statements about finite simple graphs fh1—2i ; h3—4ig:
G.
(b) Prove that if the machine reaches a final state, then the final state will be a tree
(a) G has a spanning tree. True False on the vertices of the graph on which it started.
(b) jV .G/j D O.jE.G/j/ for connected G. True False (c) For any graph G 0 , let e be the number of edges in G 0 , c be the number of con-
(c) jE.G/j D O.jV .G/j/. True False nected components it has, and s be the number of cycles. For each of the quantities
below, indicate the strongest of the properties that it is guaranteed to satisfy, no
(d) .G/  maxfdeg.v/ j v 2 V .G/g.20 True False matter what the starting graph is.

(e) jV .G/j D O..G//. True False The choices for properties are: constant, strictly increasing, strictly decreasing,
weakly increasing, weakly decreasing, none of these.
Class Problems
(i) e
Problem 12.53. (ii) c
Procedure Mark starts with a connected, simple graph with all edges unmarked and
then marks some edges. At any point in the procedure a path that includes only (iii) s
marked edges is called a fully marked path, and an edge that has no fully marked (iv) e s
path between its endpoints is called eligible. (v) c C e
20 .G/ is the chromatic number of G. (vi) 3c C 2e
“mcs” — 2018/6/6 — 13:43 — page 569 — #577 “mcs” — 2018/6/6 — 13:43 — page 570 — #578

12.12. References 569 570 Chapter 12 Simple Graphs

(vii) c C s 0 0.04 0.08


(d) Prove that one of the quantities from part (c) strictly decreases at each transi-
tion. Conclude that for every starting state, the machine will reach a final state.
1 1.04 1.08 1.12
Problem 12.55.
Let G be a weighted graph and suppose there is a unique edge e 2 E.G/ with
0.01 u 0.05 0.09
w
smallest weight, that is, w.e/ < w.f / for all edges f 2 E.G/ feg. Prove that
any minimum weight spanning tree (MST) of G must include e.
1.01 1.05 1.09 1.13

Problem 12.56.
Let G be the 4  4 grid with vertical and horizontal edges between neighboring 0.02 0.06 0.10
vertices and edge weights as shown in Figure 12.36.
In this problem you will practice some of the ways to build minimum-weight
spanning trees. For each part, list the edge weights in the order in which the edges 1.02 1.06 1.10 1.14
with those weights were chosen by the given rules.
(a) Construct a minimum weight spanning tree (MST) for G by initially selecting
the minimum weight edge, and then successively selecting the minimum weight
0.03 v 0.07 0.11
edge that does not create a cycle with the previously selected edges. Stop when the
selected edges form a spanning tree of G. (This is Kruskal’s MST algorithm.)
Figure 12.36 The 4x4 array graph G
For any step in Kruskal’s procedure, describe a black-white coloring of the graph
components so that the edge Kruskal chooses is the minimum weight “gray edge”
according to Lemma 12.11.10. to another tree—then go back to applying the general gray-edge method until the
parallel trees merge to form a spanning tree of G.
(b) Grow an MST for G by starting with the tree consisting of the single vertex u
and then successively adding the minimum weight edge with exactly one endpoint (d) Verify that you got the same MST each time as promised by Corollary 12.11.13.
in the tree. Stop when the tree spans G. (This is Prim’s MST algorithm.)
For any step in Prim’s procedure, describe a black-white coloring of the graph com-
ponents so that the edge Prim chooses is the minimum weight “gray edge”according Problem 12.57.
to Lemma 12.11.10. In this problem you will prove:

(c) The 6.042 “parallel” MST algorithm can grow an MST for G by starting with Theorem. A graph G is 2-colorable iff it contains no odd length closed walk.
the upper left corner vertex along with the vertices labelled v and w. Regard each of As usual with “iff” assertions, the proof splits into two proofs: part (a) asks you
the three vertices as one-vertex trees. Successively add, for each tree in parallel, the to prove that the left side of the “iff” implies the right side. The other problem parts
minimum-weight edge among the edges with exactly one endpoint in the tree. Stop prove that the right side implies the left.
working on a tree when there is an edge connecting it to another tree. Continue
until there are no more eligible trees—that is, each tree is connected by an edge (a) Assume the left side and prove the right side. Three to five sentences should
suffice.
“mcs” — 2018/6/6 — 13:43 — page 571 — #579 “mcs” — 2018/6/6 — 13:43 — page 572 — #580

12.12. References 571 572 Chapter 12 Simple Graphs

(b) Now assume the right side. As a first step toward proving the left side, explain Homework Problems
why we can focus on a single connected component H within G.
Problem 12.60.
(c) As a second step, explain how to 2-color any tree. If a finite simple graph G has exactly jV .G/j jE.G/j components, then G is a
forest. Prove this by induction on the number of vertices.
(d) Choose any 2-coloring of a spanning tree T of H . Prove that H is 2-colorable
by showing that any edge not in T must also connect different-colored vertices. Problem 12.61.
Let G be a connected simple graph, T be a spanning tree of G, and e be an edge of
G.
Problem 12.58. (a) Prove that if e is not on a cycle in G, then e is an edge of T .
MIT Information Services & Technology (IS&T) wants to assemble a cluster of
n computers using wires and hubs. Each computer must have exactly one wire (b) Prove that if e is on a cycle in G, and e is in T , then there is an edge f ¤ e
attached to it, while each hub can have up to five wires attached. There must be a such that T e C f is also a spanning tree.
path of wires between every pair of computers in the cluster.
(c) Suppose G is edge-weighted, the weight of e is larger than the weights of all
(a) Prove by induction that d.n 2/=3e hubs are sufficient for IS&T to assemble the other edges, e is on a cycle in G, and e is an edge of T . Conclude that T is not
the cluster of n computers. a minimum weight spanning tree of G.
Altogether, we have now shown that a maximum-weight edge is a member of a
Suppose IS&T uses m hubs.
minimum-weight spanning tree iff it is a cut edge.
(b) Write a simple formula in terms of m and n that bounds the maximum number
of wires that can be attached to the hubs and computers without leaving dangling Exam Problems
ends.
Problem 12.62. (a) Let T be a tree and e a new edge between two vertices of T .
(c) Write a simple formula in terms of m and n for a lower bound on the number Explain why T C e must contain a cycle.
of wires needed to form the cluster, even using hubs that may have more than five
wires attached. (b) Conclude that T C e must have at least three spanning trees.

(d) IS&T wants to minimize the number of hubs used to assemble the cluster. Use
the previous results to prove that at d.n 2/=3e hubs are necessary and sufficient Problem 12.63.
to hook up the cluster. How many 5-vertex non-isomomorphic trees are there? Explain.

Problem 12.59. Problem 12.64.


Note that the two parts of this problem do not depend on each other. A simple graph G is said to have width 1 iff there is a way to list all its vertices so
(a) Let G be a connected simple graph. Prove that every spanning tree of G must that each vertex is adjacent to at most one vertex that appears earlier in the list. All
include every cut edge of G. the graphs mentioned below are assumed to be finite.
(a) Prove that every graph with width one is a forest.
(b) Suppose a connected, weighted graph G has a unique maximum-weight edge
e. Show that if e is in a minimum weight spanning tree of G, then e is a cut edge. Hint: By induction, removing the last vertex.

(b) Prove that every finite tree has width one. Conclude that a graph is a forest iff
it has width one.
“mcs” — 2018/6/6 — 13:43 — page 573 — #581 “mcs” — 2018/6/6 — 13:43 — page 574 — #582

12.12. References 573 574 Chapter 12 Simple Graphs

Problem 12.65. (iii) the maximum path length in G


Prove by induction that, using a fixed set of n > 1 colors, there are exactly
(iv) the largest distance21 between two vertices of G.
n  .n 1/m 1
(v) the girth of G: the length of the smallest cycle in G
different colorings of any tree with m vertices.
(vi) the number of connected components of G

(vii) the size of the largest complete subgraph of G: maxfn j Kn is a subgraph of Gg


Problem 12.66.
Let G be a connected weighted simple graph and let v be a vertex of G. Suppose
e WWD hv—wi is an edge of G that is strictly smaller than the weight of every other (viii) the sum of the vertex degrees of G
edge incident to v. Let T be a minimum weight spanning tree of G. (ix) the number of spanning trees of G
Give a direct proof that e is an edge of T (without appeal to any “gray edge”
argument). (x) the number of cut edges in G

Problem 12.67.
For any simple graph G, a “new” edge e is one that connects nonadjacent vertices.
(More formally, e is “new” when e 2 V .G/2 E.G/.) let G C e be the graph that
results from adding the new edge e to E.G/. A real-valued function f on finite
simple graphs is

 strictly edge-increasing when f .G C e/ > f .G/,

 constant when f .G/ D f .G C e/

 weakly edge-increasing when f .G C e/  f .G/ and f is not constant,

 strictly edge-decreasing when f .G C e/ < f .G/,

 weakly edge-decreasing when f .G C e/  f .G/ and f is not constant,

for all finite simple graphs G and new edges e.


For example, if f .G/ is jE.G/j, then f .G C e/ D 1 C f .G/ > f .G/, so this f
is strictly increasing. Similarly, if f .G/ is jV .G/j, then f .G C e/ D f .G/ since
adding an edge between vertices leaves the set of vertices unchanged; this f would
be constant.
For each of the following functions f .G/, indicate which of the above properties
it has, if any.

(i) .G/, the chromatic number of G.


21 The distance between two vertices is the length of the shortest path between them. It is infinite

(ii) the connectivity of G: maxfk 2 N j G is k-connectedg if the vertices are not connected.

You might also like