SlideShare a Scribd company logo
EM-IV
PRESENTATION
APPLICATI
ON IN
REAL LIFE
:
Kruskal’s Algorithm
&
& &
Prim’s Algorithm
16/03/2021 EM-IV PRESENTATION 2
COST OF
GRAPH
MINIMALITY LOOPS &
PARALLEL
ALGORITHM
GREEDY
ALGORITHM
MINIMUM
SPANNING
TREE
KRUSKAL’S
& PRIM’S
ALGORITHM
AGENDA
MINIMALITY
Application:
In computer networking ,
minimality
helps to find errors in
connection of 3 or more
devices
via router.
Minimality
typically refers
to something
which has no
subset or
subgraph with a
given property.
In computer science, a
microkernel is the near-
minimum amount of
software that can
provide the mechanisms
needed to implement
an operating system.
EXAMPLE-I
• The maximum
number of
edges with n
vertices
• nC2 = n(n-1)/2
• The maximum
number of simple
graphs with n
vertices .
• 2^ nC2 = 2^n(n-
1)/2
LOOPS &
PARALLEL
ALGORITHM
Algorithm
Steps:
• Remove all
loops and
parallel edges.
• In case of
parallel edges,
keep the one
which has the
least cost
associated
and remove all
others.
GREEDY
ALGORITHM
Algorithm Steps: Application:
• Greedy algorithms
allow to find a
globally optimal
solution for a given
problem by making
successive locally
optimal choices.
• We can model different
communications networks
using vertices to represent
devices and edges to
represent the particular
type of communications
links of interest.
• A candidate set, from which a
solution is created
• A selection function, which chooses
the best candidate to be added to
the solution
• A feasibility function, that is used to
determine if a candidate can be
used to contribute to a solution
• An objective function, which assigns
a value to a solution, or a partial
solution, and
• A solution function, which will
indicate when we have discovered a
complete solution
• Greedy algorithms are
often used in ad hoc
mobile networking to
efficiently route
packets with the fewest
number of hops and
the shortest delay
possible.
EXAMPLE-II
• We can model different
communications networks
using vertices to represent
devices and edges to
represent the particular
type of communications
links of interest.
The graph will
get traversed
with the
maximum
number
of weight it can
carry initially.
It will keep on
doing the same
until is left and
final cost as
null.
Steps: CONS:
It doesn't work in
each and every
situation
and does not
produce an
optimal solution.
COST OF
GRAPH
• Given a directed graph,
which may contain cycles,
where every edge has
weight, the task is to find
the minimum cost of any
simple path from a given
source vertex ‘s’ to a given
destination vertex ‘t’.
:Depending upon the total
cost and number of
edges present , via multiple
routes ,
average cost describes the
complexity of
a graph/tree .
MINIMUM
SPANNING
TREE
• The cost of the
spanning tree is the
sum of the weights of
all the edges in the
tree. There can be
many spanning trees.
Minimum spanning tree
is the spanning tree
where the cost is
minimum among all the
spanning trees.
• Minimum spanning
tree has direct
application in the
design of networks.
Application:
• It is used in
algorithms
approximating the
travelling
salesman
problem, multi-
terminal minimum
cut problem.
Kruskal’s
Algorithm
Algorithm Steps:
•Sort the graph edges with
respect to their weights.
•Start adding edges to the
MST from the edge with the
smallest weight until the
edge of the largest weight.
•Only add edges which
doesn't form a cycle , edges
which connect only
disconnected components.
Applications where Kruskal’s algorithm
is generally used:
1. Landing cables
2. TV Network
3. Tour Operations
4. LAN Networks
5. A network of pipes for drinking water or
natural gas.
6. An electric grid
7. Single-link Cluster
• The best use for Kruskal
algorithm would be finding
out the shortest path for
laying down telephone or
cable wires. In this way, the
telephone or the cable
company saves huge
amount on the cost of wires
and at the same time, the
redundancy of path from
which information travels
decreases and hence much
less noise.
Prim’s Algorithm
Algorithm Steps:
•Maintain two disjoint sets of
vertices. One containing vertices
that are in the growing spanning
tree and other that are not in the
growing spanning tree.
•Select the cheapest vertex that
is connected to the growing
spanning tree and is not in the
growing spanning tree and add
it into the growing spanning tree.
This can be done using Priority
Queues. Insert the vertices, that
are connected to growing
spanning tree, into the Priority
Queue.
•Check for cycles. To do that,
mark the nodes which have
been already selected and insert
only those nodes in the Priority
Queue that are not marked.
Applications where Prim’s
algorithm is generally used:
1.All the applications stated in
the Kruskal’s algorithm’s
applications can be resolved
using Prim’s algorithm (use in
case of a dense graph).
2. Network for roads and Rail
tracks connecting all the
cities.
3. Irrigation channels and
placing microwave towers
4. Designing a fiber-optic grid
or ICs.
5. Travelling Salesman
Problem.
6. Cluster analysis.
7. Pathfinding algorithms
used in AI(Artificial
Intelligence).
8. Game Development
16/03/2021 EM-IV PRESENTATION 13
The performance of the two algorithms could differ
depending upon the certain factors such as the number of
vertices. Prim’s algorithm runs in O(V2) time and works
well in the massive graphs while Kruskal’s algorithm
consumes O(log V) and perform suitably with small
graphs. Although, among both of the algorithm Kruskal’s
algorithm can generate better results.
16/03/2021 EM-IV PRESENTATION 14
"Texas Birth Index, Nolan County, 1903-1997".
Obituary (February 22, 2009). "Alice (Hutter) Prim In Memoriam". Austin
American-Statesmen. Retrieved May 3, 2013.
Leland Johnson (1997). "A History of Exceptional Service in the National
Interest" (PDF). Retrieved July 20, 2016.
Cormen, Thomas; Charles E Leiserson, Ronald L Rivest, Clifford Stein
(2009). Introduction To Algorithms (Third ed.). MIT Press. pp. 631. ISBN 978-
0262258104.
Kruskal, J. B. (1956). "On the shortest spanning subtree of a graph and the traveling
salesman problem". Proceedings of the American Mathematical Society. 7 (1): 48–
50. doi:10.1090/S0002-9939-1956-0078686-7. JSTOR 2033241.
Quinn, Michael J.; Deo, Narsingh (1984). "Parallel graph algorithms". ACM Computing
Surveys. 16 (3): 319–348. doi:10.1145/2514.2515.
Grama, Ananth; Gupta, Anshul; Karypis, George; Kumar, Vipin (2003). Introduction to
Parallel Computing. pp. 412–413. ISBN 978-0201648652.
Jump up to:a b Osipov, Vitaly; Sanders, Peter; Singler, Johannes (2009). "The filter-
kruskal minimum spanning tree algorithm" (PDF). Proceedings of the Eleventh
Workshop on Algorithm Engineering and Experiments (ALENEX). Society for Industrial
and Applied Mathematics: 52–61.
Katsigiannis, Anastasios; Anastopoulos, Nikos; Konstantinos, Nikas; Koziris, Nectarios
(2012). "An approach to parallelize kruskal's algorithm using helper
threads" (PDF). Parallel and Distributed Processing Symposium Workshops & PHD
Forum (IPDPSW), 2012 IEEE 26th International: 1601–1610.
Thank you
16/03/2021 EM-IV PRESENTATION 15

