0% found this document useful (0 votes)
20 views

Math PPT Final

Uploaded by

teamthesqard21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Math PPT Final

Uploaded by

teamthesqard21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 33

Discrete Mathematics

TEAM MEMBERS:
GUIDED BY:
SHRIMAYA PANIGRAHI 230301120029
PRITAM DAS 230301120006
ABHIJIT KANDA 230301120058 Asst. Prof. Debasish Mishra
DEBASISHA BEHERA 230301120042
ABHITOSH SAMAL 230301120059
CHINMAYA MEHER 230301120057
CONTENT
1.Features of Euler graph

2.Features of Hamilton graph

3.Tree and their property

4.Spanning tree

5.Minimum spanning tree

6.Kurskal algorithm to find mst

7.Prims algorithm to find mst

8.Proposition

9.Exclusive or
1. Walk:-
A walk is a finite alternating sequence of vertices and
edges, beginning and ending with same or different vertices
or edges.

2.Path:-
A walk is called path if vertices or edges are not repeated

3.Circuit
A closed path is known as circuit.
FEATURES OF EULER GRAPH
1.Euler path:-
Euler path was first discussed by Leonhard Euler while solving the famous
Seven Bridges of Konigsberg problem in 1736
A path in a graph is said to be an Eulerian path if it traverses each edge in the graph
once and only once and not repeated
2.Euler circuit:-
A circuit in a graph is said to be an Eulerian circuit if it traverses each edge in the
graph once & only once ,which means the edges should not be repeated and it must
be closed.
3.Euler graph:-

A connected graph which contain an Eulerian circuit is called


Eulerian graph.
Here are some Euler's theorems about Euler circuits and paths:

1. Euler Circuit Theorem: A connected graph has an Euler circuit if and


only if every vertex has an even degree.
2. Euler Path Theorem: A connected graph has an Euler path if and only
if it has exactly zero or two vertices of odd degree.
3. Existence of Eulerian Graphs: A connected graph has an Euler circuit
if and only if it is connected and every vertex has even degree.
FEATURES HAMILTONIAN GRAPH
1.Hamiltonian path
Hamiltonian paths and cycles are named after William Rowan Hamilton who
invented the ICOSIAN game, now also known as Hamilton's puzzle, which
involves finding a Hamiltonian cycle in the edge graph of the dodecahedron
A path which contain every vertex of a graph G exactly once is called
Hamiltonian Graph.
2. Hamiltonian circuit
A circuit that passes through each of the vertices in a group G exactly one except
the starting vertex & end vertex is called Hamiltonian circuit.

It is a Hamiltonian circuit because it


covers all the vertex and it is a closed
loop
This is not a Hamiltonian circuit ‘w’ vertex
repeats to make a close circuit
3.Hamiltonian graph
A connected graph which contain Hamiltonian circuit is called
Hamiltonian Graph.

It is a Hamiltonian graph
Here are some Hamiltonian theorems about Hamiltonian circuits and paths:

1. Even Degree: A vertex in a Hamiltonian graph has an even degree if it is


part of an even number of edges. In a Hamiltonian cycle, every vertex is
incident to exactly two edges, so all vertices in a Hamiltonian cycle have
an even degree.
2. Odd Degree: A vertex in a Hamiltonian graph has an odd degree if it is
part of an odd number of edges. In some Hamiltonian graphs, vertices not
included in the Hamiltonian cycle may have odd degrees. However, in a
Hamiltonian cycle itself, all vertices have even degrees.
Comparison of Euler and Hamilton circuits

Property EULER HAMILTONIAN

Repeated visits to a
YES NO
given node allowed?

Repeated traversals of a
NO NO
given edge allowed?

Omitted nodes allowed? NO NO

Omitted allowed? NO YES


TREE
Definition of a Tree:
A tree is a connected acyclic graph (meaning it has no cycles).
It consists of a set of vertices (or nodes) with the following
properties:
Each node can have a minimum degree of 1 (i.e., at least one
edge connects to it).
Each node can have a maximum degree of n (where n represents
the total number of nodes).
A tree can be partitioned into n+1 disjoint subsets:
The first subset contains the root of the tree.
The remaining n subsets include the elements of the n subtrees.
A tree can be either directed or undirected.
1.Properties of Trees:
1. There is only one path between each pair of vertices in a tree.
2. A tree with n vertices has n-1 edges.
3. A graph is a tree if and only if it is minimal connected (i.e., adding any edge would
create a cycle).
4. Rooted Trees: A directed tree with a unique root (indegree 0) and other vertices
having indegree 1.
Example of rooted tree:
The parent of all the leaf node are all the internal node
present in the diagram.
The children of root node are all the internal node present in
The diagram
Types of tree
1. Binary tree:- It is the tree in which each node has at most two children
2. Full binary tree :- It is the tree in which internal nodes have exactly two child
3. Almost complete binary tree:- It is the tree in which below conditions have to follow
a. Last level must be strictly filled from left to right.
b. All levels are completely filled except possibly the last level
4. Complete binary tree:- It is the tree in which exactly two child with leaf nodes at same
level
5. Sub tree:- Each child from a node forms a subtree recursively Every child node will form
a subtree on its parent node.
Basic terminology in tree-
1. Level :- Level of node is the distance of node from root node.
a. Node is at level O.
b. Children of root are at level 1
c. Children level 1 nodes are at level 2 and so on.
2. Height:- height of a node is number of edges between the node and the farthest
leave.(Height of tree→ is height of root node.)
3. Depth:-Depth of a node is number of edges from node to the root node.
Spanning tree
 A spanning tree is a subset of Graph G, such that all the vertices are connected using
