Introduction to Prim's Algorithm
What is Prim's algorithm?
- Prim's algorithm is another method of finding the minimum spanning tree in a network
- It can be used when the information for a network is given as a graph or in a matrix
Author
Naomi CLast updated
Consider the network, G, below.
The adjacency matrix of a network, is shown below.
A | B | C | D | E | |
A | - | 15 | 22 | 18 | 25 |
B | 15 | - | 13 | 17 | 24 |
C | 22 | 13 | - | 30 | 12 |
D | 18 | 17 | 30 | - | 21 |
E | 25 | 24 | 12 | 21 | - |
AB (15)
AB (15), BC (13)
AB (15), BC (13), CE (12)
AB (15), BC (13), CE (12), DE (17)
All vertices have been selected
You should have a list of the order in which the edges were selected
Edges added in the order: AB (15), BC (13), CE (12), BD (17)
the (exam) results speak for themselves:
Did this page help you?
Expertise: Maths
Naomi graduated from Durham University in 2007 with a Masters degree in Civil Engineering. She has taught Mathematics in the UK, Malaysia and Switzerland covering GCSE, IGCSE, A-Level and IB. She particularly enjoys applying Mathematics to real life and endeavours to bring creativity to the content she creates.