You are on page 1of 7

PROGRAM TITLE: ……Discrete Math………………………………………

UNIT TITLE: ……Discrete Math……………………………………………….

ASSIGNMENT NUMBER: ……2……………………………

ASSIGNMENT NAME: ……Graph theory……………………………….

SUBMISSION DATE: ……December 18………………………………….

DATE RECEIVED: ………November 24…………………………………….

TUTORIAL LECTURER: ……………………………………

WORD COUNT: ……………1044………………………………..

STUDENT NAME: …Nguyễn Quốc An……………………………………………

STUDENT ID: ……BKC18348……………………………………………….

MOBILE NUMBER: ……0795179677………………………………………


Summative Feedback:

Internal verification:
LO2: Analyse mathematical structures of objects using graph theory

PART 1: Discuss using two examples on binary trees both quantitatively and qualitatively.

Binary Tree: Every component could only have two children.maximum number of nodes that can exist
at any level i is 2i. A binary tree is essential in a software program. One of the most common applications
of binary trees is in search algorithms. A binary tree is a type of data structure that is used to store
information. A nonlinear data structure is represented by a binary tree.

First example Quantitative binary tree:

Complete binary tree: The binary tree is comprehensive whether all stages are completely filled (save
potentially the last level, which has modules as far to the left as practicable). For example, maximum
nodes = 2h+1 - 1, minimum nodes = 2h and maximum height = log n
Second example Qualitative binary tree:

Full binary tree: Each nodes have both 0 and 2 children. Except for the leaf node, each node will have
exactly two children. Moreover, number of leaf nodes = number of internal node + 1. For example,
maximum nodes = 2h+1 – 1, minimum nodes = 2h + 1 and maximum height = (n - 1)/2

PART 2:

 State the Dijkstra's algorithm for a directed weighted graph with all non-negative edge
weights.

Dijkstra's algorithm, named after its originator, Dutch computer scientist "Edsger Dijkstra," was
published in 1959 and may be applied to a weighted graph. The graph can be both directed and
undirected. One requirement for applying the approach is that the graph have a nonnegative
weight on each edge.

Make a set sptSet that maintains track of the vertices in the shortest path tree.

All vertices in the input graph should be assigned a distance value. Set all distance values to
INFINITE. Assign a distance value of 0 to the source vertex to ensure that it is chosen first.

While sptSet does not contain all vertices.

Choose a vertex u that is not in sptSet and has a minimum distance value.

Include u to sptSet.
Update the distance value of all u's nearby vertices. Iterate through all nearby vertices to update
the distance values. If the total of the distance value of u and the weight of the edge u-v is less
than the distance value of v, then update the distance value of v.

 Find the shortest path spanning tree for the weighted directed graph with vertices A, B, C,
D, and E given using Dijkstra’s algorithm.

Start from E: First, from E to D cost 3 => E – D = 3 and from E to A cost 5 => E –A = 5. From D
there are 2 ways to go to B are to A or direct to B, so the shortest way is to B cost 7
=> E – D - B = 7. Finally, from D can go to C cost 9 => E –D – C = 9

The minimum spanning tree:


PART 3: Check whether the following graphs have an Eulerian and/or Hamiltonian circuit.

Graph 1: Has Eulerian: A-B-D-C-E

Graph 2: Has Hamiltonian: A-B-C-D-E-A

Graph 3: Has Eulerian: A-B-C-E-D


PART 4:

 Construct a proof for the five colours theorem for every planar graph.

Theorem: Each planar graph with n nodes could be coloured with a maximum of 5 colors. We
induct on n, the amount of vertices in a planar graph G, to prove using induction.

Base Case, P(n ≤ 5): Because G contains ≤ 5 nodes, the graph can also be filled with 5 different
colors.

Inductive step, P(n + 1): For example P(n) is true and prove P(n) is true with every planar
graph and n vertices.

As we know every planar graph include one vertex with deg(v) ≤ 5. Furthermore, let call this
vertex v in our graph G. While, discharge v and the excessing subgraph G’ can lead to assume P(n).

If deg(v) ≤ 4, to achieve an acceptable colouring, we can use 4 colors to represent all vertices
close to v and color 5 to show v itself. In contrast, if deg(v) = 5, we consider that all of the vertices
next to v are colored differently.

Hence proved.

 Discuss how efficiently Graph Theory can be used in a route planning project for a vacation
trip from Colombo to Trincomalee by considering most of the practical situations.
Essentially consider the two fold,
 Routes with shortest distance (Quick route travelling by own vehicle)
 Route with the lowest cost
 Answer: It is accomplished by initially scanning a graph, beginning at one point and
progressing through nearby nodes until the destination node is approached. The purpose of
route planning in particular is to find the shortest path to the destination. Moreover, the
primary goal is to eliminate path-request delaying while increasing overall effectiveness.
Weighted graphs and modifications of algorithms can also be used to determine optimal
paths, that is, routes with the shortest distance and the lowest possible cost. Weights on the
graph's edges are provided based on real-world characteristics, including weather
conditions and network capacity at the selected time. Finally, the two main challenges that
must be handled in this Graph Theory application are determining the combination of both
edges and comparing the distance between two alternative pathways with different edge
lengths.

You might also like