minimum possible number of edges. Hence, a spanning tree does not have cycles and a
graph may have more than one spanning tree.
Properties of a Spanning Tree:-
 The spanning tree holds the below-mentioned principles:
 A Spanning tree does not exist for a disconnected graph.
 For a connected graph having N vertices then the number of edges in the spanning tree
for that graph will be N-1.
 A Spanning tree does not have any cycle.
 The total cost (or weight) of the spanning tree is defined as the sum of the edge weights
of all the edges of the spanning tree.
 There can be many possible spanning trees for a graph.
Minimum Spanning Tree(MST):-
 A minimum spanning tree (MST) is defined as a spanning tree that has the
minimum weight among all the possible spanning trees.
 The minimum spanning tree has all the properties of a spanning tree with an added
constraint of having the minimum possible weights among all possible spanning
trees. Like a spanning tree, there can also be many possible MSTs for a graph.
Properties of Minimum Spanning Tree:-
 The minimum spanning tree holds the below-mentioned principles:
 A minimum spanning tree connects all the vertices in the graph, ensuring that there is a path between
any pair of nodes.
 An MST is acyclic, meaning it contains no cycles. This property ensures that it remains a tree and not
a graph with loops.
 For a connected graph having N vertices then the number of edges in the minimum spanning tree for
that graph will be N-1.
Kruskal’s Algorithms to find MST:-
 This is one of the popular algorithms for finding the minimum spanning tree from a
connected, undirected graph. This is a greedy algorithm.
 This algorithm finds the minimum spanning tree of given connected graph G.

How to find MST using Kruskal’s algorithm?


Step 1: Sort all edges in increasing order of their edge weights.
Step 2: Pick the smallest edge.
Step 3: Check if the new edge creates a cycle or loop in a spanning tree.
Step 4: If it doesn’t form the cycle, then include that edge in MST. Otherwise, discard it.
Step 5: Repeat from step 2 until it includes |V| - 1 edges in MST.
Example 1: Determine the minimum spanning tree of the weighted
graph shown in fig

Solution:-
Edges Weights
(B,E) 2
(C,D) 3
(A,D) 4
(C,F) 4
(B,C) 5
(E,F) 5
(A,B) 6
(D,E) 6
(A,F) 7
STEPS :-1

STEPS :-2

STEPS :-3
STEPS :-4

STEPS :-5

STEPS :-6
 Edge (A,B), (D,E) and (E,F) are
discarded because they will form the
cycle in the graph. So, the minimum
spanning tree form in the step 5 is output,
and the total cost is 18.
Prim’s Minimum Spanning Tree Algorithm:-
 Prim's Algorithm is a greedy algorithm that is used to find the minimum spanning tree
from a graph. Prim's algorithm finds the subset of edges that includes every vertex of
the graph such that the sum of the weights of the edges can be minimized.

 The algorithm workflow is as below:-

 First, we have to initialize an MST with the randomly chosen vertex.

 Now, we have to find all the edges that connect the tree in the above step with the
new vertices. From the edges found, select the minimum edge and add it to the
tree.

 Repeat step 2 until the minimum spanning tree is formed.


Example of Prim’s Algorithm:-
Suppose, a weighted graph is -

SOLUTION:-

Step 1 - First, we have to choose a vertex from the above graph. Let's choose B.
Step 2 - Now, we have to choose and add the shortest edge from vertex B. There are two
edges from vertex B that are B to C with weight 10 and edge B to D with weight 4. Among
the edges, the edge BD has the minimum weight. So, add it to the MST.

Step 3 - Now, again, choose the edge with the minimum weight among all the other edges.
In this case, the edges DE and CD are such edges. Add them to MST and explore the
adjacent of C, i.e., E and A. So, select the edge DE and add it to the MST.
Step 4 - Now, select the edge CD, and add it to the MST.

Step 5 - Now, choose the edge CA. Here, we cannot select the edge CE as it would create a
cycle to the graph. So, choose the edge CA and add it to the MST.
Propositional Logic:-
 A declarative sentence which is either true or false but not both is called
propositional logic.

Examples:
a. The sun rises in the north.
b. 12 + 4 = 16
c. Washington, D.C., is the capital of the United States of America.
d. Toronto is the capital of Canada.
Exclusive or () / xor :-
Example:
p : 2+3=5; q : 2-(3-5)=4
Then p q false, since both propositions are true.

Truth table for Exclusive


or
p q p q
T T F
T F T
F T T
F F F
Thank
You

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy