A3 GraphsTrees

You might also like

You are on page 1of 12

Name: NIM: Class:

Assignment 3: Graphs and Trees


Discrete Mathematics A (MSH2A3)
Second Term 2019-2020
Instructions:

1. This assignment is due Thursday April 16 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-1301191234.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. 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. This
assignment is an individual evaluation.

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

page 1 of 12
Problem 1 A simple graph is a graph that contains neither multiple parallel edges nor loops. A k-regular
graph is a simple graph whose every vertex has degree k.

(a). [5 points] Is there any 4-regular graph with six vertices? (That is, a simple graph with six vertices
and each vertex has degree 4.) If so, draw such a graph; if not, 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.

page 2 of 12
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 three from

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

(Hint: calculate A3G .)

page 3 of 12
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. One day, the govern-

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

ment 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.

page 4 of 12
Name: NIM: Class:

Problem 4 A village consists of eight houses labelled as a, b, c, . . . , h. The village is partitioned into two
conflicting region, region one contains the houses a, b, c, and d, and region two contains the houses e, f ,
g,and h. Alice who lives in house a plans to visit every house in the village. She wants to visit each house
once and return to her house. However, to avoid favoritism, she cannot visit the house in the same region
consecutively. As a result, she depicts her itinerary in Figure 3.

Figure 3: Graphs G (Alice’s itinerary).

(a). [5 points] Provide one example of Alice’s possible trips (the starting point is a and the trip ends at a
as well).

(b). [5 points] How many different possible trips are there?

page 5 of 12
Problem 5 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 4.

Figure 4: Graph K5 .

(a). [5 points] Determine the number of different spanning subgraphs of K5 that has four edges (i.e., the
subgraph of K5 with four 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; egg. 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.

page 6 of 12
Name: NIM: Class:

Problem 6 Bob works as a real estate developer. One day he faces following problems:

(a). [5 points] Bob needs to build five houses, labelled as H1 , H2 , . . . , and H5 . Each of the houses needs
to be connected with two utilities, namely gas (labelled as G) and electricity (labelled as L). Can
Bob connect these five houses to two utilities without connection crossing? If so, draw your design;
if not, justify your answer mathematically.

(b). [5 points] Suppose Bob’s supervisor asks him to add one more utility, namely water (labelled as W )
that needs to be connected with these five houses. Can Bob connect these five houses to three utilities
without connection crossing? If so, draw your design; if not, justify your answer mathematically.
(Hint: use Kuratowski’s theorem or Euler’s theorem for planar graph.)

page 7 of 12
Problem 7 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 vertex and a root. The
height of a rooted tree is the largest level that may exist in such 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.
In this problem, your task is to draw three non isomorphic full and balanced ternary trees of height
2. Explain way those trees are not isomorphic.

page 8 of 12
Name: NIM: Class:

Problem 8 Suppose G and H are two graphs in Figure 5.

Figure 5: 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 5 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.

page 9 of 12
Problem 9 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 10 of 12
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.

page 11 of 12
Problem 10 A computer network in a room consists of seven computers labelled as a, b, . . . , and g. The
network is illustrated in Figure 8. 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. Imagine you

Figure 8: Graph for computer network.

work as an engineer. Your boss thinks that some cables are unnecessary. He demands you to remove as
many cables as possible yet all computers are still connected. Provide a network that connects all computers
that minimizes the total cables’ length. Describe your algorithm and determine the minimum cables’ length.

(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.

page 12 of 12

You might also like