0 views

Uploaded by IJCIRAS Research Publication

A spanning tree is a sub graph obtained from a connected graph which contains all the vertices of a graph. For a connected graph there may be many spanning trees. A minimum spanning tree of a weighted connected graph is the sub graph with minimum weight and no cycle. In this research, we have described the two well-known algorithms (prim’s algorithm and kruskal’s algorithm) to solve the minimum spanning tree problem. We have also described the applications, time complexity and comparison between the two algorithms. From the survey we have observed that prim’s algorithm runs faster than kruskal’s algorithm in dense graphs with maximum number of edges than vertices.

- Minimum Diameter Spanning Trees and Related Problems
- Greedy (1).pdf
- 11 Graphs MST
- CUDA Based Minimum Spanning Tree
- A 1
- Bipolar Neutrosophic Minimum Spanning Tree
- 5153 DESIGN and ANALYSIS of ALGORITHMS Anna University Previous Year Question Paper
- Binomial
- ds
- (les08)-minimalspanningtrees(1)
- 270-1034-1-PB
- What is Data Structure
- An Efficient and Minimum Cost Topology Construction for Rural Wireless Mesh Networks
- Knowles 01 A
- COMP211slides_3
- Feature Subset Selection with Fast Algorithm Implementation
- pegas.pdf
- Lecture 1
- On Pathos Semitotal and Total Block Graph of a Tree
- Acoustic

You are on page 1of 6

TECHNIQUES

Sheikh Irfan Akbar1, Shahid-ul-Islam 2

1 Computer Science and Technology, RIMT University, Mandi Gobindgarh, Punjab

2Information Technology, Desh Bhagat University, Mandi Gobindgarh, Punjab

Abstract

graph G (V, E) is the spanning tree which contains all

A spanning tree is a sub graph obtained from a the vertices with no cycles and the total weight of the

connected graph which contains all the vertices of a edges of a tree is minimum. There can be multiple MST

graph. For a connected graph there may be many for a single graph but all these MSTs have a unique same

spanning trees. A minimum spanning tree of a weight.

weighted connected graph is the sub graph with In this paper we will discuss about the construction of

minimum weight and no cycle. In this research, we MST from a weighted graph using different techniques

have described the two well-known algorithms or algorithms.

(prim’s algorithm and kruskal’s algorithm) to solve

2. APPLICATIONS OF MST

the minimum spanning tree problem. We have also

described the applications, time complexity and I. Network design: The most important application of

comparison between the two algorithms. From the MST is in network design including telephone

survey we have observed that prim’s algorithm runs networks, TV cable network, computer network,

faster than kruskal’s algorithm in dense graphs with road network, islands connection, pipeline network,

maximum number of edges than vertices. electrical circuits, obtaining an independent set of

circuit equations for an electrical network etc.

Keyword: spanning tree, minimum spanning tree, II. Approximation algorithm for NP-hard problem:

weighted connected graph, Prim’s algorithm, this application for MST is used to solve travelling

Kruskal’s algorithm, complexity. sales man problem.

III. Cluster analysis: k clustering problem can be

1.INTRODUCTION

viewed as finding an MST and deleting the k-1

A spanning tree for a connected graph G is defined as edges, i.e. most expensive edges.

the tree which contain all the vertices of graph G. there IV. Indirect applications: Apart from the above

are many spanning trees for a single graph. A spanning applications MST have also some indirect

tree is a connected sub graph with no circuits. applications.

Example: ➢ Max bottleneck paths

➢ LDPC (low density parity check) codes for error

correction

➢ reducing data storage in sequencing amino

acids in a protein – image registration with

Renyi entropy

➢ Model locality of particle interactions in

turbulent fluid flow

➢ learning salient features for real-time face

verification

Figure 1 minimum spanning tree example

IJCIRAS1101 WWW.IJCIRAS.COM 35

© IJCIRAS | ISSN (O) - 2581-5334

January 2018 | Vol. 1 Issue. 8

13. D[z] ← weight(u, z)

There are various algorithms for minimum spanning

14. E[z] ← (u, z)

trees. Prim’s, kruskal’s algorithm is the greedy algorithm

15. change the key of z in Q to D[z]

which are used to find MST of an undirected weighted

