SlideShare a Scribd company logo
1 of 20
WELCOME
TO OUR
PRESENTATION
KRUSKAL’S ALGORITHM
&
PRIM’S ALGORITHM
Presented by :
Asif Ahmed Sajal #ID : 142-15-3710
Irin Afroze #ID : 142-15 3746
Minimum Connector Algorithms
Kruskal’s algorithm
1. Select the shortest edge in a
network
2. Select the next shortest edge
which does not create a cycle
3. Repeat step 2 until all vertices
have been connected
Prim’s algorithm
1. Select any vertex
2. Select the shortest edge
connected to that vertex
3. Select the shortest edge
connected to any vertex
already connected
4. Repeat step 3 until all
vertices have been
connected
A CABLE COMPANY WANT TO CONNECT FIVE VILLAGES TO THEIR
NETWORK WHICH CURRENTLY EXTENDS TO THE MARKET TOWN OF
AVONFORD. WHAT IS THE MINIMUM LENGTH OF CABLE NEEDED?
Avonford Fingley
Brinleigh Cornwell
Donster
Edan
2
7
4
5
8 6 4
5
3
8
Example
We model the situation as a network, then the problem
is to find the minimum connector for the network
A F
B C
D
E
2
7
4
5
8 6 4
5
3
8
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
List the edges in
order of size:
ED 2
AB 3
AE 4
CD 4
BC 5
EF 5
CF 6
AF 7
BF 8
CF 8
Kruskal’s Algorithm
Select the shortest
edge in the network
ED 2
Kruskal’s Algorithm
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
Select the next shortest
edge which does not
create a cycle
ED 2
AB 3
Kruskal’s Algorithm
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
Select the next shortest
edge which does not
create a cycle
ED 2
AB 3
CD 4 (or AE 4)
Kruskal’s Algorithm
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
Select the next shortest
edge which does not
create a cycle
ED 2
AB 3
CD 4
AE 4
Kruskal’s Algorithm
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
Select the next shortest
edge which does not
create a cycle
ED 2
AB 3
CD 4
AE 4
BC 5 – forms a cycle
EF 5
Kruskal’s Algorithm
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
All vertices have been
connected.
The solution is
ED 2
AB 3
CD 4
AE 4
EF 5
Total weight of tree: 18
Kruskal’s Algorithm
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
Select any vertex
A
Select the shortest
edge connected to
that vertex
AB 3
Prim’s Algorithm
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
Select the shortest
edge connected to
any vertex already
connected.
AE 4
Prim’s Algorithm
Select the shortest
edge connected to
any vertex already
connected.
ED 2
Prim’s Algorithm
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
Select the shortest
edge connected to
any vertex already
connected.
DC 4
Prim’s Algorithm
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
Select the shortest
edge connected to
any vertex already
connected.
CB 5 – forms a cycle
EF 5
Prim’s Algorithm
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
Prim’s Algorithm
A
F
B
C
D
E
2
7
4
5
8 6 4
5
3
8
All vertices have been
connected.
The solution is
ED 2
AB 3
CD 4
AE 4
EF 5
Total weight of tree: 18
•Both algorithms will always give solutions with
the same length.
•They will usually select edges in a different order
– you must show this in your workings.
•Occasionally they will use different edges – this
may happen when you have to choose between
edges with the same length. In this case there is
more than one minimum connector for the
network.
USES OF BOTH ALGORITHM
THANK YOU

More Related Content

What's hot

Prims and kruskal algorithms
Prims and kruskal algorithmsPrims and kruskal algorithms
Prims and kruskal algorithmsSaga Valsalan
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentationSubid Biswas
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardAnimesh Chaturvedi
 
KRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraKRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraguest1f4fb3
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and boundAbhishek Singh
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy methodhodcsencet
 
Single source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstraSingle source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstraRoshan Tailor
 
CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR Zahid Parvez
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning treeSTEFFY D
 
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)Madhu Bala
 
