SlideShare a Scribd company logo
KRUSKAL’S ALGORITHM
MADE BY :-
DHRUV PATEL(160110116029).
BHAVIK VASHI(160110116061).
Introduction
• Kruskal's algorithm is a minimum-spanning-tree algorithm which finds an edge of the least
possible weight that connects any two trees in the forest.
• Some key terms:-
1. spanning tree:- A spanning tree of a connected, undirected graph G is a sub-graph of G which is
a tree that connects all the vertices together.
2. forest:- A forest is a disjoint union of trees, or equivalently an acyclic graph that is not
necessarily connected.
Kruskal algorithm
EXAMPLE:-
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?
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
Select the shortest
edge in the network
ED 2
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
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
A
F
B
C
D
E
2
7
4
5
8 6
4
5
3
8
Solution
8
1. A ← 
2. for each vertex v  V
3. do MAKE-SET(v)
4. sort E into non-decreasing order by w
5. for each (u, v) taken from the sorted list
6. do if FIND-SET(u)  FIND-SET(v)
7. then A ← A  {(u, v)}
8. UNION(u, v)
9. return A
Running time: O(V+ElogE+ElogV)=O(ElogE) – dependent on the
implementation of the disjoint-set data structure
KRUSKAL(V, E)
O(V)
O(ElogE)
O(E)
O(logV)
Disjoint data structure
• MAKE-SET(u) – creates a new set whose only member is u
• FIND-SET(u) – returns a representative element from the set that contains u
• UNION(u, v) – unites the dynamic sets that contain u and v, say Su and Sv
• E.g.: Su = {r, s, t, u}, Sv = {v, x, y}
UNION (u, v) = {r, s, t, u, v, x, y}
• Running time for FIND-SET and UNION depends on implementation.
• Can be shown to be α(n)=O(logn) where α() is a very slowly growing function.
TRY THIS!

More Related Content

What's hot

Dijkstra's Algorithm
Dijkstra's Algorithm Dijkstra's Algorithm
Dijkstra's Algorithm
Rashik Ishrak Nahian
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
Hinal Lunagariya
 
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
 
PRIM'S ALGORITHM
PRIM'S ALGORITHMPRIM'S ALGORITHM
PRIM'S ALGORITHM
garishma bhatia
 
Dijkstra s algorithm
Dijkstra s algorithmDijkstra s algorithm
Dijkstra s algorithm
mansab MIRZA
 
KRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraKRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraguest1f4fb3
 
minimum spanning tree
minimum spanning tree minimum spanning tree
minimum spanning tree
Melaku Bayih Demessie
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithm
sana younas
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
Subid Biswas
 
Prims Algorithm
Prims AlgorithmPrims Algorithm
Prims AlgorithmSriram Raj
 
Prim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmPrim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithm
Acad
 
Dijkstra’s algorithm
Dijkstra’s algorithmDijkstra’s algorithm
Dijkstra’s algorithmfaisal2204
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applicationsTech_MX
 
Prims & kruskal algorithms
Prims & kruskal algorithmsPrims & kruskal algorithms
Prims & kruskal algorithms
Ayesha Tahir
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
STEFFY D
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning tree
oneous
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
Nv Thejaswini
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
Md. Shafiuzzaman Hira
 
Data Structure and Algorithms Hashing
Data Structure and Algorithms HashingData Structure and Algorithms Hashing
Data Structure and Algorithms Hashing
ManishPrajapati78
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
Dr Sandeep Kumar Poonia
 

What's hot (20)

Dijkstra's Algorithm
Dijkstra's Algorithm Dijkstra's Algorithm
Dijkstra's Algorithm
 
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)
 
PRIM'S ALGORITHM
PRIM'S ALGORITHMPRIM'S ALGORITHM
PRIM'S ALGORITHM
 
Dijkstra s algorithm
Dijkstra s algorithmDijkstra s algorithm
Dijkstra s algorithm
 
KRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraKRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitra
 
minimum spanning tree
minimum spanning tree minimum spanning tree
minimum spanning tree
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithm
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
 
Prims Algorithm
Prims AlgorithmPrims Algorithm
Prims Algorithm
 
