You are on page 1of 16

Name: NIM: Class:

Assignment CLO 3: Graphs and Trees


Discrete Mathematics (CII1G3)
Second Term 2021-2022
Instructions:

1. This assignment is due Friday, June 17, 2022 at 5:00 p.m.. Please submit your work to the correspond-
ing submission slot in LMS CeLOE. You need to submit a readable .pdf file of this assignment to the
provided submission slot in CeLOE. You can contact your class instructor for more detailed information.
Please make sure that your file size do not exceed the maximum file size allowed.

2. Please upload your assignment to the LMS CeLOE under the file name: A3-<student ID>.pdf,
for example: A3-1301218888.pdf.

3. You may submit this assignment in one the following form:

a. You print this assignment and write your answer using HB/2B pencil or pen with blue/black ink
(handwritten answer). You may add additional A4-sized papers. Afterwards you submit the scan/photograph
of this assignment.
b. You use a .pdf editing tools and write your answer directly using blue/black colored writing.
c. You copy the problem from this assignment to a text/word processing program and type your answer
neatly.
d. You rewrite the problem from this assignment in an A4-sized paper and submit the scan/photograph
of your work.

4. All problems in this assignment are adapted from the textbooks. The problems are written in English.
If you are a student in a regular class, you may answer the problems in Bahasa Indonesia. However,
if you are a student in international class, your answers must be written in English—otherwise your
assignment will not be graded. You may ask your class instructor or teaching assistant for helping you
understanding the problem, but you should not ask them to give the solution of any problem.

5. Be neat and write legibly. You will be graded not only on the correctness of your answers, but also on
the clarity with which you express them.

6. This assignment consists of 10 problems and each problem is worth 10 points.

7. Please retain yourself from copying answers from elsewhere without understanding the steps. Such an
attitude will not enhance your knowledge. This assignment is an individual evaluation.

8. Important: late submission without reasonable explanation will not be graded.

page 1 of 16
Problem 1 A simple undirected graph is an undirected graph with no parallel edges or loops. A k-regular
graph is a simple connected graph whose every vertex is of degree k:

(a). [5 points] Is there any 3-regular graph with six vertices? (That is, a simple graph with six vertices
and each vertex has degree 3.) If so, draw such a graph; otherwise, explain your answer

(b). [5 points] Is there any 3-regular graph with five vertices? (That is, a simple graph with five vertices
and each vertex has degree 3.) If so, draw such a graph; if not, explain your answer.

A NSWER :

page 2 of 16
Name: NIM: Class:

Problem 2 Suppose G is an undirected graph depicted in Figure 1.

Figure 1: An undirected multigraph G.

(a). [5 points] Construct the adjacency matrix of G (that is, the matrix AG ).

(b). [5 points] Determine the number of different paths of length five from

(i) a to b.
(ii) b to c.

(Hint: calculate A5G . An example of a path of length five from a to b is he1 ; e2 ; e1 ; e4 ; e4 i. You may
use the numpy library in Python to compute the matrix multiplication and exponentiation.)

A NSWER :

page 3 of 16
Problem 3 A region consists of nine villages labelled as a, b, c, . . . , i. The road network connecting them
can be represented using graph G in Figure 2. The vertices represent the villages while the edges denote
the road between two adjacent villages. Until recently, all roads are not yet paved.

Figure 2: Graph G representing a road network among nine villages in a region.

One day, the government plans to pave all roads in Figure 2. Nevertheless, the government can only
employ one construction company. To attain efficiency, the company aim to pave all roads continuously
without stopping (unless all roads have been paved). In addition, a road connecting two cities must be
paved once and the company do not want to traverse the road without paving it.

(a). Explain the solutions of the following problems clearly.

(i) [3 points] Is it possible to pave the roads in Figure 2 continuously without traversing the same
road twice if the construction must start and end at the same village? If so, provide the path;
if not, explain your reasoning.
(ii) [4 points] Is it possible to pave the roads in Figure 2 continuously without traversing the same
road twice if the construction can start and end at different villages? If so, provide the path;
if not, explain your reasoning.

(b). [3 points] A government representative plans to visit all villages in the region. He plans to begin his
journey from village a. To save time he plans to visit all villages exactly once and return to the initial
village (village a). Is this plan possible? If so, provide the path of his journey; otherwise explain your
reasoning.

A NSWER :

page 4 of 16
Name: NIM: Class:

Problem 4 The graph K5 is a simple undirected graph with five vertices in which every pair of different
vertices is connected by an edge. This graph is illustrated in Figure 3.