Bellman ford Algorithm
Bellman ford AlgorithmBellman ford Algorithm
Bellman ford Algorithmtaimurkhan803
 

What's hot (20)

Prims and kruskal algorithms
Prims and kruskal algorithmsPrims and kruskal algorithms
Prims and kruskal algorithms
 
Shortest path algorithms
Shortest path algorithmsShortest path algorithms
Shortest path algorithms
 
Kruskal Algorithm
Kruskal AlgorithmKruskal Algorithm
Kruskal Algorithm
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
 
Dijkstra's Algorithm
Dijkstra's Algorithm Dijkstra's Algorithm
Dijkstra's Algorithm
 
minimum spanning tree
minimum spanning tree minimum spanning tree
minimum spanning tree
 
Binary Search
Binary SearchBinary Search
Binary Search
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
 
KRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraKRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitra
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and bound
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
 
Single source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstraSingle source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstra
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
 
CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
 
Floyd Warshall Algorithm
Floyd Warshall AlgorithmFloyd Warshall Algorithm
Floyd Warshall Algorithm
 
Bellman ford Algorithm
Bellman ford AlgorithmBellman ford Algorithm
Bellman ford Algorithm
 
Bfs and Dfs
Bfs and DfsBfs and Dfs
Bfs and Dfs
 

Viewers also liked

Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applicationsTech_MX
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra Sahil Kumar
 
Prims Algorithm
Prims AlgorithmPrims Algorithm
Prims AlgorithmSriram Raj
 
My presentation minimum spanning tree
My presentation minimum spanning treeMy presentation minimum spanning tree
My presentation minimum spanning treeAlona Salva
 
Kruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.comKruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.comHemant Gautam
 
Minimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumiMinimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumiIbrahim Alfayoumi
 
Application of greedy method
Application  of  greedy methodApplication  of  greedy method
Application of greedy methodTech_MX
 
Dijkstra’s algorithm
Dijkstra’s algorithmDijkstra’s algorithm
Dijkstra’s algorithmfaisal2204
 
Dijkstra’S Algorithm
Dijkstra’S AlgorithmDijkstra’S Algorithm
Dijkstra’S Algorithmami_01
 
Review And Evaluations Of Shortest Path Algorithms
Review And Evaluations Of Shortest Path AlgorithmsReview And Evaluations Of Shortest Path Algorithms
Review And Evaluations Of Shortest Path AlgorithmsPawan Kumar Tiwari
 
minimum spanning trees Algorithm
minimum spanning trees Algorithm minimum spanning trees Algorithm
minimum spanning trees Algorithm sachin varun
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Mohanlal Sukhadia University (MLSU)
 

Viewers also liked (19)

Kruskal Algorithm
Kruskal AlgorithmKruskal Algorithm
Kruskal Algorithm
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applications
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
 
Prims Algorithm
Prims AlgorithmPrims Algorithm
Prims Algorithm
 
My presentation minimum spanning tree
My presentation minimum spanning treeMy presentation minimum spanning tree
My presentation minimum spanning tree
 
Kruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.comKruskals prims shared by: geekssay.com
Kruskals prims shared by: geekssay.com
 
Kruskal’s Algorithm
Kruskal’s AlgorithmKruskal’s Algorithm
Kruskal’s Algorithm
 
Greedy minimum spanning tree- prim's algorithm
Greedy minimum spanning tree- prim's algorithmGreedy minimum spanning tree- prim's algorithm
Greedy minimum spanning tree- prim's algorithm
 
Minimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumiMinimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumi
 
Application of greedy method
Application  of  greedy methodApplication  of  greedy method
Application of greedy method
 
Dijkstra’s algorithm
Dijkstra’s algorithmDijkstra’s algorithm
Dijkstra’s algorithm
 
Dijkstra’S Algorithm
Dijkstra’S AlgorithmDijkstra’S Algorithm
Dijkstra’S Algorithm
 