Prim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmPrim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithm
 
Dijkstra’s algorithm
Dijkstra’s algorithmDijkstra’s algorithm
Dijkstra’s algorithm
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applications
 
Prims & kruskal algorithms
Prims & kruskal algorithmsPrims & kruskal algorithms
Prims & kruskal algorithms
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning tree
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
 
Data Structure and Algorithms Hashing
Data Structure and Algorithms HashingData Structure and Algorithms Hashing
Data Structure and Algorithms Hashing
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
 

Similar to Kruskal Algorithm

5.1 greedy 03
5.1 greedy 035.1 greedy 03
5.1 greedy 03
Krish_ver2
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
Amit Kumar Rathi
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
AhmedMalik74
 
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
KUSHDHIRRA2111026030
 
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
 
MinSpanningTreespresantion.ppt
MinSpanningTreespresantion.pptMinSpanningTreespresantion.ppt
MinSpanningTreespresantion.ppt
baciprek
 
My presentation minimum spanning tree
My presentation minimum spanning treeMy presentation minimum spanning tree
My presentation minimum spanning tree
Alona Salva
 
Unit 5 session 2 MinimumSpanningTrees.ppt
Unit 5 session 2 MinimumSpanningTrees.pptUnit 5 session 2 MinimumSpanningTrees.ppt
Unit 5 session 2 MinimumSpanningTrees.ppt
prithivr1
 
Minimum Spanning Tree
Minimum Spanning TreeMinimum Spanning Tree
Minimum Spanning Tree
Balamurugan M
 
Daa chapter13
Daa chapter13Daa chapter13
Daa chapter13
B.Kirron Reddi
 
Ijciras1101
Ijciras1101Ijciras1101
Ijciras1101
zhendy94
 
8_MST_pptx.pptx
8_MST_pptx.pptx8_MST_pptx.pptx
8_MST_pptx.pptx
JhonCarloJacinto
 
OzaBagAdwin (OBA) slide [7].pdf
OzaBagAdwin (OBA) slide [7].pdfOzaBagAdwin (OBA) slide [7].pdf
OzaBagAdwin (OBA) slide [7].pdf
KoayFT
 
Set Operations - Union Find and Bloom Filters
Set Operations - Union Find and Bloom FiltersSet Operations - Union Find and Bloom Filters
Set Operations - Union Find and Bloom Filters
Amrinder Arora
 
Kruskal's algorithm
Kruskal's algorithmKruskal's algorithm
Kruskal's algorithm
Raj Kumar Ranabhat
 
DISTRIBUTION LOAD FLOW ANALYSIS FOR RDIAL & MESH DISTRIBUTION SYSTEM
DISTRIBUTION LOAD FLOW ANALYSIS FOR RDIAL & MESH DISTRIBUTION SYSTEMDISTRIBUTION LOAD FLOW ANALYSIS FOR RDIAL & MESH DISTRIBUTION SYSTEM
DISTRIBUTION LOAD FLOW ANALYSIS FOR RDIAL & MESH DISTRIBUTION SYSTEM
IAEME Publication
 
Algorithms explained
Algorithms explainedAlgorithms explained
Algorithms explained
PIYUSH Dubey
 
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
ABIRAMIS87
 
Top schools in ghaziabad
Top schools in ghaziabadTop schools in ghaziabad
Top schools in ghaziabad
Edhole.com
 

Similar to Kruskal Algorithm (20)

5.1 greedy 03
5.1 greedy 035.1 greedy 03
5.1 greedy 03
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
 
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
 
MinSpanningTreespresantion.ppt
MinSpanningTreespresantion.pptMinSpanningTreespresantion.ppt
MinSpanningTreespresantion.ppt
 
My presentation minimum spanning tree
My presentation minimum spanning treeMy presentation minimum spanning tree
My presentation minimum spanning tree
 
post119s1-file2
post119s1-file2post119s1-file2
post119s1-file2
 
Unit 5 session 2 MinimumSpanningTrees.ppt
Unit 5 session 2 MinimumSpanningTrees.pptUnit 5 session 2 MinimumSpanningTrees.ppt
Unit 5 session 2 MinimumSpanningTrees.ppt
 