Figure 3: Graph K5 .

(a). [5 points] Determine the number of different spanning subgraphs of K5 that has five edges (i.e., the
subgraph of K5 with five edges which contains all the five vertices). An example of this subgraph is
G = (V; E) where V = fa; b; c; d; eg and E = ffa; bg ; fb; cg ; fc; dg ; fd; eg ; fe; agg. Express your
result as an integer!

(b). [5 points] Draw three non-isomorphic spanning trees of K5 . Explain why these trees are not isomor-
phic.

A NSWER :

page 5 of 16
Problem 5 In 2119, a nation in South East Asia holds a legislative election. Ten political parties, labelled
as P1 , P2 , . . . , P10 , obtain votes’ proportions more than the parliamentary threshold. As usual, parties with
similar interest and enmity are likely to form a coalition. In this problem, your task is to determine the
minimum number of possible coalitions given the conflict information among ten political parties.
Suppose the conflict relationships among political parties are described as follows:

P1 conflicts with P2 and P4 P6 conflicts with P4 , P7 , and P9

P2 conflicts with P1 , P3 , P4 , and P5 P7 conflicts with P4 , P5 , P6 , P8 , P9 , and P10

P3 conflicts with P2 and P5 P8 conflicts with P5 , P7 , and P10

P4 conflicts with P1 , P2 , P5 , P6 , and P7 P9 conflicts with P6 , P7 , and P10

P5 conflicts with P2 , P3 , P4 , P7 , and P8 P10 conflicts with P7 , P8 , and P9 .

The conflict relations are assumed to be symmetric: if Pi conflicts with Pj then Pj conflicts with Pi for
any i; j 2 f1; : : : ; 10g with i 6= j.

(a). [4 points] Complete the following simple graph in Figure 4 illustrating the conflicts relationship
among ten political parties. The set of vertices is V = fP1 ; P2 ; : : : ; P10 g which depicts the political
parties and two vertices Pi and Pj are connected by an edge if and only if Pi conflicts with Pj (or
Pj conflicts with Pi ), where i; j 2 f1; 2; : : : ; 10g and i 6= j. For instance, since P1 conflicts with P2
and P4 , we have the edges fP1 ; P2 g and fP1 ; P4 g. Similarly, since P2 conflicts with P1 , P3 , P4 , and
P5 , we have edges fP2 ; P1 g, fP2 ; P3 g, fP2 ; P4 g, and fP2 ; P5 g.

Figure 4: Simple graph G = (V; E) depicting conflicts relationship among political parties.

page 6 of 16
Name: NIM: Class:

(b). [1 point] Complete the following Table 1 regarding the degree of each vertex in G = (V; E). Re-
member that for v 2 V we have deg (v) = n if there are n edges incident to v. For example, for
G = (V; E) in Figure 4 we have deg (P1 ) = 2 and deg (P2 ) = 4.

v P1 P2 P3 P4 P5 P6 P7 P8 P9 P10
deg (v) 2 4

Table 1: Degree of the vertices in G.

(c). [5 points] Use Welsh-Powell algorithm to perform vertex coloring on the graph obtained in part (a).
Describe the process in tabular format (do not forget to sort the vertices based on their degrees). What
is the chromatic number of the graph G? (The chromatic number of G is the minimum number of
colors required to color all vertices of G so that no two adjacent vertices use the same color.) Draw
the resulting colored graph in Figure 5 and describe the possible coalitions among the political parties
(how many coalitions are there and what are the members of each coalition).

Figure 5: Colored version of the graph G = (V; E) in Figure 4.

A NSWER :

page 7 of 16
Problem 6 Salvador works as a project manager. He leads a team of programmers that consists of six peo-
ple: Alice, Bob, Carlos, David, Emma, and Fiona. Salvador wants them to work together, but unfortunately
some of his team members hate each other. Salvador doesn’t want his team members work individually
because it can slow down the projects. He plans to divide his team into smaller groups. From the most
recent information, Salvador knows that:
1. Alice hates everyone except David,
2. Bob hates everyone except Carlos and Emma,
3. Carlos hates Alice and Emma,
4. David hates Bob and Emma,
5. Emma hates everyone except Bob,
6. Fiona hates everyone except Carlos and David,
Two people who hate each other cannot be grouped together because it can hamper the project.