16. return tree T

graph, which minimise weight and the number of edges.

The prim’s algorithm was developed in 1930 by Jarnik

and was later rediscovered by Robert C. Prim in 1957

and then again rediscovered by Edsger Dijkstra in 1959.

It is also known as the DJP (Dijkstra-Jarnik Problem)

algorithm, or the Jarnik algorithm, or the Prim–Jarnik

algorithm.

find the minimum cost spanning tree for an undirected

weighted graph.

G= {V, E}

3.1.1. STEPS IN PRIM’S ALGORITHM

V= {A, B, C, D, E, F}

1. Initialise the tree with a single vertex from a given

graph.

2. Choose the shortest outgoing edge from the node

and add this to the tree. Step1: choose a source vertex A from the above graph.

3. The edge formed by the two vertices is treated as a

Q = {B, C, D, E, F)

single node, we check for the shortest adjacent edge

to the node and add this to the tree.

4. Repeat the steps until all the vertices are added to

the tree.

Algorithm: PRIM (G)

Input: A weighted graph G

Output: A minimum spanning tree T for graph G.

2. Set the priority to infinity to all the vertices except

for the starting vertex whose priority is set to 0. Step2: vertex A is the source vertex v.

3. Pick any vertex v from G. Adjacent vertices= {B, D, E}

4. v

Choose edge {A, E}

5. D[u] 0

6. E[u] ← ∅ Q = {B, D, E, F)

7. while Q ≠ ∅

8. u ← Q.removeMinElement()

9. add vertex u and edge (u,E[u]) to T

10. for each vertex z adjacent to u do

11. if z is in Q

IJCIRAS1101 WWW.IJCIRAS.COM 36

© IJCIRAS | ISSN (O) - 2581-5334

January 2018 | Vol. 1 Issue. 8

Step3:

Step6:

Adjacent vertices= {B, D, C}

Adjacent vertices= {F}

Shortest edge {E, C}

Shortest edge {D, F}

Q = {B, D, F)

Q = {∅}

Step4:

Adjacent vertices= {B, D, F} Now we have the minimum spanning tree obtained

from the graph G, which includes the edges {A, E}, {E, C},

Shortest edge {A, B}

{A, B}, {C, D}, {D, F}.

Q = {D, F)

Kruskal’s algorithm is named after Joseph Kruskal.it was

developed in 1956. Kruskal’s Algorithm is based on the

greedy algorithm. The greedy method is applied as we

pick the smallest weight edge that does not cause a

cycle in the MST constructed so far. Kruskal’s algorithm

forms the forest where each edge acts vertex acts as a

single tree, the edges are sorted in the increasing order

Step5: of their costs and included in the set T of selected edges

Adjacent vertices= {D, F} if the edges in the selected tree do not form a cycle and

also after the inclusion of edges. Kruskal’s algorithm also

Shortest edge {C, D}

works on the disconnected graphs.

Q = {F}

3.2.1. STEPS IN KRUSKAL’S ALGORITHM

1. Sort all the edges in the increasing order of their

cost.

2. Choose the edge which has the smallest cost and

check for the cycle. If the edge forms the cycle with

IJCIRAS1101 WWW.IJCIRAS.COM 37

© IJCIRAS | ISSN (O) - 2581-5334

January 2018 | Vol. 1 Issue. 8

edge in the spanning tree.

3. Repeat step 2 until all the vertices are included in E C 1 yes

the spanning tree.

A E 3 yes

3.2.2. Pseudo code

MST-Kruskal (G, W)

A B 5 yes

Input: undirected graph G = (V, E)

W=E R

D F 7 yes

Output: minimum spanning tree T

1. T = ∅;

T (the final spanning tree) is defined to be the C D 9 yes

empty set;

3. Make empty set out of v. B E 10 yes

4. Sort the edges of graph ‘G’ in the increasing

order of their weight w.

5. For each edge (u, v) from the sorted edges do A D 12 No

6. If u and v belong to different sets then

7. Add (u,v) to T;

8. Union (u, v);

B C 16 No

9. Return T;

EXAMPLE:

C F 17 No

We have a graph G (V, E) shown in the fig below:

tree.

Set of edges Weight ( Edge included

increasing order )

