You are on page 1of 5

Essay Assignment

Discrete Mathematics in Real Life

CREATED BY :

MEMBER : AKHMAL DIMAS PRATAMA 123200047


RADIVAN ALAN NOURUZZAMAN 123200072
HAIDARRACHMAN GUSTAVIAN RAHARDJO 123200075
CLASS : H

PROGRAM STUDY INFORMATICS


DEPARTMENT INFORMATICS ENGINEERING
FACULTY OF INDUSTRIAL ENGINEERING
UNIVESITY OF PEMBANGUNAN NASIONAL “VETERAN” YOGYAKARTA
2021
Graph Teory

Graph is a mathematical representation of a network and it describes the


relationship between lines and points. A graph consists of some points and lines
between them. The length of the lines and position of the points do not matter. Each
object in a graph is called a node.

A graph ‘G’ is a set of vertex, called nodes ‘v’ which are connected by edges,
called links ‘e'. Thus G= (v , e).

Vertex (Node): A node v is an intersection point of a graph. It denotes a location such


as a city, a road intersection, or a transport terminal (stations, harbours, and airports).

Edge (Link): An edge e is a link between two nodes. A link denotes movements
between nodes. It has a direction that is generally represented as an arrow. If an arrow
is not used, it means the link is bi-directional.

Graphs are ubiquitous in computer science because they provide a handy way
to represent a relationship between pairs of objects. The objects represent items of
interest such as programs, people, cities, or web pages, and we place an edge between
a pair of nodes if they are related in a certain way. For example, an edge between a
pair of people might indicate that they like (or, in alternate scenarios, that they don’t
like) each other. An edge between a pair of courses might indicate that one needs to
be taken before the other.

Binary Tree

The binary tree is a fundamental structure in mathematics and computer


science. Some of the terminology of rooted trees, such as, edge, path, branch, leaf,
depth, and level number, will also be used for binary trees. We emphasize that a
binary tree is not a special case of a rooted tree; they are different mathematical
objects.

In computer science, a binary tree is a tree data structure in which each node
has at most two children, which are referred to as the left child and the right child.In
computing, binary trees are used in two very different ways. First, as a means of
accessing nodes based on some value or label associated with each node. Binary trees
labelled this way are used to implement binary search trees and binary heaps, and are
used for efficient searching and sorting. Second, as a representation of data with a
relevant bifurcating structure. In such cases, the particular arrangement of nodes
under and/or to the left or right of other nodes is part of the information (that is,
changing it would change the meaning).
Graph Theory Example From Real Life Problem

V = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)

E = ((1,2),(2,3),(3,4),(4,5),(1,9),(2,9),(3,8),(4,7),(5,13),(5,6),(7,13),(13,7),(7,12),(8,11),(10,9),
(9,8),(8,7),(10,11),(11,12),(12,13),(13,6),(10,10))
= (e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16,e17,e18,e19,e20,e21,e22)

On the sides e11 (7, 13) and e12 (13,7) are double sides, you can use the return or go
route. On the sides e22(10, 10) are loop, because starts and end at the same point.

The circuit length = ((1,2,3,4,5,6,13,7,8,9 to 10), (1,2,3,4,5,6,13,7,12,11 to 10),


1,2,3,4,5,6,13,7,8,11 to 10) has a path that ends in the same point.

The circuit length = ((1,9,10,11,12,7,13 to 6), (1,2,9,10,11,8,7,13 to 6),


(1,9,10,11,8,7,12,13 to 6), (1,9,10,11,8,7,13 to 6)) has a path that ends in the same point.

We’re trying to find the most optimal route for sending orders to customers using graph
theory, we start delivering orders from our outlets to our customers' house’s.Our outlets are
marked with 1, then our customer's houses are marked with 6,7 and 10.When we departed,
there were 2 road junctions namely e1(1,2) and e5(1,9) we chose path e5(1,9) to point 9 then
continued to path e15(9,10) and arrived at our first customer's house, which was point 10. On
the next trip we passed path e18(10,11) to point 11 then crossed path e19(11,12) to point 12
then took path e13(12,7) and got to the house our second customer is at point 7. Our last trip
took the e12(7,13) path to point 13 then passed the e21(13,6) path and finally got to our last
customer's house. That's the most optimal path we've got from using graph theory to solve
this problem.
Binary Tree Example From Real Life Problem

We want to search for words in the following dataset.

Data Item Drink Eat Sleep Sit Walk Run Play Watch Jump Hit Kick

Weight 20 18 15 19 12 16 22 25 21 27 24

Procedure:
If the target data X is found immediately (key value = C element). Then the process will stop
and display the data found.
If the target data X < key value, then the search will only be performed on the left subtree.
If the target data X > key value, the search will only be performed on the right subtree.
If target X data is not found anywhere it will display an error
.
We use the binary tree method to find the word we want. First of all, we want to search word
Run.
The key = Run with weight = 16.
Root key value 1 = 20.
Checks whether 16 = 20. because it is not the same, it checks whether 16 > 20 or 16 < 20. 16
< 20. because < then the search for data continues to the left subtree.

Root key value 2 = 18.


Checking whether 16 = 18. because it is not the same, it checks whether 16 > 18 or 16 < 18. 16
< 18. because < then the search for data continues to the left subtree.
Root key value 3 = 15.
Checking whether 16 = 15. because it is not the same, it checks whether 16 > 15 or 16 < 15. 16
> 15. because < then the search for data continues to the right subtree.

Root key value 4 = 16.


Checks whether 16 = 16. because they are the same, the data is found.

We want to search Punch with weight 30.


Root key value 1 = 20.
Checking whether 30 = 20. because it is not the same, it checks whether 30 > 20 or 30 < 20. 30
> 20. because > then the search for data continues to the right subtree.

Root key value 2 = 22.


Checking whether 30 = 22. because it is not the same, it checks whether 30 > 22 or 30 < 22. 30
< 22. because > then the search for data continues to the right subtree.

Root key value 3 = 25.


Checking whether 30 = 25. because it is not the same, it checks whether 30 > 25 or 30 < 25. 30
> 25. because > then the data search continues to the right subtree.

Root key value 4 = 27.


Checks whether 30 = 27. because they are not the same, the data cannot be found.

You might also like