Review And Evaluations Of Shortest Path Algorithms
Review And Evaluations Of Shortest Path AlgorithmsReview And Evaluations Of Shortest Path Algorithms
Review And Evaluations Of Shortest Path Algorithms
 
04 greedyalgorithmsii
04 greedyalgorithmsii04 greedyalgorithmsii
04 greedyalgorithmsii
 
Mst(engl)
Mst(engl)Mst(engl)
Mst(engl)
 
Kruskal’s algorithm
Kruskal’s algorithmKruskal’s algorithm
Kruskal’s algorithm
 
minimum spanning trees Algorithm
minimum spanning trees Algorithm minimum spanning trees Algorithm
minimum spanning trees Algorithm
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
 
9 cm402.18
9 cm402.189 cm402.18
9 cm402.18
 

Similar to Kruskal & Prim's Algorithm

kruskal.ppt
kruskal.pptkruskal.ppt
kruskal.ppterosslo
 
prims and Kruskal 1.pdf
prims and Kruskal 1.pdfprims and Kruskal 1.pdf
prims and Kruskal 1.pdfDEEPAK948083
 
digital electronics Design of 101 sequence detector without overlapping for...
digital  electronics Design of 101 sequence detector without  overlapping for...digital  electronics Design of 101 sequence detector without  overlapping for...
digital electronics Design of 101 sequence detector without overlapping for...sanjay kumar pediredla
 
3.7 GHz Microwave Amplifier Design
3.7 GHz Microwave Amplifier Design3.7 GHz Microwave Amplifier Design
3.7 GHz Microwave Amplifier DesignRashad Alsaffar
 
Catalog busbar ls 06. busduct presentation e series rev 2
Catalog busbar ls 06. busduct presentation e series rev 2Catalog busbar ls 06. busduct presentation e series rev 2
Catalog busbar ls 06. busduct presentation e series rev 2Dien Ha The
 
Catalog busbar ls 06. busduct presentation e series rev 2
Catalog busbar ls 06. busduct presentation e series rev 2Catalog busbar ls 06. busduct presentation e series rev 2
Catalog busbar ls 06. busduct presentation e series rev 2Dien Ha The
 
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHMDATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHMABIRAMIS87
 
PARASITIC-AWARE FULL PHYSICAL CHIP DESIGN OF LNA RFIC AT 2.45GHZ USING IBM 13...
PARASITIC-AWARE FULL PHYSICAL CHIP DESIGN OF LNA RFIC AT 2.45GHZ USING IBM 13...PARASITIC-AWARE FULL PHYSICAL CHIP DESIGN OF LNA RFIC AT 2.45GHZ USING IBM 13...
PARASITIC-AWARE FULL PHYSICAL CHIP DESIGN OF LNA RFIC AT 2.45GHZ USING IBM 13...Ilango Jeyasubramanian
 
Ecet 110 Success Begins / snaptutorial.com
Ecet 110 Success Begins / snaptutorial.comEcet 110 Success Begins / snaptutorial.com
Ecet 110 Success Begins / snaptutorial.comWilliamsTaylorzm
 
Heat Shrink Cable Joints & Cable Terminations LV HV, 6.6kV 11kV 33kV - SPS Ca...
Heat Shrink Cable Joints & Cable Terminations LV HV, 6.6kV 11kV 33kV - SPS Ca...Heat Shrink Cable Joints & Cable Terminations LV HV, 6.6kV 11kV 33kV - SPS Ca...
Heat Shrink Cable Joints & Cable Terminations LV HV, 6.6kV 11kV 33kV - SPS Ca...Thorne & Derrick International
 
Setp by step design of transformer
Setp by step design of transformerSetp by step design of transformer
Setp by step design of transformerbinodsahu8
 