IJCIRAS1101 WWW.IJCIRAS.COM 38

© IJCIRAS | ISSN (O) - 2581-5334

January 2018 | Vol. 1 Issue. 8

All the vertices are included in the tree. This is the final

minimum spanning tree which has the minimum weight

among all the spanning trees. The edges {E, C}, {A, E}, {A,

B}, {D, F}, {C, D}.

ALGORITHM

kruskal’s algorithm starts with an edge.

Step3: Edge {A, B} is added to the tree. 2. Prim’s algorithm works only on connected graphs,

while as kruskal’s algorithm can also be applied on

disconnected graphs.

3. Prim’s algorithm builds the minimum spanning tree

by adding a vertex, while as kruskal’s algorithm

works on adding an edge at a time.

4. The time complexity of prim’s algorithm (O(V2)) is

less than that of kruskal’s algorithm (O(logV)).

disconnected tree.

Step5: Next edge {D, C} is added to the tree, the edge describes the history of the problem up to 1985. The first

joins the two trees. known MST algorithm was proposed by Otakar Bor˚uvka

in1926. He was a great Czech mathematician. He was

considering an efficient electrical coverage of Bohemia

at that time. In the mid-1950s when the computer age

just began, the MST problem was further solved by

many researchers. Among them, Joseph Kruskal and

Robert Prim gave two commonly used algorithms. Both

of them writes about Bor˚uvka’s paper in their books.

Prim’s algorithm was a rediscovery of the algorithm by

the prominent number theoretician Vojtˇech Jarn´ık.

These algorithms run in O(m log n) time.

Andrew Chi-Chih Yao, David Cheriton and Robert Tarjan

IJCIRAS1101 WWW.IJCIRAS.COM 39

© IJCIRAS | ISSN (O) - 2581-5334

January 2018 | Vol. 1 Issue. 8

made improvements which reduces the time complexity [5] R.Kalaivani, Dr.D vijayalakshmir, “Minimum Cost

to O(m log log n). With the invention of Fibonacci heaps, Spanning Tree using Matrix Algorithm,” International

the complexity was further reduced. In the worst case, m Journal of Scientific and Research Publications, vol. 4,

= O(n) and the running time is O(m log∗ m). The september 2014.

complexity was further minimised to O(m log β(m, n)) by

Harold N. Gabow, Thomas H. Spencer, and Robert

Tarjan. David Karger, Philip Klein, and Robert Tarjan

proposed a randomized linear-time algorithm for

finding a minimum spanning tree in the restricted

random-access model. Robert Tarjan gave a linear-time

algorithm by using path compression. J´anos Koml´os

showed that we can verify the minimum spanning tree

in linear number of comparisons. Dixon, Monika Rauch,

and Robert Tarjan gave the first linear-time verification

algorithm .linear time algorithm for finding the

minimum spanning tree remains an open problem.

6. CONCLUSION

algorithms to construct and find the minimum spanning

tree of an undirected and connected graph: Prim’s

algorithm, and Kruskal’s algorithm. It is observed that

the time complexity of prim’s algorithm is less than

kruskal’s algorithm. The prim’s algorithm is simple to

implement. Prim’s algorithm and kruskal’s algorithms

are mostly used for solving MST problem among the

other algorithms. We are further looking to reduce the

time complexity of MST algorithms.

REFERENCES

Prim’s Algorithm,” International Journal of Advance

Research in computer science and management studies,

vol. 1, june 2013.

Enhancement of Minimum Spanning Tree,” Nimesh

Patel International Journal of Engineering Research and

Applications, vol. 5, january 2015.

Efficient Technique to Construct a Minimum Spanning

Tree,” International Journal of Advanced Research in

Computer Science and Software Engineering, oct, 2012.

Theory,” in International Conference on Advances in

Engineering & Technology,, Goa,INDIA, 2014.

IJCIRAS1101 WWW.IJCIRAS.COM 40

