Вы находитесь на странице: 1из 11

Math 68 - Spring 2014 - Practice problems with solutions -

Chapter 2

2.1.2 Let G be a graph.


(a) Prove that G is a tree if and only if G is connected and every edge is a cut
edge.

Proof. Recall that an edge is a cut edge if an only if it is part of a cycle. Then every edge
is a cut edge if and only if G is acyclic. Since G is a tree if and only if G is connected
and acyclic, G is a tree if and only if it is connected and every edge is a cut edge. 

(b) Prove that G is a tree if and only if G is loopless and adding any edge with
endpoints in V (G) creates exactly one cycle.

Proof. By Corollary 1.2.5, adding any edge to a tree produces a cycle. Now suppose
adding any edge e produces a cycle. Then G must be connected (since e is not a cut edge
of G + e, and an edge with one endpoint in one component and the other in a separate
component would be a cut edge). Now suppose G already has a cycle C. Then adding
an edge e with both endpoints adds at least two cycles: the edge separates in C into two
paths; each of the new cycles is one of those two paths, closed off by e.


2.1.18 Prove that every tree with maximum degree ∆ > 1 has at least ∆ leaves. Show
that this is the best possible by constructing an n-vertex tree with exactly ∆
leaves foe each choice of n, ∆ with n > ∆ ≥ 2.

Proof. If ∆ = 0 or 1, then G = P1 or P2 . Otherwise, pick a vertex v of degree ∆. Then G − v


contains all of the leaves of G. It also has (at least) ∆ components since there is at most one
path connecting any two of the vertices adjacent to v, which must be the path going through
v. Each of those components has at least one leaf (or one isolated point) and is itself a tree.
Since v removed (at most) one edge incident to each resulting component, each component
has at least one leaf (or isolated vertex) which was also a leaf of G. So G has at least ∆
leaves. 

2.1.13 Prove that every graph with diameter d has an independent set with at least
d(1 + d)/2e vertices.

Proof. Consider a path of minimal length between two vertices u and v with d(u, v) = d. This
path has d + 1 vertices, all with the property that if they are not adjacent in the path, then
they are not adjacent in G. Then by alternating colors, one can two-color the vertices in the
path. The set which includes one or both endpoints (the independent set of a single color) is
of size dd + 1)/2e. 

1
2

2.1.40 Let G be a tree with k leaves. Prove that G is the union of paths P1 , . . . , Pdk/2e
such that Pi ∩ Pj 6= ∅ for all i 6= j.
P
Proof. Consider a collection of dk/2e paths {Pi } that cover the leaves of G. Consider i `(Pi ).
Suppose that there are two paths Pi (with endpoints ui and vi ) and Pj (with endpoints uj
and vj ) which do not intersect. Then the paths Qi from ui to vj and Qj from uj to vi together
have all the same edges as Pi and Pj , together with the edges on a path which connects Pi
Sdk/2e
to Pj . So `(Pi ) + `(Pj ) < `(Qi ) + `(Qj ). Also, if i=1 does not cover G, then since it does
Sdk/2e
cover the leaves, i=1 Pi must be disconnected, and therefore have some pair of paths which
are disjoint.
P
Now take a collection of dk/2e which maximizes i `(Pi ) (such a thing exists because G
Sdk/2e
is finite). Then by the above argument, i=1 Pi covers G and each of the paths pairwise
intersect. 

2.1.44 Prove or disprove: If a simple graph with diameter 2 has a cut-vertex, then its
complement has an isolated vertex.

Proof. Consider a vertex u which is not adjacent to every other vertex in V (G) (and therefore
is not isolated in Ḡ). Let v be a vertex which is not adjacent to u. We will show that G − u
is connected (G is connected because diam(G) < ∞).
Let a ∈ V (G) − u. Then there is a path of length at most 2 from a to v. Since v is not
adjacent to u, that path cannot go through u. Therefore that path is an a, v path in G − u.
By transitivity, this implies that G − u is connected. So u is not cut. 

2.1.47 Diameter and radius

(a) Prove that the distance function d(u, v) on pairs of vertices of a graph satisfies
the triangle inequality: d(u, w) ≤ d(u, v) + d(v, w).

Proof. Consider a path P of minimal length from u to v and a path of minimal length Q
from v to w. Then there is a path from u to w in P ∪ Q of length at most `(P ) + `(Q).
This may not be a minimal length path from u to w, but it does bound d(u, w) above
by d(u, v) + d(v, w). 

(b) Use part (a) to prove that diam(G) ≤ 2rad(G) for every graph G.

Proof. Consider two anu vertices u and v, and let x be an element of the center (so
(x) = rad(G) is minimal). By (a),
d(u, v) ≤ d(u, x) + d(v, x) ≤ (x) + (x) = 2rad(G).