More Related Content

What's hot

Brave New Concurrent World
Brave New Concurrent WorldBrave New Concurrent World
Brave New Concurrent World
Simon Belak
 
Manifold Blurring Mean Shift algorithms for manifold denoising, presentation,...
Manifold Blurring Mean Shift algorithms for manifold denoising, presentation,...Manifold Blurring Mean Shift algorithms for manifold denoising, presentation,...
Manifold Blurring Mean Shift algorithms for manifold denoising, presentation,...
Florent Renucci
 
post119s1-file3
post119s1-file3post119s1-file3
post119s1-file3
Venkata Suhas Maringanti
 
Minimum spanning tree (mst)
Minimum spanning tree (mst)Minimum spanning tree (mst)
Minimum spanning tree (mst)
Pradeep Behera
 
Dijkstra's Algorithm
Dijkstra's Algorithm Dijkstra's Algorithm
Dijkstra's Algorithm
Rashik Ishrak Nahian
 
Advanced topics in artificial neural networks
Advanced topics in artificial neural networksAdvanced topics in artificial neural networks
Advanced topics in artificial neural networks
swapnac12
 
Evaluation of programs codes using machine learning
Evaluation of programs codes using machine learningEvaluation of programs codes using machine learning
Evaluation of programs codes using machine learning
Vivek Maskara
 