(a). [5 points] Complete the simple graph G = (V; E) in Figure 6 with V = fa; b; : : : ; fg that represents
the hatred among the programmers, where a represents Alice, b represents Bob, and so on. Two
vertices are adjacent if and only if two people hate each other. We assume that hatred is symmetric,
i.e., if person x hates person y, then person y also hates person x. For example, since David hates
Bob and Emma, we have edges fb; dg and fd; eg.

Figure 6: Graph representing hatred among six programmers.

page 8 of 16
Name: NIM: Class:

(b). [5 points] Use Welsh-Powell algorithm to perform vertex coloring on the graph obtained in part (a).
Is it possible to use each color at least twice? (That is, for each color, there are at least two vertices of
the same color.) Describe the process in tabular format. Draw the resulting colored graph in Figure
7. What is the chromatic number of the graph G? (The chromatic number of G is the minimum
number of colors required to color all vertices of G so that no two adjacent vertices use the same
color.) Is it possible to group the programmers according to the above-mentioned conditions and no
programmer works individually? If so, provide an example of the grouping (determine the member
of each group); otherwise, explain why the grouping is impossible.

Figure 7: The vertex coloring result of graph G in Figure 6.

A NSWER :

page 9 of 16
Problem 7 Suppose G and H are two graphs in Figure 8.

Figure 8: Graph G (left) and graph H (right).

(a). [2 points] Construct AG (the adjacency matrix of G) and AH (the adjacency matrix of H), each with
row and column labels a; b; : : : ; f (for G) and p; q; : : : ; u (for H), respectively. Write the matrices
carefully with correct notation. No partial credits for wrong answer.

(b). [2 points] Construct the adjacency lists of G and H. Write the lists carefully. No partial credits for
wrong answer.

(c). [3 points] Determine whether graph H in Figure 8 is planar or not (i.e., whether H can be drawn
without edges crossing or not). If so, redraw H so that no edges cross; otherwise, explain your answer
mathematically.

(d). [3 points] Determine whether G and H are isomorphic. Exhibit an isomorphism or provide a rigorous
argument that none exist. If the graphs are isomorphic, show that we can rearrange the vertices of
H so that AG = A0H , where A0H is the adjacency matrix of H with a particular rows and columns
relabeling.

A NSWER :

page 10 of 16
Name: NIM: Class:

A NSWER :

page 11 of 16
Problem 8 A rooted tree is called a full m-ary tree if its root and internal vertices have exactly m children
(each of them has precisely m children). If m = 3, then the tree is called as a full ternary tree. The level of
a vertex in a full m-ary tree is the number of edges on a unique path between such a vertex and a root. The
height of a rooted tree is the largest level that may exist in such a tree. An m-ary rooted tree with h levels
is called a balanced m-ary tree if all of its leaves are at level h or h 1.

(a). [5 points] A leaf in a rooted tree is a node that has no child. Draw (if any) an example of a full and
balanced ternary tree of height 3 with eleven leaves.

(b). [5 points] Determine the height of a full and balanced ternary tree that has 241 leaves.

A NSWER :

page 12 of 16
Name: NIM: Class:

Problem 9 A computer network in a room consists of seven computers labelled as a, b, . . . , and g. The
network is illustrated in Figure 9. The vertices represent the computers and the edges are the optical cables
that connect them. The length (in feet) of each cable that connects two computers is depicted as a number
assigned to it. For instance, the length of the cable that connects computer a and b is 2 feet.

Figure 9: Graph for computer network.

(a). [5 points] Use Prim’s algorithm to find the configuration. Describe the iterations in tabular format,
calculate the total cables’ length, and draw the resulting network.

(b). [5 points] Use Kruskal’s algorithm to find the configuration. Describe the iterations in tabular format,
calculate the total cables’ length, and draw the resulting network.

A NSWER :

page 13 of 16
A NSWER :

page 14 of 16
Name: NIM: Class:

Problem 10 A computer network in a room consists of nine computers labelled as a, b, . . . , and i. The
network is illustrated in Figure 10. The vertices represent the computers and the edges are the optical cables
that connect them. The length (in feet) of each cable that connects two computers is depicted as a number
assigned to it. For instance, the length of the cable that connects computer a and b is 3 feet.

Figure 10: Graph for computer network.

(a). [5 points] Use Prim’s algorithm to find the configuration. Describe the iterations in tabular format,
calculate the total cables’ length, and draw the resulting network.

(b). [5 points] Use Kruskal’s algorithm to find the configuration. Describe the iterations in tabular format,
calculate the total cables’ length, and draw the resulting network.

A NSWER :

page 15 of 16
A NSWER :

page 16 of 16

You might also like