Assignment2-Discrete Maths, Schemes and Mind Maps of Discrete Mathematics

Assignment2-Discrete Maths BTEC

Typology: Schemes and Mind Maps

2018/2019

Uploaded on 02/23/2022

nguyen-hanh
nguyen-hanh 🇻🇳

5

(5)

3 documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PROGRAM TITLE: Btec-Computing
UNIT TITLE: Unit 18 - Discrete Maths
ASSIGNMENT NUMBER: 02
ASSIGNMENT NAME: ASSIGNMENT 2 - Graph theory
SUBMISSION DATE: Nov 28, 2021
TUTORIAL LECTURER: Lưu Thị Hương Giang
WORD COUNT: 1577.
STUDENT NAME: Nguyễn Bích Hạnh
STUDENT ID: BKC 1985
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Assignment2-Discrete Maths and more Schemes and Mind Maps Discrete Mathematics in PDF only on Docsity!

PROGRAM TITLE: Btec-Computing UNIT TITLE: Unit 18 - Discrete Maths ASSIGNMENT NUMBER: 02 ASSIGNMENT NAME: ASSIGNMENT 2 - Graph theory SUBMISSION DATE: Nov 28, 2021 TUTORIAL LECTURER: Lưu Thị Hương Giang WORD COUNT: 1577. STUDENT NAME: Nguyễn Bích Hạnh STUDENT ID: BKC 1985

Summative Feedback: Internal verification:

A. CONTENT:

LO2: Analyse mathematical structures of objects using graph theory Part 1:

  1. Discuss using two examples on binary trees both quantitatively and qualitatively. a. Definition: Binary tree is a finite set of nodes that are empty or consist of a root node. In which, the tree data structure has at most two children, each node is called the left child node and the right child node. A recursive definition using only set theory concepts is that a binary (non-empty) tree is a tuple (L, S, R), where L and R are binary trees or the empty set and S is a single set containing the root. In other words, a binary tree is a non-linear data structure in which each node has at most two children. Tree connections can be called branches. According to graph theory, a binary tree as defined here are arborescences. Thus, binary tree can also be called bifurcating arborescence —a term that appears in some very old programming books, before modern computer science terminology prevailed. It is also possible to interpret a binary tree as an undirected, rather than a directed graph, in which case a binary tree is an ordered and binary trees always have rooted. A binary tree is a special case of an ordered binary tree, where k is 2. b. All nodes in a binary tree have three primary components:  Data  Pointer to left child  Pointer to right child c. Advantages of Binary Tree:  Searching in binary trees becomes faster.  The binary tree provides six paths.  Two of the six paths provide the sorted order of the elements.  The maximum and minimum elements can be selected directly.  It is used to traverse the graph and convert an expression to suffix and prefix forms.  An ideal way to go with the hierarchical way of storing data.  Reflect structural relationships that exist in the given data set.  Make insertion and deletion faster than linked lists and arrays.  A flexible way of holding and moving data.

 Are used to store as many nodes as possible d. Example Quantitative binary tree: Complete binary tree: In a complete binary tree, all the levels of a tree are filled entirely except the last level. In the last level, nodes might or might not be filled fully and which is filled from the left.  A complete binary tree is just like a full binary tree, but with two major differences:  All the leaf elements must lean towards the left. The last leaf element might not have a right sibling i.e. a complete binary tree doesn't have to be a full binary tree. Image Complete binary tree (https://www.geeksforgeeks.org/sideways-traversal-of-a-complete-binary- tree/ ) e. What is qualitative binary tree? A qualitative tree is a binary tree with internal nodes called splits and qualitatively constrained functions in the leaves. The splits define a partition of the state space into areas with common qualitative behaviour of the class variable. A split consists of a split attribute and a split value. f. Example Qualitative binary tree: Full Binary Tree: A full binary tree is also known as 2-tree in which every node other than the leaf nodes has two child nodes. It means all the leaf nodes should be at the same level and all other internal nodes should contain two child nodes each. In a full binary tree is a tree in which every node has either 0 or 2

min Q is used to store unprocessed vertices with their shortest path estimate est(v) as key values. Next it continuously extracts the minimum value u vertex (u) from min Q and stretches all the variable edges from u to any vertex in min Q. After one vertex is extracted from min Q and all Since all dilations through it are completed, the algorithm considers this vertex as processed and does not review it. The algorithm stops when the priority queue (min Q) is empty or when every vertex is checked exactly oncev

  1. Find the shortest path spanning tree for the weighted directed graph with vertices A, B, C, D, and E given using Dijkstra's algorithm Dijkstra’s algorithm solves the shortest path problem for a directed weighted graph with non-negative weights. As the weights are non-negative, consequently, it is assumed that w(e) ≥ 0 for all e ∈ E. Therefore, here are the shortest to every nodes: Shortest path to D: E – D, cost = 3. Shortest path to C: E – D – C, cost = 9. Shortest path to B: E – D – A – B, cost = 7. Shortest path to A: E – A, cost = 5. Part 3: Check whether the following graphs have an Eulerian and/or Hamiltonian circuit. i.

The above graph does not contain any Hamiltonian or Eulerian circuits, because: -There is no Hamilton because the graph has a vertex of degree 1. -There is no Eulerian because the graph has odd degrees. ii. The graph above does contains Hamilton circuit but no Eulerian circuits.

  • There is no Eulerian because the graph has odd degrees.
  • There is Hamilton in the graph because it is possible to follow exactly each vertex and can cover the entire graph. iii.
  1. 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 (such as millage of the vehicle, etc.) as much as you can. Essentially consider the two fold, • Routes with shortest distance(Quick route travelling by own vehicle) • Route with the lowest cost
  2. Determine the minimum number of separate racks needed to store the chemicals given in the table (1st column) by considering their incompatibility using graph coloring technique. Clearly state you steps and graphs used. B. REFERENCES: (https://en.wikipedia.org/wiki/Binary_tree, https://www.upgrad.com/blog/binary-tree-in-data-structure/ ) (https://www.programiz.com/dsa/complete-binary-tree , https://www.programiz.com/dsa/full-binary- tree )