Application of Kruskals algorithm
Application of Kruskals algorithmApplication of Kruskals algorithm
Application of Kruskals algorithm
Lina Guha Roy
 
14mvd0034_poster
14mvd0034_poster14mvd0034_poster
14mvd0034_poster
Jyothi Thomas
 
Radar Spectral Analysis
Radar Spectral AnalysisRadar Spectral Analysis
Radar Spectral Analysis
Assignmentpedia
 
Dijkstra algorithm
Dijkstra algorithmDijkstra algorithm
Dijkstra algorithm
are you
 
study Latent Doodle Space
study Latent Doodle Spacestudy Latent Doodle Space
study Latent Doodle Space
Chiamin Hsu
 
JGrass-Newage SWRB
JGrass-Newage SWRBJGrass-Newage SWRB
JGrass-Newage SWRB
Marialaura Bancheri
 
JOINT VIRTUAL MIMO AND DATA GATHERING FOR WIRELESS SENSOR NETWORKS
JOINT VIRTUAL MIMO AND DATA GATHERING FOR WIRELESS SENSOR NETWORKSJOINT VIRTUAL MIMO AND DATA GATHERING FOR WIRELESS SENSOR NETWORKS
JOINT VIRTUAL MIMO AND DATA GATHERING FOR WIRELESS SENSOR NETWORKS
I3E Technologies
 
Network Analysis
Network AnalysisNetwork Analysis
Network Analysis
ami_01
 
Clustering (from Google)
Clustering (from Google)Clustering (from Google)
Clustering (from Google)
Sri Prasanna
 
Algorithm
AlgorithmAlgorithm
Algorithm
Pragnesh Patel
 
Data Locality
Data LocalityData Locality
Data Locality
Syam Lal
 
Cross cloud map reduce for big data
Cross cloud map reduce for big dataCross cloud map reduce for big data
Cross cloud map reduce for big data
JAYAPRAKASH JPINFOTECH
 
Canopy clustering algorithm
Canopy clustering algorithmCanopy clustering algorithm
Canopy clustering algorithm
Ashish Karki
 

What's hot (20)

Brave New Concurrent World
Brave New Concurrent WorldBrave New Concurrent World
Brave New Concurrent World
 
Manifold Blurring Mean Shift algorithms for manifold denoising, presentation,...
Manifold Blurring Mean Shift algorithms for manifold denoising, presentation,...Manifold Blurring Mean Shift algorithms for manifold denoising, presentation,...
Manifold Blurring Mean Shift algorithms for manifold denoising, presentation,...
 
post119s1-file3
post119s1-file3post119s1-file3
post119s1-file3
 
Minimum spanning tree (mst)
Minimum spanning tree (mst)Minimum spanning tree (mst)
Minimum spanning tree (mst)
 
Dijkstra's Algorithm
Dijkstra's Algorithm Dijkstra's Algorithm
Dijkstra's Algorithm
 
Advanced topics in artificial neural networks
Advanced topics in artificial neural networksAdvanced topics in artificial neural networks
Advanced topics in artificial neural networks
 
Evaluation of programs codes using machine learning
Evaluation of programs codes using machine learningEvaluation of programs codes using machine learning
Evaluation of programs codes using machine learning
 
Application of Kruskals algorithm
Application of Kruskals algorithmApplication of Kruskals algorithm
Application of Kruskals algorithm
 
14mvd0034_poster
14mvd0034_poster14mvd0034_poster
14mvd0034_poster
 
Radar Spectral Analysis
Radar Spectral AnalysisRadar Spectral Analysis
Radar Spectral Analysis
 