Minimum Spanning Tree
Minimum Spanning TreeMinimum Spanning Tree
Minimum Spanning Tree
 
Daa chapter13
Daa chapter13Daa chapter13
Daa chapter13
 
Ijciras1101
Ijciras1101Ijciras1101
Ijciras1101
 
8_MST_pptx.pptx
8_MST_pptx.pptx8_MST_pptx.pptx
8_MST_pptx.pptx
 
OzaBagAdwin (OBA) slide [7].pdf
OzaBagAdwin (OBA) slide [7].pdfOzaBagAdwin (OBA) slide [7].pdf
OzaBagAdwin (OBA) slide [7].pdf
 
Set Operations - Union Find and Bloom Filters
Set Operations - Union Find and Bloom FiltersSet Operations - Union Find and Bloom Filters
Set Operations - Union Find and Bloom Filters
 
Kruskal's algorithm
Kruskal's algorithmKruskal's algorithm
Kruskal's algorithm
 
DISTRIBUTION LOAD FLOW ANALYSIS FOR RDIAL & MESH DISTRIBUTION SYSTEM
DISTRIBUTION LOAD FLOW ANALYSIS FOR RDIAL & MESH DISTRIBUTION SYSTEMDISTRIBUTION LOAD FLOW ANALYSIS FOR RDIAL & MESH DISTRIBUTION SYSTEM
DISTRIBUTION LOAD FLOW ANALYSIS FOR RDIAL & MESH DISTRIBUTION SYSTEM
 
Algorithms explained
Algorithms explainedAlgorithms explained
Algorithms explained
 
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
 
Top schools in ghaziabad
Top schools in ghaziabadTop schools in ghaziabad
Top schools in ghaziabad
 

More from Bhavik Vashi

Aws ec2
Aws ec2Aws ec2
Aws ec2
Bhavik Vashi
 
MACRO PROCESSOR
MACRO PROCESSORMACRO PROCESSOR
MACRO PROCESSOR
Bhavik Vashi
 
Cloud computing
Cloud computingCloud computing
Cloud computing
Bhavik Vashi
 
Linear Sorting
Linear SortingLinear Sorting
Linear Sorting
Bhavik Vashi
 
Colormodels
ColormodelsColormodels
Colormodels
Bhavik Vashi
 
Runge Kutta Method
Runge Kutta Method Runge Kutta Method
Runge Kutta Method
Bhavik Vashi
 
Rate monotonic scheduling- Operating System
Rate monotonic scheduling- Operating SystemRate monotonic scheduling- Operating System
Rate monotonic scheduling- Operating System
Bhavik Vashi
 
Data Structure Radix Sort
Data Structure Radix SortData Structure Radix Sort
Data Structure Radix Sort
Bhavik Vashi
 
File management in OS
File management in OSFile management in OS
File management in OS
Bhavik Vashi
 
Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++
Bhavik Vashi
 
Parallel processing (simd and mimd)
Parallel processing (simd and mimd)Parallel processing (simd and mimd)
Parallel processing (simd and mimd)
Bhavik Vashi
 
Ethernet and switches
Ethernet and switchesEthernet and switches
Ethernet and switches
Bhavik Vashi
 
Fiscal Policy & Monetary Policy
Fiscal Policy & Monetary PolicyFiscal Policy & Monetary Policy
Fiscal Policy & Monetary Policy
Bhavik Vashi
 
Diwali Light
Diwali LightDiwali Light
Diwali Light
Bhavik Vashi
 
Heat transfer
Heat transferHeat transfer
Heat transfer
Bhavik Vashi
 
Projection of lines
Projection of linesProjection of lines
Projection of lines
Bhavik Vashi
 
Most Successful People & Personality
Most Successful People & Personality Most Successful People & Personality
Most Successful People & Personality
Bhavik Vashi
 
Global Need of the World
Global Need of the WorldGlobal Need of the World
Global Need of the World
Bhavik Vashi
 
Functions of stdio conio
Functions of stdio   conio Functions of stdio   conio
Functions of stdio conio
Bhavik Vashi
 
Impact of social media
Impact of social mediaImpact of social media
Impact of social media
Bhavik Vashi
 