IRC_Poster_WFTPElectrical_Final
IRC_Poster_WFTPElectrical_FinalIRC_Poster_WFTPElectrical_Final
IRC_Poster_WFTPElectrical_FinalMichael Bardwell
 
Concurrent Triple Band Low Noise Amplifier Design
Concurrent Triple Band Low Noise Amplifier DesignConcurrent Triple Band Low Noise Amplifier Design
Concurrent Triple Band Low Noise Amplifier DesignHalil Kayıhan
 
Metal Detector Project
Metal Detector ProjectMetal Detector Project
Metal Detector ProjectDanish Bangash
 

Similar to Kruskal & Prim's Algorithm (20)

kruskal prim
kruskal primkruskal prim
kruskal prim
 
kruskal.ppt
kruskal.pptkruskal.ppt
kruskal.ppt
 
Network flow
Network flowNetwork flow
Network flow
 
prims and Kruskal 1.pdf
prims and Kruskal 1.pdfprims and Kruskal 1.pdf
prims and Kruskal 1.pdf
 
digital electronics Design of 101 sequence detector without overlapping for...
digital  electronics Design of 101 sequence detector without  overlapping for...digital  electronics Design of 101 sequence detector without  overlapping for...
digital electronics Design of 101 sequence detector without overlapping for...
 
3.7 GHz Microwave Amplifier Design
3.7 GHz Microwave Amplifier Design3.7 GHz Microwave Amplifier Design
3.7 GHz Microwave Amplifier Design
 
Catalog busbar ls 06. busduct presentation e series rev 2
Catalog busbar ls 06. busduct presentation e series rev 2Catalog busbar ls 06. busduct presentation e series rev 2
Catalog busbar ls 06. busduct presentation e series rev 2
 
Catalog busbar ls 06. busduct presentation e series rev 2
Catalog busbar ls 06. busduct presentation e series rev 2Catalog busbar ls 06. busduct presentation e series rev 2
Catalog busbar ls 06. busduct presentation e series rev 2
 
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHMDATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
 
PARASITIC-AWARE FULL PHYSICAL CHIP DESIGN OF LNA RFIC AT 2.45GHZ USING IBM 13...
PARASITIC-AWARE FULL PHYSICAL CHIP DESIGN OF LNA RFIC AT 2.45GHZ USING IBM 13...PARASITIC-AWARE FULL PHYSICAL CHIP DESIGN OF LNA RFIC AT 2.45GHZ USING IBM 13...
PARASITIC-AWARE FULL PHYSICAL CHIP DESIGN OF LNA RFIC AT 2.45GHZ USING IBM 13...
 
Making a peaking filter by Julio Marqués
Making a peaking filter by Julio MarquésMaking a peaking filter by Julio Marqués
Making a peaking filter by Julio Marqués
 
Ecet 110 Success Begins / snaptutorial.com
Ecet 110 Success Begins / snaptutorial.comEcet 110 Success Begins / snaptutorial.com
Ecet 110 Success Begins / snaptutorial.com
 
Heat Shrink Cable Joints & Cable Terminations LV HV, 6.6kV 11kV 33kV - SPS Ca...
Heat Shrink Cable Joints & Cable Terminations LV HV, 6.6kV 11kV 33kV - SPS Ca...Heat Shrink Cable Joints & Cable Terminations LV HV, 6.6kV 11kV 33kV - SPS Ca...
Heat Shrink Cable Joints & Cable Terminations LV HV, 6.6kV 11kV 33kV - SPS Ca...
 
DB Cable
DB CableDB Cable
DB Cable
 
Setp by step design of transformer
Setp by step design of transformerSetp by step design of transformer
Setp by step design of transformer
 
IRC_Poster_WFTPElectrical_Final
IRC_Poster_WFTPElectrical_FinalIRC_Poster_WFTPElectrical_Final
IRC_Poster_WFTPElectrical_Final
 