Dijkstra algorithm
Dijkstra algorithmDijkstra algorithm
Dijkstra algorithm
 
study Latent Doodle Space
study Latent Doodle Spacestudy Latent Doodle Space
study Latent Doodle Space
 
JGrass-Newage SWRB
JGrass-Newage SWRBJGrass-Newage SWRB
JGrass-Newage SWRB
 
JOINT VIRTUAL MIMO AND DATA GATHERING FOR WIRELESS SENSOR NETWORKS
JOINT VIRTUAL MIMO AND DATA GATHERING FOR WIRELESS SENSOR NETWORKSJOINT VIRTUAL MIMO AND DATA GATHERING FOR WIRELESS SENSOR NETWORKS
JOINT VIRTUAL MIMO AND DATA GATHERING FOR WIRELESS SENSOR NETWORKS
 
Network Analysis
Network AnalysisNetwork Analysis
Network Analysis
 
Clustering (from Google)
Clustering (from Google)Clustering (from Google)
Clustering (from Google)
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Data Locality
Data LocalityData Locality
Data Locality
 
Cross cloud map reduce for big data
Cross cloud map reduce for big dataCross cloud map reduce for big data
Cross cloud map reduce for big data
 
Canopy clustering algorithm
Canopy clustering algorithmCanopy clustering algorithm
Canopy clustering algorithm
 

Similar to Prim's and Kruskal's Algorithm

Spanning Tree in data structure and .pptx
Spanning Tree in data structure and .pptxSpanning Tree in data structure and .pptx
Spanning Tree in data structure and .pptx
asimshahzad8611
 
OTP, Phishing, QR code, Shares, Visual Cryptography.
OTP, Phishing, QR code, Shares, Visual Cryptography.OTP, Phishing, QR code, Shares, Visual Cryptography.
OTP, Phishing, QR code, Shares, Visual Cryptography.
IJERA Editor
 
MDM-Chapter-9-Updated latest.pptx
MDM-Chapter-9-Updated latest.pptxMDM-Chapter-9-Updated latest.pptx
MDM-Chapter-9-Updated latest.pptx
JimSotio
 
Surveillance System (Minimum Vertex Cover Problem)
Surveillance System (Minimum Vertex Cover Problem) Surveillance System (Minimum Vertex Cover Problem)
Surveillance System (Minimum Vertex Cover Problem)
Saksham Saxena
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
theijes
 
Ijciras1101
Ijciras1101Ijciras1101
Ijciras1101
zhendy94
 
Network analysis
Network analysisNetwork analysis
Network analysis
Moudud Hasan
 
Shortest path by using suitable algorithm.pdf
Shortest path by using suitable algorithm.pdfShortest path by using suitable algorithm.pdf
Shortest path by using suitable algorithm.pdf
zefergaming
 
IRJET- Survey on Implementation of Graph Theory in Routing Protocols of Wired...
IRJET- Survey on Implementation of Graph Theory in Routing Protocols of Wired...IRJET- Survey on Implementation of Graph Theory in Routing Protocols of Wired...
IRJET- Survey on Implementation of Graph Theory in Routing Protocols of Wired...
IRJET Journal
 
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
KUSHDHIRRA2111026030
 
Design of Quaternary Logical Circuit Using Voltage and Current Mode Logic
Design of Quaternary Logical Circuit Using Voltage and Current Mode LogicDesign of Quaternary Logical Circuit Using Voltage and Current Mode Logic
Design of Quaternary Logical Circuit Using Voltage and Current Mode Logic
VLSICS Design
 
Unit3_1.pdf
Unit3_1.pdfUnit3_1.pdf
Unit3_1.pdf
Pratimakumari213460
 
Ram minimum spanning tree
Ram   minimum spanning treeRam   minimum spanning tree
Ram minimum spanning tree
Rama Prasath A
 
Shortest Path Algorithm
Shortest Path AlgorithmShortest Path Algorithm
Shortest Path Algorithm
Anish Ansari
 
04 15029 active node ijeecs 1570310145(edit)
04 15029 active node ijeecs 1570310145(edit)04 15029 active node ijeecs 1570310145(edit)
04 15029 active node ijeecs 1570310145(edit)
nooriasukmaningtyas
 
