Solutions for HW9 Exercise 28. (a) Draw C 6, W6 K6, and K5,3

Solutions for HW9
Exercise 28. (a) Draw C6 , W6 K6 , and K5,3 .
Solution:
C6 :
W6 :
K6 :
K5,3 :
(b) Which of the following are bipartite? Justify your answer.
Solution:
Bipartite: put the red vertices in V1 and the black in V2 .
Bipartite: put the red vertices in V1 and the black in V2 .
Not bipartite!
Consider the three vertices colored red. For the sake of contradiction, assume that it is bipartite.
Pick any one of them to be in V1 . That would force the other two to be in V2 . But they are
adjacent, which is a contradiction.
(c) Hypercubes are bipartite.
(i) The following is the 4-cube:
0011
0111
1011
1111
0010
1010
0000
1000
0110
1110
0100
1100
0001
1001
0101
1101
Shade in the vertices that have an even number of 0’s. Explain why the 4-cube is bipartite.
Solution: None of the shaded vertices are pairwise adjacent. None of the non-shaded
vertices are pairwise adjacent. So put all the shaded vertices in V1 and all the rest in V2
to see that Q4 is bipartite.
(ii) Explain why Qn is bipartite in general.
[Hint: consider the parity of the number of 0’s in the label of a vertex.]
Solution: Any two vertices with an even number of 0’s differ in at least two bits, and so
are non-adjacent. Similarly, any two vertices with an odd number of 0’s differ in at least
two bits, and so are non-adjacent. So let V1 = { vertices with an even number of 0’s }
and V2 = { vertices with an odd number of 0’s }.
676
10 / Graphs
In Exercises 19–21 find the adjacency matrix of the given
directed multigraph with respect to the vertices listed in alExercise
29.order.
phabetic
19.
35.
v2
u2
v1
20.
a
v3
b
b degree sequences. Then are they isomorphic?. If not,
(a) For each of the following
pairs,a list their
u1
u3
why? If yes, give an isomorphism.
(i)
u5
21.
(ii)
c
v1
d v2
v3
b
c
u3
v5
u4
36. u1
u2
v1
u1
u3
v1
v5
u5
u2
v4
v5
u5
u1
v2
v5
v4
v4
v3
deg seq: 2,2,2,2,2
Isomorphic:
In Exercises
22–24 draw the graph represented by the given
adjacency matrix.
⎤
⎡
⎤
7→⎡v2 , u3 ⎤
7→ v24.
4, ⎡
22. u11 7→0 v11, u223.
1 2 1
0 2 3 0
⎢
⎥
⎣
⎦
⎣
⎦
⎢ 1 2 2 1⎥
u401 7→01 v511, u5 7→ v02 3 20 20
⎣2 1 1 0⎦
1 0 0 2
25. Is every zero–one square matrix that is symmetric and
(iii)
has zeros on the diagonal the adjacency matrix of a simple graph?
v2
u
v3
u4
u3
u4
deg seq:
2,2,2,1,1
c
d
v4
v2
u2
d
u4
a
u5
u
1
2
26. Use
an incidence
matrix to represent the graphs in Exercises 1 and 2.
v1
37.
v1
u1
u2
Isomorphic:
u4 7→ v2 , u5 7→ 4.
u6
v3
v6
u4
u5
(iv)
38. u1
u2
v1
v3
v2
v5
v3
u5
39. Deg
u4
u3
v4
u1
seq:
4,4,3,3,2v1
u6
v2
u2
30. What is the sum of the entries in a row of the incidence
Right
deg seq: 4,3,3,2,2.
matrix for an undirected graph?
Isomorphic:
31. Not
What isomorphic:
is the sum of the entries
in a column
of the
incidence
different
deg
seq’s.
matrix for an undirected graph?
u3 7→ v2 , u2 7→ v3 , u4 7→ v5
∗ 32. Find an adjacency matrix for each of these graphs.
b) Cn
c) Wn
d) Km,n
e) Qn
a) Kn
∗ 33. Find incidence matrices for the graphs in parts (a)–(d) of
Exercise 32.
(v)
In Exercises 34–44 determine whether the given pair of graphs
u2
v2
is isomorphic. Exhibit
an isomorphism or provide
a rigorous
argument that none exists.
34.
u1
u3
u1
u2
u3
u5
u4
v1
u5
u4
u5
v1
v4
v5
u5
27. Use an incidence
matrix to represent the graphs in Exercises 13–15.
∗ 28. What
u4
is theusum
of the entries in a row of the adjacency
3
v5
matrix for an undirected graph?
For va4directed graph?
∗ 29. What is the sum of the entries in a column of the adjacency
Left
3,3,3,3,2;
matrixdeg
for anseq:
undirected
graph? For a directed graph?
v2
v
uu17 7→ v1 , u2 7→ vu33, u3 →
7 7 v5
v5
v6
3
uu15 7→ v1 , u5 u7→
v4
v4
u4
v3
40.
v1
u1
v2
u2
v3
v2
u3
u6
v6
v3
v3
v
v45
v5
v4
v5
Deg seq: 3,3,2,2,2,2
Not isomorphic:
Right has a 3-cycle; Left doesn’t.
u5
u4
v5
v4
(b) How many isomorphism classes are there for simple graphs with 4 vertices? Draw them.
Solution:
(c) How many edges does a graph have if its degree sequence is 4, 3, 3, 2, 2? Draw a graph with
this degree sequence. Can you draw a simple graph with this sequence?
Solution: By the handshake lemma,
2|E| = 4 + 3 + 3 + 2 + 2 = 14.
So there are 7 edges. Here is an isomorphism class of simple graphs that has that degree
sequence:
(d) For which values of n, m are these graphs regular? What is the degree?
(i) Kn
(ii) Cn
(iii) Wn
(iv) Qn
(v) Km,n
Solution:
(i) Kn : Regular for all n, of degree n − 1.
(ii) Cn : Regular for all n, of degree 2.
(iii) Wn : Regular only for n = 3, of degree 3.
(iv) Qn : Regular for all n, of degree n.
(v) Km,n : Regular for n = m, n.
(e) How many vertices does a regular graph of degree four with 10 edges have?
Solution: By the handshake theorem,
2 ∗ 10 = |V | ∗ 4
so |V | = 5.
(f) Show that every non-increasing finite sequence of nonnegative integers whose terms sum to an
even number is the degree sequence of a graph (where loops are allowed). Illustrate your proof
on the degree sequence 7,7,6,4,3,2,2,1,0,0. [Hint: Add loops first.]
Solution: For a degree sequence d1 , d2 , . . . , dn , draw one vertex vi for each degree di , and
attach bdi /2c loops attached to vi . Then for each i for which di is even, vi so far had degree di .
For the i for which di is odd, vi currently has degree di − 1. Since the terms sum to an even
number, there must be an even number of i for which di is odd; pair these i’s up: the first with
the second, the third with the fourth, and so on. Now draw an edge between all such paired
vertices. The resulting graph has the appropriate degree sequence.
(g) Show that isomorphism of simple graphs is an equivalence relation.
Solution:
(a) Reflexive: the identity map on vertices is an isomorphism of a graph to itself.
(b) Symmetric: If f is an isomorphism f : G1 → G2 , then f : V1 → V2 is bijective, and
therefore has an inverse. Since f preserves adjacency, so does f −1 . So f −1 : G2 → G1 is
an isomorphism.
(c) Transitive: If f : G1 → G2 and g : G2 → G3 are isomorphisms, then g ◦ f : G1 → G3 is an
isomorphism, since the composition of bijective and edge-preserving maps is bijective and
edge-preserving.
Exercise 30. (a) Consider the graph
a
d
b
c
G=
(i) Give an example of a subgraph of G that is not induced.
Solution:
a
H=
c
b
(ii) How many induced subgraphs does G have? List them.
Solution: There are 4 vertices, so there are 24 induced subgraphs:
a
d
b
c
d
b
a
c
d
d
c
a
c
b
a
b
b
a
d
a
a
d
c
c
c
b
c
b
a
d
b
d
and
∅
(iii) How many subgraphs does G have?
Solution: A graph with m edges has exactly 2m subgraphs with the same vertex set. So,
going through the induced subgraphs (the largest subgraph of G with each possible vertex
set), we get
24 + 2 + 22 + 22 + 23 + 1 + 1 + 2 + 2 + 2 + 2 + 1 + 1 + 1 + 1 + 1
subgraphs of G in total.
(iv) Let e be the edge connecting a and d. Draw G − e and G/e.
Solution:
a
a, d
d
G−e=
G/e =
b
c
b
c
(v) Let e be the edge connecting a and c. Draw G − e and G/e.
Solution:
a
a, c
d
G−e=
d
G/e =
b
c
b
(vi) Let e be an edge connecting d and c. Draw G + e.
Solution:
a
d
b
c
a
d
b
c
a
d
b
c
a
d
b
c
G=
(vii) Draw Ḡ.
Solution:
G=
(b) Show that
G=
is isomorphic to its complement.
Solution: Since
Ḡ =
the map
d 7→ a,
gives an isomorphism.
a 7→ c,
b 7→ d,
c 7→ b,
(c) Find a simple graph with 5 vertices that is isomorphic to its own complement. (Start with:
how many edges must it have?)
Solution: Since there are 10 possible edges, G must have 5 edges. One example that will work
is C5 :
∼
= Ḡ =
G=
Exercise 31.
(a) Draw the isomorphism classes of connected graphs on 4 vertices, and give the vertex and edge
connectivity number for each.
Solution:
κ=1
λ=1
κ=1
λ=1
κ=1
λ=1
κ=2
λ=2
κ=2
λ=2
κ=3
λ=3
(b) Show that if v is a vertex of odd degree, then there is a path from v to another vertex of odd
degree.
Solution: By the Handshake Theorem, every graph has an even number of odd degree vertices.
Notice that each connected component is an induced subgraph with the same degrees. So
each connected component also has an even number of odd degree vertices. So if a connected
component has an odd degree vertex, it must have two. So those two vertices are connected by
a walk.
(c) Prove that for every simple graph, either G is connected, or Ḡ is connected.
Solution: Suppose G is not connected. Let H1 , H2 , . . . , Hk be the connected components of G
(i.e. the subgraphs induced by each set of vertices determined by the connected components).
First, consider two vertices in different connected components in G: u ∈ Hi , v ∈ Hj , i 6= j.
Since u and v are in different connected components in G, they are certainly not adjacent; thus
u and v are adjacent in Ḡ, and therefore in the same connected component. Now consider
two vertices in the same connected component in G: u, v ∈ Hi . Since there is more than one
connected component in G, let w ∈ Hj , i 6= j. By our previous argument, u and v are both in
the neighborhood of w in Ḡ, and so u, w, v is a path in ¯(G). Thus u and v are connected in Ḡ.
Thus Ḡ is connected.
(d) Recall that κ(G) is the vertex connectivity of G and λ(G) is the edge connectivity of G. Give
examples of graphs for which each of the following are satisfied.
Let δ = minv∈V deg(v).
(i) κ(G) = λ(G) < minv∈V deg(v)
κ = λ = 1, δ = 2.
(ii) κ(G) < λ(G) = minv∈V deg(v)
κ = 1, λ = 2, δ = 2.
(iii) κ(G) < λ(G) < minv∈V deg(v)
κ = 1, λ = 2, δ = 3.
(iv) κ(G) = λ(G) = minv∈V deg(v)
Cycles of length 3 or more have κ = λ = δ = 2.
(e) For the following theorem, pick any of parts (ii)–(iv) and show (carefully!) that it’s equivalent
to part (i).
Theorem: For a simple graph with at least 3 vertices, the following are equivalent.
(i) G is connected and contains no cut vertex.
(ii) Every two vertices in V are contained in some cycle.
(iii) Every two edges in E are contained in some cycle, and G contains no isolated
vertices.
(iv) For any three vertices u, v, w ∈ V , there is a path from u to v containing w.
Solution: (ii) =⇒ (i): If every two vertices u and v are contained in some cycle, then there are
two internally disjoint u − v paths. Thus u and v are connectes, and the deletion of any third vertex
will not disconnect u from v. Thus κ(G) ≥ 2.
(i) =⇒ (ii): Assume κ(G) ≥ 2. Consider u, v ∈ V , and set d = d(u, v).
If d = 1, then u and v are adjacent. Since |V | ≥ 3, there is some w ∈ V distinct from u and v.
Since κ(G) ≥ 2, there is some u − w path P1 not containing v; similarly there is some w − v path
P2 not containing u. Let x be the first vertex on P1 which is also on P2 (since w is on both paths,
such a vertex exists). Then the walk from u on P1 to x, then on P2 to v, and finally back on the
edge vu, is a cycle containing u and v.
If d > 1, suppose that for any w ∈ V with d(u, z) < d, there is some cycle containing u and w.
Consider a minimal length u−v path, and let w be v’s neighbor on this path, so that d(u, w) = d−1.
By our inductive hypothesis, there is a cycle C containing u and w. Either C also contains v, in
which we also have a cycle containing u and v, or it doesn’t. If C does not contain v, then since
κ(G) ≥ 2, we also have a path P from v to u not containing w. Let x be the first vertex on P
which is also on C (since u is on P and C, x exists).
C
w
v
u
x
P
Then the walk from v along P to x, then along C away from w and toward u (if x = u, walk in
either direction), through u and around to w, and finally along the edge wv, is a cycle containing
u and v.
(iii) =⇒ (i): Consider u, v ∈ V . Since there are no isolated vertices in G, deg(u), deg(v) ≥ 1, so u
and v are each incident to at least one edge. Since |V | ≥ 3, there are then at least two edges. Since
every pair of edges are contained in a common cycle, a vertex incident to an edge must be incident
to at least two edges. Thus there are distinct edges e 6= f with e incident to u and f incident to
v. Since e and f are contained in some cycle, u and v are contained in that same cycle. So there
are two internally disjoint u − v paths. Thus u and v are connected, and the deletion of any third
vertex will not disconnect u from v. Thus κ(G) ≥ 2.
(i) =⇒ (iii): With G = (V, E, φ) and e, f ∈ E, define
d = d(e, f ) = min d(u, v).
u∈φ(e)
v∈φ(f )
Now assume κ(G) ≥ 2. Fix e, f ∈ E distinct and let d = d(e, f ). Choose u ∈ φ(e) and v ∈ φ(f )
with d(u, v) = d, and let u0 and v 0 be the other vertices incident to e and f , respectively.
First suppose d = 0 (so that e and f are incident to a common vertex). Since κ(G) ≥ 2, there is a
path P from u0 to v 0 not containing u = v. Then the walk from u0 along P to v 0 , then back along
f then e is a cycle containing e and f .
If d > 0, then assume that for all e 6= g ∈ E for which d(e, g) < d is contained in a cycle together with
e. Take a minimal-length path from u to v, and let w be v’s neighbor on P , so that d(u, w) = d − 1,
and so d(e, wv) = d − 1. By our inductive hypothesis, there is a cycle C containing e and wv. If v 0
is on C, then the walk along v 0 v, then along C away from v 0 and toward u, then on around to v 0 ,
is a cycle containing e and v 0 v. Otherwise, let P be a path from v 0 to u not containing v (which
exists since κ(G) ≥ 2). Let x be the first vertex on P which is also on C. Then the walk from v
along v 0 , then along P to x, then along C away from v and toward u, through on to v, is a cycle
containing e and f .
(iv) =⇒ (i): Let u, v ∈ V . For any w ∈ V distinct from u and v, assuming (iv) gives at least one
u − w path containing v. The initial walk from u to v on this path gives a u − v path not containing
w. So u and v are connected in G and in G − w. Thus κ(G) ≥ 2.
(i) =⇒ (iv): Assume κ(G) ≥ 2, let u, v, w ∈ V , and let d = d(u, w).
If d = 1, let P be a path from w to v not containing u (which exists because κ(G) ≥ 2). Then the
walk from u to w and then along P to v is a path from u to v containing w.
If d > 1, assume that for every x ∈ V with d(u, x) < d, there is a u − v path through x. Take a
minimal-length path from u to w, and let x be w’s neighbor on this path, so that d(u, x) = d − 1.
Then our inductive hypothesis guarantees a u − v path P containing x. If P also contains w, then
P is a u − v path containing w as desired. Otherwise, let P 0 be a path from w to u not containing
x. Let z be the first vertex on P 0 which is also on P (which is guaranteed since u is on both P and
P 0 ). If z sits between x and v on P , then the walk from u along P to x, then along xw, then along
P 0 to z, then continuing along P to v, is a u − v path containing w. Otherwise, z sits between u
and x on P , so that the walk from u along P to z, the backwards along P 0 toward w, up wx, and
then along P toward v is a u − v path through w.