- Minimum Diameter Spanning Trees and Related ProblemsUploaded byThomas Ramos
- Greedy (1).pdfUploaded byAdit Bhardwaj
- 11 Graphs MSTUploaded byfrankjamison
- CUDA Based Minimum Spanning TreeUploaded byChengyaoTan
- A 1Uploaded byNaning Putrinya Budi Astutik
- Bipolar Neutrosophic Minimum Spanning TreeUploaded byAnonymous 0U9j6BLllB
- 5153 DESIGN and ANALYSIS of ALGORITHMS Anna University Previous Year Question PaperUploaded byarumugam1984293269
- BinomialUploaded byMohit Prajapati
- dsUploaded byshubham47g
- (les08)-minimalspanningtrees(1)Uploaded byhanvwb
- 270-1034-1-PBUploaded byJay Bhavsar
- What is Data StructureUploaded bySabeeh Hasnain
- An Efficient and Minimum Cost Topology Construction for Rural Wireless Mesh NetworksUploaded byijcsis
- Knowles 01 AUploaded byLeanMarqs
- COMP211slides_3Uploaded byalexisthe
- Feature Subset Selection with Fast Algorithm ImplementationUploaded byseventhsensegroup
- pegas.pdfUploaded byApriansyah Rian
- Lecture 1Uploaded bySayan Banerjee
- On Pathos Semitotal and Total Block Graph of a TreeUploaded byDon Hass
- AcousticUploaded bypurple ra
- lec29.pdfUploaded byraw.junk
- Graphviz and Dynagraph - Static and Synamic Graph Drawing ToolsUploaded byJeff Pratt
- symmetry-03-00767Uploaded byArmando Vargas
- Graph Theory TutorialUploaded byNikhilReddy
- Suffix EngUploaded byPrateek Gahlan
- Big o CheatsheetUploaded byLeandro Silva Lee
- Practice QuestionsUploaded byAwani Pandya
- IJAIEM-2013-05-10-017Uploaded byAnonymous vQrJlEN
- Gradient Based Adaptive BeamformingUploaded byIRJET Journal
- DSA - Lecture 5 and 6 - ArraysUploaded bySafder Khan Babar

- THERMODYNAMIC ANALYSIS OF MIXING OF Mn-Co BINARY ALLOY SYSTEM USING CALPHAD APPROACHUploaded byIJCIRAS Research Publication
- ANALYSIS ON STOCK MARKET PREDICTION USING MACHINE LEARNING TECHNIQUESUploaded byIJCIRAS Research Publication
- Best practice in teacher Education Educational TechnologyUploaded byIJCIRAS Research Publication
- PERSPECTIVE OF HUMAN RIGHTS IN ISLAMUploaded byIJCIRAS Research Publication
- STUDIES ON THE DIVERSITY OF BUTTERFLY FAUNA IN KONGUNADU COLLEGE OF ARTS AND SCIENCE CAMPUS, G.N.MILLS, COIMBATORE, TAMIL NADUUploaded byIJCIRAS Research Publication
- Pediatric Research: Challenges and Innovative MeasuresUploaded byIJCIRAS Research Publication
- Relation between WHO and IDF Criteria of the Metabolic Syndrome in Postmenopausal Females of PunjabUploaded byIJCIRAS Research Publication
- Research ProposalUploaded byIJCIRAS Research Publication
- DIVERSITY OF ANT SPECIES (HYMENOPTERA: FORMICIDAE) IN THE CAMPUS OF KONGUNADU ARTS AND SCIENCE COLLEGE, COIMBATORE DISTRICT, TAMIL NADU.Uploaded byIJCIRAS Research Publication
- Insilico study of miR-132 with Acetylcholinesterase to investigate the binding affinity for interactionUploaded byIJCIRAS Research Publication
- Discussion on comparison of Naturalism of Rabindra Nath Tagor and Mahatma GandhiUploaded byIJCIRAS Research Publication
- The Impact of Leadership Styles of Supervisors on Employee Performance of Non-Executive Employees: Special Reference to Tile Industry in Western Province, Sri LankaUploaded byIJCIRAS Research Publication
- Tribal Population in Dahod District of Gujarat: An Evaluation of Socio-Economic ProfileUploaded byIJCIRAS Research Publication
- Consumer Buying BehaviorUploaded byIJCIRAS Research Publication
- Study on Stress Related Factors Influencing HypertensionUploaded byIJCIRAS Research Publication
- Access Control Verification System using Statistical MethodsUploaded byIJCIRAS Research Publication
- PATH LOSS PREDICTION BY USING RSSI VALUESUploaded byIJCIRAS Research Publication
- PATH LOSS PREDICTION BY USING RSSI VALUESUploaded byIJCIRAS Research Publication
- How civically adolescents are committed as a citizen of the country: A quantitative studyUploaded byIJCIRAS Research Publication
- The relationship between the milk and cookies consumption in the USUploaded byIJCIRAS Research Publication
- Coping with the Legalization of Neo-Liberal Exploitation: The Case of CSR in TanzaniaUploaded byIJCIRAS Research Publication
- Li-Fi Technology: Transmission of data through lightUploaded byIJCIRAS Research Publication
- Li-Fi Technology: Transmission of data through lightUploaded byIJCIRAS Research Publication
- Community participation in CSR decision making in the contemporary economy and globalization: the case of some selected mobile companiesUploaded byIJCIRAS Research Publication
- Identifying Kantian Aesthetics: A Select Study of Coleridge’s PoetryUploaded byIJCIRAS Research Publication
- ANALYSIS THE THERMAL CONDUCTIVITY BETWEEN COMPOSITE WALL AND POWDER MATERIALSUploaded byIJCIRAS Research Publication
- Venice: Objective Correlative of Aschanbach’s Repressed Self in Thomas Mann’s Death in VeniceUploaded byIJCIRAS Research Publication
- POPULARITY OF MARXIST SCHOOL OF THOUGHT IN AFRICAN LITERATURE: A CRITIQUE.Uploaded byIJCIRAS Research Publication
- Life cycle analysis of food productsUploaded byIJCIRAS Research Publication