More from Bhavik Vashi (20)

Aws ec2
Aws ec2Aws ec2
Aws ec2
 
MACRO PROCESSOR
MACRO PROCESSORMACRO PROCESSOR
MACRO PROCESSOR
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Linear Sorting
Linear SortingLinear Sorting
Linear Sorting
 
Colormodels
ColormodelsColormodels
Colormodels
 
Runge Kutta Method
Runge Kutta Method Runge Kutta Method
Runge Kutta Method
 
Rate monotonic scheduling- Operating System
Rate monotonic scheduling- Operating SystemRate monotonic scheduling- Operating System
Rate monotonic scheduling- Operating System
 
Data Structure Radix Sort
Data Structure Radix SortData Structure Radix Sort
Data Structure Radix Sort
 
File management in OS
File management in OSFile management in OS
File management in OS
 
Types of Constructor in C++
Types of Constructor in C++Types of Constructor in C++
Types of Constructor in C++
 
Parallel processing (simd and mimd)
Parallel processing (simd and mimd)Parallel processing (simd and mimd)
Parallel processing (simd and mimd)
 
Ethernet and switches
Ethernet and switchesEthernet and switches
Ethernet and switches
 
Fiscal Policy & Monetary Policy
Fiscal Policy & Monetary PolicyFiscal Policy & Monetary Policy
Fiscal Policy & Monetary Policy
 
Diwali Light
Diwali LightDiwali Light
Diwali Light
 
Heat transfer
Heat transferHeat transfer
Heat transfer
 
Projection of lines
Projection of linesProjection of lines
Projection of lines
 
Most Successful People & Personality
Most Successful People & Personality Most Successful People & Personality
Most Successful People & Personality
 
Global Need of the World
Global Need of the WorldGlobal Need of the World
Global Need of the World
 
Functions of stdio conio
Functions of stdio   conio Functions of stdio   conio
Functions of stdio conio
 
Impact of social media
Impact of social mediaImpact of social media
Impact of social media
 

Recently uploaded

Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Recently uploaded (20)

Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 

Kruskal Algorithm

  • 1. KRUSKAL’S ALGORITHM MADE BY :- DHRUV PATEL(160110116029). BHAVIK VASHI(160110116061).
  • 2. Introduction • Kruskal's algorithm is a minimum-spanning-tree algorithm which finds an edge of the least possible weight that connects any two trees in the forest. • Some key terms:- 1. spanning tree:- A spanning tree of a connected, undirected graph G is a sub-graph of G which is a tree that connects all the vertices together. 2. forest:- A forest is a disjoint union of trees, or equivalently an acyclic graph that is not necessarily connected.
  • 3. Kruskal algorithm EXAMPLE:- 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?
  • 4. 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
  • 5. Select the shortest edge in the network ED 2 A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 6. Select the next shortest edge which does not create a cycle ED 2 AB 3 CD 4 AE 4 A F B C D E 2 7 4 5 8 6 4 5 3 8
  • 7. All vertices have been connected. The solution is ED 2 AB 3 CD 4 AE 4 EF 5 Total weight of tree: 18 A F B C D E 2 7 4 5 8 6 4 5 3 8 Solution
  • 8. 8 1. A ←  2. for each vertex v  V 3. do MAKE-SET(v) 4. sort E into non-decreasing order by w 5. for each (u, v) taken from the sorted list 6. do if FIND-SET(u)  FIND-SET(v) 7. then A ← A  {(u, v)} 8. UNION(u, v) 9. return A Running time: O(V+ElogE+ElogV)=O(ElogE) – dependent on the implementation of the disjoint-set data structure KRUSKAL(V, E) O(V) O(ElogE) O(E) O(logV)
  • 9. Disjoint data structure • MAKE-SET(u) – creates a new set whose only member is u • FIND-SET(u) – returns a representative element from the set that contains u • UNION(u, v) – unites the dynamic sets that contain u and v, say Su and Sv • E.g.: Su = {r, s, t, u}, Sv = {v, x, y} UNION (u, v) = {r, s, t, u, v, x, y} • Running time for FIND-SET and UNION depends on implementation. • Can be shown to be α(n)=O(logn) where α() is a very slowly growing function.