Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Prim's Minimum Spanning Tree
Bookmark
Input
Graph 1
Graph 2
Small
Custom
n
=
5
,
edges
=
[[0,1,2],[0,3,6],[1,2,3],[1,3,8],[1,4,5],[2,4,7],[3,4,9]]
Prim's MST Algorithm
2
6
3
8
5
7
9
0
1
2
3
4
Total MST Weight:
0
In MST:
0
F
1
F
2
F
3
F
4
F
Legend:
Unvisited
Considering
Current
In MST
MST Edge
algo
master
.
io
Step:
Start: Prim's MST Algorithm. Begin from node 0.
0 / 26
Input
Graph 1
Graph 2
Small
Custom
n
=
5
,
edges
=
[[0,1,2],[0,3,6],[1,2,3],[1,3,8],[1,4,5],[2,4,7],[3,4,9]]
0 / 26
Prim's MST Algorithm
2
6
3
8
5
7
9
0
1
2
3
4
Total MST Weight:
0
In MST:
0
F
1
F
2
F
3
F
4
F
Legend:
Unvisited
Considering
Current
In MST
MST Edge
algo
master
.
io
Step:
Start: Prim's MST Algorithm. Begin from node 0.