- White Paper - Understanding SAP LockboxUploaded byNarayana Murty
- Paradoxical Intention is no symptom prescription. A letter (Alfried Längle 1986)Uploaded byabaeram2
- Traveller_Elementary_Grammar_KEY_www.frenglish.ru.pdfUploaded byÉva Ugray
- GoddessAlchemy Golden Light Avalon UK 120722Uploaded byMySecret Gardenmdp
- Pro Quest CitationsUploaded byJeff Liu
- Necessary Substances: An Exercise in Axiomatic MetaphysicsUploaded byAdam Labecki
- interview assignment 3 chd 216Uploaded byapi-317017632
- Types of DepartmentationUploaded byjoshuacvc
- Fallon Rouiller and Amelie Trudeau Open Letter From Amelie and Fallon.ltUploaded bydefoedefoe
- Talent Management Final PptUploaded byManan Kapoor
- Subject Verb Agreement WorksheetUploaded bySteve Mahashabde
- Etaxguide_GST_GST General Guide for Businesses_2014!10!08Uploaded byGrand Overall
- Ccot Ma ChartUploaded byJerry Chiang
- Konsep Matematika Kls IX Sem 1 BilingualUploaded byUniqelyLeeNa
- FINANCIAL RATIO ANALYSIS OF NIB BANK PAKISTANUploaded byGOHAR REHMAN
- UD2_handbook.pdfUploaded byQuintan Bt Abg Shokeran
- Experience LetterUploaded bySuresh Raikwar
- The Benefits of YasinUploaded byshogi786
- Digital Modeling Commercial Office Space by Ashlie AdamUploaded byashlie adam
- RSD Non-Exclusive Distribution Contract - Artists.pdfUploaded byCiprian Ivan
- Annual ReportUploaded byAgriSafe
- Section 13 14 AssignmentUploaded byabethzkyyyy
- Tejas Article _ Globalization of Tata Motors_ Strategic Plan for the FutureUploaded byKantesh Bhandari
- Jawaban Quiz 1 SimbisUploaded byfatwacahyokusumo
- 12_1_APS-ASCP_B31553_04Uploaded by邢玉蓮
- Effect of Mixing on Spontaneous Struvite Precipitation From Semiconductor Waste WaterUploaded bylilie19
- No Frills MassUploaded byCLAVDIVS
- DTC agreement between Bosnia and Herzegovina and ChinaUploaded byOECD: Organisation for Economic Co-operation and Development
- Corporate Finance Practice ExamUploaded byg
- E Cell Dinesh MR(13141)Uploaded byDinesh Raghavendra