Concurrent Triple Band Low Noise Amplifier Design
Concurrent Triple Band Low Noise Amplifier DesignConcurrent Triple Band Low Noise Amplifier Design
Concurrent Triple Band Low Noise Amplifier Design
 
Metal Detector Project
Metal Detector ProjectMetal Detector Project
Metal Detector Project
 
07
0707
07
 
Vikas marka.pptx
Vikas marka.pptxVikas marka.pptx
Vikas marka.pptx
 

Recently uploaded

DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 

Recently uploaded (20)

DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 

Kruskal & Prim's Algorithm

  • 2. KRUSKAL’S ALGORITHM & PRIM’S ALGORITHM Presented by : Asif Ahmed Sajal #ID : 142-15-3710 Irin Afroze #ID : 142-15 3746
  • 3. Minimum Connector Algorithms Kruskal’s algorithm 1. Select the shortest edge in a network 2. Select the next shortest edge which does not create a cycle 3. Repeat step 2 until all vertices have been connected Prim’s algorithm 1. Select any vertex 2. Select the shortest edge connected to that vertex 3. Select the shortest edge connected to any vertex already connected 4. Repeat step 3 until all vertices have been connected
  • 4. A CABLE COMPANY WANT TO CONNECT FIVE VILLAGES TO THEIR NETWORK WHICH CURRENTLY EXTENDS TO THE MARKET TOWN OF AVONFORD. WHAT IS THE MINIMUM LENGTH OF CABLE NEEDED? Avonford Fingley Brinleigh Cornwell Donster Edan 2 7 4 5 8 6 4 5 3 8 Example
  • 5. We model the situation as a network, then the problem is to find the minimum connector for the network A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 6. A F B C D E 2 7 4 5 8 6 4 5 3 8 List the edges in order of size: ED 2 AB 3 AE 4 CD 4 BC 5 EF 5 CF 6 AF 7 BF 8 CF 8 Kruskal’s Algorithm
  • 7. Select the shortest edge in the network ED 2 Kruskal’s Algorithm A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 8. Select the next shortest edge which does not create a cycle ED 2 AB 3 Kruskal’s Algorithm A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 9. Select the next shortest edge which does not create a cycle ED 2 AB 3 CD 4 (or AE 4) Kruskal’s Algorithm A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 10. Select the next shortest edge which does not create a cycle ED 2 AB 3 CD 4 AE 4 Kruskal’s Algorithm A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 11. Select the next shortest edge which does not create a cycle ED 2 AB 3 CD 4 AE 4 BC 5 – forms a cycle EF 5 Kruskal’s Algorithm A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 12. All vertices have been connected. The solution is ED 2 AB 3 CD 4 AE 4 EF 5 Total weight of tree: 18 Kruskal’s Algorithm A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 13. A F B C D E 2 7 4 5 8 6 4 5 3 8 Select any vertex A Select the shortest edge connected to that vertex AB 3 Prim’s Algorithm
  • 14. A F B C D E 2 7 4 5 8 6 4 5 3 8 Select the shortest edge connected to any vertex already connected. AE 4 Prim’s Algorithm
  • 15. Select the shortest edge connected to any vertex already connected. ED 2 Prim’s Algorithm A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 16. Select the shortest edge connected to any vertex already connected. DC 4 Prim’s Algorithm A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 17. Select the shortest edge connected to any vertex already connected. CB 5 – forms a cycle EF 5 Prim’s Algorithm A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 18. Prim’s Algorithm A F B C D E 2 7 4 5 8 6 4 5 3 8 All vertices have been connected. The solution is ED 2 AB 3 CD 4 AE 4 EF 5 Total weight of tree: 18
  • 19. •Both algorithms will always give solutions with the same length. •They will usually select edges in a different order – you must show this in your workings. •Occasionally they will use different edges – this may happen when you have to choose between edges with the same length. In this case there is more than one minimum connector for the network. USES OF BOTH ALGORITHM