## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

Networks Prim’s Algorithm

Prim`s Algorithm

Wiltshire

In Lesson 1 we learnt about Kruskal`s algorithm,

which was used to solve minimum connector problems. Another method that can be used is Prim`s algorithm. Step 1 – Select any node Step 2 – Connect it to the nearest node Step 3 – Connect one node already selected to the nearest unconnected node. Step 4 – Repeat 3 until all nodes are connected.

Wiltshire Consider the example we looked at last lesson.Prim`s Algorithm Select any node you like. . Lets select F.

Wiltshire C and D are both 3 away so we can choose either.Prim`s Algorithm Connect it to the nearest node. Lets select C. .

Prim`s Algorithm only 3 away from F. So connect D to F. Wiltshire The nearest node to either of F or C is D. which is .

Prim`s Algorithm So connect E to D. . Wiltshire The nearest to D. F or C is E which is 2 from D.

Prim`s Algorithm 5 away from F. Connect A to F. Wiltshire The nearest to any of these four nodes is A which is .

Prim`s Algorithm We now need to connect the last node. which is 2. . B. Wiltshire The shortest arc is AB. Connect B to A.

.Prim`s Algorithm Wiltshire All the nodes are now connected so this is the minimum connector or minimal spanning tree.

.Distance Table Wiltshire The Network can also be represented as a table. The infinity symbol (∞) means there is no edge between the two nodes.

see if you can relate the procedure to the last example. Prim`s is more suitable than Kruskal`s as computers have a problem recognising loops. As you go through the algorithm.Prim`s on a Distance Table Wiltshire We are going to apply Prim`s algorithm to the distance table. . This demonstrates how a computer could apply the algorithm.

Prim`s on a Distance Table Step 1 – Step 2 – Step 3 – Step 4 – Step 5 – Step 6 – Step 7 – Wiltshire Select any arbitrary node. Delete the row and loop the column that correspond to the node selected. Choose the smallest number in any loop. . 5 and 6 until all rows have been deleted and columns looped. Loop the column that corresponds to the row just deleted. Choose the smallest number in the loop. Delete the row that this smallest number is in. Repeat steps 4.

Loop the column. .Prim`s on a Distance Table Here I have chosen F. Wiltshire Select the smallest Delete the row. number in the loop.

number in any loop that is not crossed out.Prim`s on a Distance Table Delete row C. . Wiltshire Select the smallest Loop column C.

. Wiltshire Select the smallest Loop column D.Prim`s on a Distance Table Delete row D. number in any loop that is not crossed out.

number in any loop that is not crossed out. Wiltshire Select the smallest Loop column E.Prim`s on a Distance Table Delete row E. .

number in any loop that is not crossed out.Prim`s on a Distance Table Delete row A. Wiltshire Select the smallest Loop column A. .

. Wiltshire Loop column B.Prim`s on a Distance Table Delete row B.

Prim`s on a Distance Table Wiltshire The algorithm is complete when all the columns have been looped and the rows crossed out. The circles show the edges in the minimum connector. .

AF. CF.Prim`s on a Distance Table In this case they are AB. DF Wiltshire Can you explain why this procedure is exactly the same as applying Prim`s algorithm? . DE.

- MST.ppt_0
- Large Print SMC15 Solutions
- Solving Diophantine Equations
- mathgen-399503404
- SQComplement
- Prime Numbers
- Jignesh Ki Biasdasdasd
- Number Series(1)
- System Software
- Problem
- How to Understand Order
- ACM - UVA 341 - MinPath Backtrack
- R09220505-DESIGNANDANALYSISOFALGORITHMS
- Number Theory
- REVIEW1 (1)
- List of Perfect Numbers
- The Next Generation of Proof Assistants
- gma1-2-2012-continut
- T10-6 MS.pdf
- 2 Number System
- Counting
- 05jp
- Lect 2A
- Robinson, Julia Bowman.pdf
- Spanning Tree[1]
- L18
- Mathematics Class 10 CBSE (NCERT)
- Life Skills - Math Puzzles - Mathematical Induction Puzzles.pdf
- 04 Skema Tlo Mte3101
- mf

- Jadual Tugasan Guru Perkhemahan Tkrs
- rpp_mohon_kelompok
- prim algo
- Langkah 1&2 Gagne
- Decision Maths 1 Algorithms
- - Rph Pj (Kssr) Thn2
- ORGANISASI
- Dijkstra Algorithm 12.6.09
- PEKELILING GAJI
- - Rph Pj (Kssr) Thn2
- Tiramisu
- Soalan5(a)
- Fokus soalan edu 3103
- Sejarah Teori Pembelajaran Behaviorisme
- 28428335 Modul Bmm 3104 Kemahiran Mendengar Bertutur Membaca Menulis
- prim algo
- Decision Maths 1 Algorithms
- Seruan Hati Ku (Albi Nadak)

Sign up to vote on this title

UsefulNot usefulClose Dialog## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

Loading