3

(c) For all positive integers r and d that satisfy f ≤ d ≤ 2r, construct a simple
graph with radius r and diameter d. (Hint: build a suitable graph with one cycle.)

Consider the lollypop, a cycle C2r with handle Pd−r attached at vertex x, with r ≤ d ≤ 2r.
If d = r, this is just the cycle, which has radius = diameter = r. By adding a path to x
of length less or equal to r, the eccentricity of x remain unchanged (the farthest vertex
is still on the other side of the cycle). However, the end of the handle is d − r father
away from the antipode of x, and so is d − r + r = d away from x. Since anything closer
in on the handle and anything closer in the cycle both have smaller eccentricities than
these two vertices, d is the new diameter.

=3+4
=3+4
x

2.1.62 Let G be a connected graph with n vertices. Define a new graph G0 having one
vertex for each spanning tree of G, with vertices adjacent in G0 if and only if
the corresponding trees have exactly n(G) − 2 common edges. Prove that G0 is
connected. Determine the diameter of G0 . (an example is given in the book)

Proof. Consider two spanning trees T and T 0 of G, and say the differ by 2m edges. Let e be
in T and not in T 0 . Then there is an edge e0 of T 0 not in T so that T 00 = T 0 + e − e0 is also a
spanning tree. Since T 0 differs from T 00 by 2m − 2, we can recursively generate a path in G0
from T to T 0 .
Moreover, this path is length at most m, so the diameter of G0 cannot be any greater than
e(G) − (n(G) − 1) because T 0 cannot differ from T by more edges than G − E(T ). Also, the
diameter cannot be any larger than n(G) − 1 since e(T ) = e(T 0 ) = n(G) − 1. 

2.1.68 Can the graph below be decomposed into edge-disjoint spanning trees? Into
isomorphic edge-disjoint spanning trees?

Yes! You can start thinking about it this way: you have nine vertices, so any spanning tree is
going to need 8 edges. Since there are 16 edges in G, there is some hope. In fact, you know
that if you remove the edges of any spanning subgraph from G, if you can manage to keep
the result connected, what remains will be a spanning tree too! Next, since there are two
vertices of degree 2, those had better be leaves in both of the disjoint spanning trees.
A naive first try, starting at one of those degree-two vertices and drawing a long path that
ends at the other degree two vertex works!
4

To get two which are isomorphic, we’re going to have to be better about exploiting the
symmetry of the graph. I started with these two pictures:

Then I tried to keep one the 180◦ rotation of the other:

Result:

2.2.1 Determine which trees have Prüfer codes that


(a) contain only one value,

Answer: The star (there is only one internal vertex).

(b) contain exactly two values,

Answer: A tree with two internal vertices u, v (they must be adjacent, and T · uv is a
star).
5

(c) have distinct values in all positions.

Answer: The path (every vertex appearing in the list has degree 2, and there are exactly
2 missing).

2.2.8 Count the following sets of trees with the vertex set [n], giving two proofs for each:
one using the Prüfer correspondence and one by direct counting arguments.
(a) trees that have 2 leaves

Answer: n!/2. (1) There are 2 leaves, so these are the lists with n − 2 distinct values. So
pick two values not in the list ( n2  ways), and how to rearrange the n − 2 distinct values