Implementation of Spanning Tree Protocol using ns-3
Implementation of Spanning Tree Protocol using ns-3Implementation of Spanning Tree Protocol using ns-3
Implementation of Spanning Tree Protocol using ns-3
Naishil Shah
 
A Minimum Spanning Tree Approach of Solving a Transportation Problem
A Minimum Spanning Tree Approach of Solving a Transportation ProblemA Minimum Spanning Tree Approach of Solving a Transportation Problem
A Minimum Spanning Tree Approach of Solving a Transportation Problem
inventionjournals
 
Analysis of Genetic Algorithm for Effective power Delivery and with Best Upsurge
Analysis of Genetic Algorithm for Effective power Delivery and with Best UpsurgeAnalysis of Genetic Algorithm for Effective power Delivery and with Best Upsurge
Analysis of Genetic Algorithm for Effective power Delivery and with Best Upsurge
ijeei-iaes
 
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final DraftMathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
AlexanderCominsky
 
A genetic algorithm for constructing broadcast trees with cost and delay cons...
A genetic algorithm for constructing broadcast trees with cost and delay cons...A genetic algorithm for constructing broadcast trees with cost and delay cons...
A genetic algorithm for constructing broadcast trees with cost and delay cons...
IJCNCJournal
 

Similar to Prim's and Kruskal's Algorithm (20)

Spanning Tree in data structure and .pptx
Spanning Tree in data structure and .pptxSpanning Tree in data structure and .pptx
Spanning Tree in data structure and .pptx
 
OTP, Phishing, QR code, Shares, Visual Cryptography.
OTP, Phishing, QR code, Shares, Visual Cryptography.OTP, Phishing, QR code, Shares, Visual Cryptography.
OTP, Phishing, QR code, Shares, Visual Cryptography.
 
MDM-Chapter-9-Updated latest.pptx
MDM-Chapter-9-Updated latest.pptxMDM-Chapter-9-Updated latest.pptx
MDM-Chapter-9-Updated latest.pptx
 
Surveillance System (Minimum Vertex Cover Problem)
Surveillance System (Minimum Vertex Cover Problem) Surveillance System (Minimum Vertex Cover Problem)
Surveillance System (Minimum Vertex Cover Problem)
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
 
Ijciras1101
Ijciras1101Ijciras1101
Ijciras1101
 
Network analysis
Network analysisNetwork analysis
Network analysis
 
Shortest path by using suitable algorithm.pdf
Shortest path by using suitable algorithm.pdfShortest path by using suitable algorithm.pdf
Shortest path by using suitable algorithm.pdf
 
IRJET- Survey on Implementation of Graph Theory in Routing Protocols of Wired...
IRJET- Survey on Implementation of Graph Theory in Routing Protocols of Wired...IRJET- Survey on Implementation of Graph Theory in Routing Protocols of Wired...
IRJET- Survey on Implementation of Graph Theory in Routing Protocols of Wired...
 
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
 
Design of Quaternary Logical Circuit Using Voltage and Current Mode Logic
Design of Quaternary Logical Circuit Using Voltage and Current Mode LogicDesign of Quaternary Logical Circuit Using Voltage and Current Mode Logic
Design of Quaternary Logical Circuit Using Voltage and Current Mode Logic
 
Unit3_1.pdf
Unit3_1.pdfUnit3_1.pdf
Unit3_1.pdf
 
Ram minimum spanning tree
Ram   minimum spanning treeRam   minimum spanning tree
Ram minimum spanning tree
 
Shortest Path Algorithm
Shortest Path AlgorithmShortest Path Algorithm
Shortest Path Algorithm
 
04 15029 active node ijeecs 1570310145(edit)
04 15029 active node ijeecs 1570310145(edit)04 15029 active node ijeecs 1570310145(edit)
04 15029 active node ijeecs 1570310145(edit)
 
Implementation of Spanning Tree Protocol using ns-3
Implementation of Spanning Tree Protocol using ns-3Implementation of Spanning Tree Protocol using ns-3
Implementation of Spanning Tree Protocol using ns-3
 
