Assignment 02 - Discrete Maths BTEC, Essays (university) of Discrete Mathematics

Assignment 02 - Discrete Maths in BTEC Higher National Diploma in Computing

Typology: Essays (university)

2020/2021

Uploaded on 07/12/2022

Vu-Nguyen-73
Vu-Nguyen-73 🇻🇳

4.2

(5)

7 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
0
PROGRAM TITLE: HIGHER NATIONAL DIPLOMA IN COMPUTING
UNIT TITLE: UNIT 18 DISCRETE MATHS
ASSIGNMENT NUMBER: 02
ASSIGNMENT NAME: GRAPH THEORY
SUBMISSION DATE:
DATE RECEIVED: …………………………………………….
TUTORIAL LECTURER:
WORD COUNT: ……………………………………………..
STUDENT NAME:
STUDENT ID:
MOBILE NUMBER:
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Assignment 02 - Discrete Maths BTEC and more Essays (university) Discrete Mathematics in PDF only on Docsity!

PROGRAM TITLE: HIGHER NATIONAL DIPLOMA IN COMPUTING

UNIT TITLE: UNIT 18 – DISCRETE MATHS

ASSIGNMENT NUMBER: 02

ASSIGNMENT NAME: GRAPH THEORY

SUBMISSION DATE:

DATE RECEIVED: …………………………………………….

TUTORIAL LECTURER:

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

STUDENT NAME:

STUDENT ID:

MOBILE NUMBER:

Summative Feedback:

Internal verification:

  • TABLE OF CONTENTS
  • PART
      1. Binary tree
      1. Complete binary tree
      1. Full binary tree
      1. Degenerate binary tree
      1. Example of a Qualitative binary tree
      1. Example of a Quantitative binary tree
  • PART
      1. Dijkstra's algorithm
    • C, D, and E was given using Dijkstra's algorithm 2. Find the shortest path spanning tree for the weighted directed graph with vertices A, B,
  • PART
    • Graph 1:
    • Graph 2:
    • Graph 3:
  • References
  • Figure 1: Complete binary tree TABLE OF FIGURES
  • Figure 2: Full binary tree
  • Figure 3: Degenerate binary tree
  • Figure 4: Weighted directed graph
  • Figure 5: Graph
  • Figure 6: Graph
  • Figure 7: Graph

PART 1

1. Binary tree

A tree whose elements have at most 2 children is called a binary tree. Since each element in a

binary tree can have only 2 children, we typically name them the left and right children.

(GeeksforGeeks, 2022)

2. Complete binary tree

A complete binary tree is another specific type of binary tree where all the tree’s levels are

filled with nodes, except the lowest level of the tree. Also, in the last or the lowest level of

this binary tree, every node should possibly reside on the left side

Figure 1 : Complete binary tree

3. Full binary tree

It is a special kind of binary tree that has either zero children or two children. It means that all

the nodes in that binary tree should either have two child nodes of its parent node or the

parent node is itself the leaf node or the external node.

6. Example of a Quantitative binary tree

Complete Binary Tree: A Binary Tree will become a Complete Binary Tree if all of its levels

are filled by nodes. But there might be an exception where the last level is not filled and has

all the keys as left as possible.

  • Its maximum node is: 2

h+

  • Its minimum node is: 2

h

  • Its maximum height is: log

PART 2

1. Dijkstra's algorithm

The Dijkstra algorithm is one of the basic algorithms used for pathfinding. The basic idea of

this algorithm is as follows:

  • Step 1: Firstly, create a set to keep track of all paths from the source to every node,

including the shortest path.

  • Step 2: Assign a distance value to all paths in the input graph. Initialize all distances as

INFINITE. Assign the distance value as 0 for the starting point so that it is picked first.

  • Step 3: Pick a node x next to the starting point, and update the distance from x to every

node next to it.

  • Step 4: Repeat the 3rd step until there are no nodes that can go directly from starting point
  • Step 5: Pick the node y from all the nodes you just found that have a minimum distance

from the starting point

  • Step 6: Repeat from the 3rd step but with every node next to node y just founded
  • Step 7: Update any distance that has a shorter path from the starting point

(GeeksforGeeks, 2021)

2. Find the shortest path spanning tree for the weighted directed graph with vertices A,

B, C, D, and E was given using Dijkstra's algorithm

Figure 4 : Weighted directed graph

Take point E as the starting point, we can analyze that path as follow. The blueish and bold

word means that the node is chosen because it has the minimum value in that row:

Step E A B C D

2 - ( 5 , E) (∞,-) (∞,-) (3, E)

3 - (2, D) (4, D) (6, D) ~

4 - ~ (4, D) (4, A) ~

5 - ~ (2, C) ~ ~

 After finishing drawing the table above to analyze our paths, we can conclude the shortest

path for this graph is S = { E, D, A, B, C }

 Graph 2.1 is not an Eulerian circuit because it cannot go through every edge without

repeating nor starts and ends at the same vertex.

 Graph 2 is a Hamiltonian circuit because it can go through every vertex without repeat

and ends at the same start point

Graph 3:

Figure 7 : Graph 3

 Graph 3 is not an Eulerian circuit because it cannot start and end at the same vertex, but it

can go through every edge once.

 Graph 3 is not a Hamiltonian circuit since it can’t go through every vertex once nor start

and end at the same vertex.

References

GeeksforGeeks, 2021. Dijkstra’s shortest path algorithm | Greedy Algo-7. [Online]

Available at: https://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-greedy-algo-7/

[Accessed 19 11 2022].

GeeksforGeeks, 2022. Binary Tree Data Structure. [Online]

Available at: https://www.geeksforgeeks.org/binary-tree-data-structure/

[Accessed 27 11 2021].