in the list ((n − 2)! ways. But n2 ∗ (n − 2)! = 12 n(n − 1)(n − 2)! = 21 n!. (2) These are
paths, so there are n! ways of rearranging the vertices, which double-counts the reflection
of the path.

(b) trees that have n − 2 leaves

Answer: 21 n(n − 1)2n−2 . (1) These are lists with exactly two values, since there are 2
non-leaves. Pick a first value, then a second. Then for each element of the list of length
n − 2, decide which of the two values it is. This will double count swapping the first and
second chosen values. (2) If there are n − 2 leaves, then there are 2 internal vertices. Put
one on the left and one on the right. Then from the remaining vertices, decide whether
they’re adjacent to the left vertex or not (if not, they’re adjacent to the right). Divide by
two, since this double counts exactly the horizontal flip.

2.2.3 Let G be the graph below. Use the Matrix Tree Theorem to find a matrix whose
determinant is τ (G).

4 3

1 2
6

Answer:
     
8 0 4 1 3 8 −4 −1 −3
 6  4 0 2 0 −4 6 −2 0 
D=  and A =   so Q=
−1 −2 5 −2

 5  1 2 0 2
5 3 0 2 0 −3 0 −2 5

So, for example


     
6 −2 0 8 −4 −1 −4 −2 0
τ (G) = det −2 5 −2 = det −1 −2 5  = − det −1 5 −2 = 106
0 −2 5 −3 0 −2 −3 −2 5

2.2.10 Compute τ (K2,m ). Also, compute the number of isomorphism classes of spanning
trees of K2,m .

1 2 3 4 ··· m

m+1

Answer. Method 1: Since any spanning tree T must be connected, there has to be some
minimal path from 0 to m + 1. Since T is acyclic, there can only be one such path. Pick a
vertex amongst {1, . . . , m} for the unique path to go through. For every other vertex, pick
one edge (connecting to 0 or m + 1). This gives m ∗ 2m−1 spanning trees.

Each one of the resulting trees looks like

0 m+1

There are d m−1


2 e isomorphism classes of these ([1 and m−2 leaves]+[2 and m−3 leaves]+· · · ).

Method 2: Using the formula τ (G) = τ (G − e) + τ (G · e), the number of spanning trees of
K2,m is the same as the sum of the number of spanning trees for the two graphs
7

1 2 3 4 ··· m 1 2 3 4 ··· m

m+1 m+1

The one on the left has the same number of spanning trees at K2,m−1 . The one of the right
simplifies again to the sum of the number of spanning trees for the two graphs

1 2 3 4 ··· m

1 2 3 4 ··· m

m+1

Again, the graph on the left is K2,m−1 . The graph on the right is a an m-start with doubled
edges. So
τ (K2,m ) = 2τ (K2,m−1 ) + 2m−1 .
Using induction, you can see that n2n−1 satisfies this recursion relation.
Fun fact: if you have a recursion relation that you can’t seem to work out on your own, you
can work out the first few cases on your own and plug those first few values into the Online
Encyclopedia of Integer Sequences (http://oeis.org/). For example, when m = 1, K2,1 = P2 .
So
τ (K2,1 ) = 1, τ (K2,2 ) = 2 ∗ 1 + 21 = 4, τ (K2,3 ) = 2 ∗ 4 + 22 = 12,
τ (K2,4 ) = 2 ∗ 12 + 23 = 32, τ (K2,5 ) = 2 ∗ 32 + 24 = 80, . . .
Try plugging in 1,4,12,32,80 into the OEIS.
To count isomorphism classes, notice that in the recursion, we’re implying that at some step
I’m taking a tree from a doubled star (where some pair of edges incident from the middle
vertices are chosen for the tree – those were the contracted edges which caused the doubled
star), and all other middle vertices were adjacent to exactly one of the vertices from the
partite of size 2. See above.

2.2.23 Prove that if the Graceful Tree Conjecture is true and T is a tree with m edges,
then K2m decomposes into 2m − 1 copies of T . (Hint: Apply the cyclically invariant decom-
position of K2m−1 for trees with m − 1 edges from the proof of Theorem 2.2.16.)
8

Proof. Let T 0 = T − v where v is some leaf of v. Decompose the complete graph G on [2m − 1]
into 2m − 1 copies of T 0 . Each vertex in G is represented by the neighbor of v in T exactly
once in this decomposition, so the complete graph on [2m] can be built by adding one edge
from that neighbor to vertex 2m for each copy of T 0 . This presents a decomposition of K2m
into 2m − 1 copies of T . 

2.2.31 An up-down labeling is a graceful labeling for which there exists a critical value
α such that every edge joins vertices with labels above and below α. Prove that
ecery caterpillar has an up-down labeling. Prove that the 7-vertex tree that is
not a caterpillar has no up-down labeling.

Proof.
(1) Caterpillars have up-down labelings. Order the vertices of the spine (vertebrae)
from left to right, noting that the endpoints are leaves. We’ll show that there’s an up-down
labeling so that the right-most vertebrae is labeled with a 0, by induction on the number k
of vertebrae.
Base case: If k = 2, the caterpillar is P2 , which trivially has up-down labeling with α = 21 .
Put the 0 on the right.
Induction hypothesis: Any caterpillar with spine of length k has an up-down labeling with
the right-most vertex labeled with 0.
Induction step: Let G be a caterpillar with spine of length k + 1. Consider the second to last
vertebrae on the right v, and let G0 be the subgraph induced by deleting all of the leaves
adjacent to v (except possibly one if G is a star). G0 is a caterpillar with spine of length k,
so by the induction hypothesis has an up-down labeling with a 0 on v; let α0 be the critical
value of that labeling. Now label G as follows:
(a) label the deleted leaves with 0, 1, . . . , d(v) − 2 (there are d(v) − 1 leaves), and
(b) for every vertex of G also in G0 , if a0 is the label in G0 , replace with the label a =
n(G) − 1 − a0 .
For example,
G0 −→ G
7 8 4 9 0 5 4 8 3 12 0

6 5 3 2 1 6 7 9 10 11 1 2
α0 = 7.5 α = 4.5
n0 = 10 n = 13
Claim: This labeling of G is an up-down labeling with α = n(G) − 1 − α0 .
First, this labeling is graceful since the edge differences in G0 are fixed by their relabelings
(|(n−1−a0 )−(n−1−b0 )| = |a0 −b0 |), and so lend differences 0, 1, . . . , n0 −1 = n−(d(v)−2)−1 =
n+d(v)+1. The differences contributed by the new leaves are n−1, n−2, . . . , n−(d(v)−2) =
n − d(v) + 2. So the new labeling is graceful.
9

Take any two vertices in G0 . They are labeled in G0 with labels a0 , b0 so that
a0 < α0 < b0 , so a = n − 1 − a0 > n − 1 − α0 > n − 1 − b0 = b.
Therefore every edge joining two vertices in V (G0 ) have the up-down property (that one label
in G is above α = n − 1 − α0 and one is below). Furthermore, the largest label applied to the
new vertices is d(v) − 2, so since n = n0 + d(v) − 1 and 0 < α < n0 − 1, we have
d(v) − 2 < n − 1 − α0 < n − 1
so all of the new leaves in G also have the up-down property.
(2) Y does not have and up-down labeling. Let’s show by contradiction and suppose Y does
have an up-down labeling with critical value α. Without loss of generality, suppose the center
vertex has label less than α. Then the three adjacent to the center vertex are greater than α
and the three leaves are less. So {0, 1, 2, 3} cover the middle and the leaves and 3 < α < 4.
In order for some edge difference to be 1, this means that 3 ↔ 4. Also, since there has to be
an edge difference of 6, 6 ↔ 0. So we either have
y 0
6 6
0 x
4 5 4 5
3 x 3 y
or
In either case, there is no way to assign 1 and 2 to x and y so that the labeling is graceful. 

2.2.33 Let T be an orientation of a tree such that the heads of the edges are all distinct;
the one vertex that is not a head is the root. Prove that T is a union of paths
from the root. Prove that for each vertex of T , exactly one path reaches it from
the root.

Proof. Let r be the root in T and let T 0 be the tree without the orientation. For any vertex
u in T , there is a unique r, u path P in T 0 . The last vertex reachable along P from r in T is
the first vertex from which there is no arrow out of v after v in P ; but the edge preceding v
in P pointed in to v, so v = u. Furthermore, P is the only such path because an r, u-path in
T is an r, u-path in T 0 .
Since every vertex is reachable from a r, u path, and T 0 is acyclic, T is the union of all of
these paths. 

2.3.2 Prove or disprove: if T is a minimum-weight spanning tree of a weighted graph


G, then a u, v-path in T is a minimum-weight u, v-path in G.

Answer. This is false. Consider the three cycle with weights 2, 2, and 3.
10

u
2 2
v w
3

The minimal spanning tree is the set of edges uv and uw, but the minimal v, w path is along
the edge vw.
2.3.4 In the graph obtained from K5 by deleting two non-incident edges, assign weights
(1, 1, 2, 2, 3, 3, 4, 4) to the edges in two ways: one way so that the minimum-weight
spanning tree is unique, and another way so a minimum-weight spanning tree is
not unique.

Unique:
v2
1
v3
1 3
4 v1
2
2
3
v4
4
v5

Non-unique:
v2 v2
1 1
v3 v3
1 2 1 2
4 v1 4 v1
2 2
3 3
3 3
v4 v4
4 4
v5 v5

2.3.10 Prim’s Algorithm grows a spanning tree from a given vertex of a connected
weighted graph G, iteratively adding the cheapest edge from a vertex already
reached to a vertex not yet reached, finishing when all the vertices of V (G) have
been reached. (Ties are broken arbitrarily.) Prove that Prim’s Algorithm pro-
duces a minimum-weight spanning tree of G.
11

Proof. Since G is connected, the algorithm terminates when every vertex is covered, and each
step covers a new vertex with one new edge. So the result is a connected graph with n vertices
and n-1 edges, and is therefore a tree.
Now suppose T is the result and T ∗ is a minimum spanning tree. Let e be the first edge
added to T which is not in T ∗ , and let S be the set of vertices added to T up until this point.
Say e has endpoints u in S and v not in S. Then not only does T ∗ + e have a cycle, but that
cycle is created by the two paths that now exist from u to v (there was a unique u, v path in
T ∗, and now there’s the one along e). So there is some edge e∗ in that cycle which is incident
to exactly one vertex S; since e is amongst the cheapest edges incident to exactly one vertex
in S, w(e) ≤ w(e∗ ), and so T ∗ − e + e∗ is a spanning tree with weight less than or equal to
that of T ∗ (and therefore equal to) with one more edge in common with T . By iteration, we
find that wt(T ) = wt(T ∗ ) and is therefore a minimum. 

Вам также может понравиться