A Minimum Spanning Tree Approach of Solving a Transportation Problem
A Minimum Spanning Tree Approach of Solving a Transportation ProblemA Minimum Spanning Tree Approach of Solving a Transportation Problem
A Minimum Spanning Tree Approach of Solving a Transportation Problem
 
Analysis of Genetic Algorithm for Effective power Delivery and with Best Upsurge
Analysis of Genetic Algorithm for Effective power Delivery and with Best UpsurgeAnalysis of Genetic Algorithm for Effective power Delivery and with Best Upsurge
Analysis of Genetic Algorithm for Effective power Delivery and with Best Upsurge
 
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final DraftMathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
 
A genetic algorithm for constructing broadcast trees with cost and delay cons...
A genetic algorithm for constructing broadcast trees with cost and delay cons...A genetic algorithm for constructing broadcast trees with cost and delay cons...
A genetic algorithm for constructing broadcast trees with cost and delay cons...
 

Recently uploaded

Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
Celine George
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
IsmaelVazquez38
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
David Douglas School District
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
indexPub
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
khuleseema60
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
Celine George
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
ImMuslim
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 

Recently uploaded (20)

Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17How to Predict Vendor Bill Product in Odoo 17
How to Predict Vendor Bill Product in Odoo 17
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 

Prim's and Kruskal's Algorithm

  • 2. APPLICATI ON IN REAL LIFE : Kruskal’s Algorithm & & & Prim’s Algorithm 16/03/2021 EM-IV PRESENTATION 2
  • 3. COST OF GRAPH MINIMALITY LOOPS & PARALLEL ALGORITHM GREEDY ALGORITHM MINIMUM SPANNING TREE KRUSKAL’S & PRIM’S ALGORITHM AGENDA
  • 4. MINIMALITY Application: In computer networking , minimality helps to find errors in connection of 3 or more devices via router. Minimality typically refers to something which has no subset or subgraph with a given property. In computer science, a microkernel is the near- minimum amount of software that can provide the mechanisms needed to implement an operating system.
  • 5. EXAMPLE-I • The maximum number of edges with n vertices • nC2 = n(n-1)/2 • The maximum number of simple graphs with n vertices . • 2^ nC2 = 2^n(n- 1)/2
  • 6. LOOPS & PARALLEL ALGORITHM Algorithm Steps: • Remove all loops and parallel edges. • In case of parallel edges, keep the one which has the least cost associated and remove all others.
  • 7. GREEDY ALGORITHM Algorithm Steps: Application: • Greedy algorithms allow to find a globally optimal solution for a given problem by making successive locally optimal choices. • We can model different communications networks using vertices to represent devices and edges to represent the particular type of communications links of interest. • A candidate set, from which a solution is created • A selection function, which chooses the best candidate to be added to the solution • A feasibility function, that is used to determine if a candidate can be used to contribute to a solution • An objective function, which assigns a value to a solution, or a partial solution, and • A solution function, which will indicate when we have discovered a complete solution • Greedy algorithms are often used in ad hoc mobile networking to efficiently route packets with the fewest number of hops and the shortest delay possible.
  • 8. EXAMPLE-II • We can model different communications networks using vertices to represent devices and edges to represent the particular type of communications links of interest. The graph will get traversed with the maximum number of weight it can carry initially. It will keep on doing the same until is left and final cost as null. Steps: CONS: It doesn't work in each and every situation and does not produce an optimal solution.
  • 9. COST OF GRAPH • Given a directed graph, which may contain cycles, where every edge has weight, the task is to find the minimum cost of any simple path from a given source vertex ‘s’ to a given destination vertex ‘t’. :Depending upon the total cost and number of edges present , via multiple routes , average cost describes the complexity of a graph/tree .
  • 10. MINIMUM SPANNING TREE • The cost of the spanning tree is the sum of the weights of all the edges in the tree. There can be many spanning trees. Minimum spanning tree is the spanning tree where the cost is minimum among all the spanning trees. • Minimum spanning tree has direct application in the design of networks. Application: • It is used in algorithms approximating the travelling salesman problem, multi- terminal minimum cut problem.
  • 11. Kruskal’s Algorithm Algorithm Steps: •Sort the graph edges with respect to their weights. •Start adding edges to the MST from the edge with the smallest weight until the edge of the largest weight. •Only add edges which doesn't form a cycle , edges which connect only disconnected components. Applications where Kruskal’s algorithm is generally used: 1. Landing cables 2. TV Network 3. Tour Operations 4. LAN Networks 5. A network of pipes for drinking water or natural gas. 6. An electric grid 7. Single-link Cluster • The best use for Kruskal algorithm would be finding out the shortest path for laying down telephone or cable wires. In this way, the telephone or the cable company saves huge amount on the cost of wires and at the same time, the redundancy of path from which information travels decreases and hence much less noise.
  • 12. Prim’s Algorithm Algorithm Steps: •Maintain two disjoint sets of vertices. One containing vertices that are in the growing spanning tree and other that are not in the growing spanning tree. •Select the cheapest vertex that is connected to the growing spanning tree and is not in the growing spanning tree and add it into the growing spanning tree. This can be done using Priority Queues. Insert the vertices, that are connected to growing spanning tree, into the Priority Queue. •Check for cycles. To do that, mark the nodes which have been already selected and insert only those nodes in the Priority Queue that are not marked. Applications where Prim’s algorithm is generally used: 1.All the applications stated in the Kruskal’s algorithm’s applications can be resolved using Prim’s algorithm (use in case of a dense graph). 2. Network for roads and Rail tracks connecting all the cities. 3. Irrigation channels and placing microwave towers 4. Designing a fiber-optic grid or ICs. 5. Travelling Salesman Problem. 6. Cluster analysis. 7. Pathfinding algorithms used in AI(Artificial Intelligence). 8. Game Development
  • 13. 16/03/2021 EM-IV PRESENTATION 13 The performance of the two algorithms could differ depending upon the certain factors such as the number of vertices. Prim’s algorithm runs in O(V2) time and works well in the massive graphs while Kruskal’s algorithm consumes O(log V) and perform suitably with small graphs. Although, among both of the algorithm Kruskal’s algorithm can generate better results.
  • 14. 16/03/2021 EM-IV PRESENTATION 14 "Texas Birth Index, Nolan County, 1903-1997". Obituary (February 22, 2009). "Alice (Hutter) Prim In Memoriam". Austin American-Statesmen. Retrieved May 3, 2013. Leland Johnson (1997). "A History of Exceptional Service in the National Interest" (PDF). Retrieved July 20, 2016. Cormen, Thomas; Charles E Leiserson, Ronald L Rivest, Clifford Stein (2009). Introduction To Algorithms (Third ed.). MIT Press. pp. 631. ISBN 978- 0262258104. Kruskal, J. B. (1956). "On the shortest spanning subtree of a graph and the traveling salesman problem". Proceedings of the American Mathematical Society. 7 (1): 48– 50. doi:10.1090/S0002-9939-1956-0078686-7. JSTOR 2033241. Quinn, Michael J.; Deo, Narsingh (1984). "Parallel graph algorithms". ACM Computing Surveys. 16 (3): 319–348. doi:10.1145/2514.2515. Grama, Ananth; Gupta, Anshul; Karypis, George; Kumar, Vipin (2003). Introduction to Parallel Computing. pp. 412–413. ISBN 978-0201648652. Jump up to:a b Osipov, Vitaly; Sanders, Peter; Singler, Johannes (2009). "The filter- kruskal minimum spanning tree algorithm" (PDF). Proceedings of the Eleventh Workshop on Algorithm Engineering and Experiments (ALENEX). Society for Industrial and Applied Mathematics: 52–61. Katsigiannis, Anastasios; Anastopoulos, Nikos; Konstantinos, Nikas; Koziris, Nectarios (2012). "An approach to parallelize kruskal's algorithm using helper threads" (PDF). Parallel and Distributed Processing Symposium Workshops & PHD Forum (IPDPSW), 2012 IEEE 26th International: 1601–1610.
  • 15. Thank you 16/03/2021 EM-IV PRESENTATION 15