You are on page 1of 9

WUCT121

Discrete Mathematics

Graphs

Tutorial Exercises

Solutions

WUCT121 Graphs: Tutorial Exercise Solutions 1


Graphs
Question1 Let G = {V , E} be a graph. Draw a graph with the following specified
properties, or explain why no such graph exists.

(a) A graph having V = {v1 , v 2 , v 3 , v 4 , v 5 }, ; E = {e1 , e2 , e3 , e4 , e5 } , where

e1 = ( v1 , v 3 ) , e2 = ( v 2 , v 4 ) , e3 = ( v1 , v 4 ) , e4 = ( v 3 , v 3 ) and e5 = ( v 3 , v 5 ) .
How many components does G have?

v1 v2

e1 e2
e3

e4 v3 v4
e5 v5

G has one component.

(b) A connected graph having V = {v1 , v 2 , v 3 , v 4 , v 5 }, and ∀vi ∈V , δ ( v i ) = 2 .


How many edges does G have?

v1
e1 v2

e5
e2
v5
e4
e3
v4 v3

G has 5 edges

WUCT121 Graphs: Tutorial Exercise Solutions 2


Question2 Either draw a graph with the following specified properties, or explain
why no such graph exists:

(a) A graph with four vertices having the degrees of its vertices 1, 2, 3 and 4.

v1 v2
e1

e5 e2 e3

v4
v3

e4

(b) A simple graph with five vertices with degrees 2, 3, 3, 3, and 5.


It is impossible to draw this graph. A simple graph has no parallel edges nor any
loops. There are only 5 vertices, so each vertex can only be joined to at most four
other vertices, so the maximum degree of any vertex would be 4. Hence, you
can’t have a vertex of degree 5.

(c) A simple graph in which each vertex has degree 3 and which has exactly 6 edges.

v1 v2
e1

e5
e4 e2

e6

v4 e3 v3

WUCT121 Graphs: Tutorial Exercise Solutions 3


(d) A graph with four vertices having the degrees of its vertices 1, 1, 2 and 2.

v1 v2
e1

e2

e3

v4 v3

(e) A graph with four vertices having the degrees of its vertices 1, 1, 2 and 6.

v1 v2
e1

e2

e3
e4 e5
v4 v3

(f) A graph with five edges having the degrees of its vertices 1, 1, 3 and 3.
Not possible, number of edges is 5, thus the sum of the degrees of the vertices
4
must be 2 × 5 = 10 ∑ δ (vi ) = 1 + 1 + 3 + 3 = 8 ≠ 2 × 5
i =1

WUCT121 Graphs: Tutorial Exercise Solutions 4


Question3 Let G = {V , E} be the graph drawn below.

v2
e1 e2 v1
e5

e4
e3

v3

(a) Draw a sub-graph H = {V H , E H } of G for which ∑ δ (v) = 4 .


v∈VH

2 possibilities are:

e1 e2
v1
e2
v1 e5 v2

There are other possibilities.

(b) Draw a sub-graph H = {V H , E H } of G having 2 components, one vertex of even


degree and one pair of vertices of odd degree
2 possibilities are:

e1 v1 v2

e3

v3

WUCT121 Graphs: Tutorial Exercise Solutions 5


e2 v1
v2

e4

v3

There are other possibilities.

(c) Either write down a path with the specified properties, or explain why no such
path exists.

(i) A path of length 5 from v1 to v 2 .


One possible: v1 , e1 , v1 , e2 , v1 , e1 , v1 , e2 , v1 , e5 , v 2

(ii) A path of length 3 from v1 to v 3 .

One possible: v1 , e2 , v1 , e5 , v 2 , e3 , v 3

Question4

(a) Draw all spanning trees for K 3 .

v1

K3 e1
e3

v3 e2 v2

v1 v1 v1

e1 e1
e3 e3

v3 e2 v2 v3 e2 v2 v3 v2

WUCT121 Graphs: Tutorial Exercise Solutions 6


(b) Draw 8 different spanning trees for K 4 . It can be shown that there are n n −2
spanning trees for K n . Can you write down 16 spanning trees for K 4 ?

e1
v1 v2
e5
K4 e4 e2
e6
v4 v3
e3

e1 e1 e1
v1 v2 v1 v2 v1 v2 v1 v2

e2 e4 e2 e4 e4 e2

v4 v3 v4 v3 v4 v3 v4 v3
e3 e3 e3
e1 e1
v1 v2 v1 v2 v1 v2 v1 v2
e5 e5
e4 e2 e4 e2
e6 e6
v4 v3 v4 v3 v4 v3 v4 v3
e3 e3

e1
v1 v2 v1 v2 v1 v2 v1 v2
e5 e5 e5 e5
e4 e2
e6 e6 e6 e6
v4 v3 v4 v3 v4 v3 v4 v3
e3
e1 e1
v1 v2 v1 v2 v1 v2 v1 v2
e5 e5
e4 e2 e2 e4
e6 e6
v4 v3 v4 v3 v4 v3 v4 v3
e3 e3

WUCT121 Graphs: Tutorial Exercise Solutions 7


(c) Use Kruskal’s algorithm to find the minimum spanning tree for the following
weighted graph. Write down the number of steps you need to complete the
algorithm

v1 v2
2

2 1

v3 v4
3

Edge Weight Will adding Action taken Cumulative


edge make Weight of
circuit? Subgraph
e1 = (v1 ,v2 ) 1 No Added 1
e2 = (v2 , v4 ) 1 No Added 2
e3 = (v1 ,v3 ) 2 No Added 4
e4 = (v2 , v3 ) 2 Yes Not added 4
e5 = (v3 ,v4 ) 3 Yes Not added 4
e6 = (v1 ,v4 ) 3 Yes Not added 4

Minimum spanning tree is

v1 v2

v3 v4

The algorithm can be completed in 3 steps.

WUCT121 Graphs: Tutorial Exercise Solutions 8


WUCT121 Graphs: Tutorial Exercise Solutions 9

You might also like