Explanation of minimal spanning tree
The table below shows the order in which nodes are added to the minimal spanning tree rooted at node 0.
In each iteration, a new node is added to the tree, and the distance to that node from all nodes adjacent to it are updated.
Refresh the page to see
another randomly generated unweighted graph.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 0 | inf | inf | inf | inf | inf | inf | inf | inf | inf |
| 0 | inf | inf | inf | inf | 1 | 9 | inf | inf | 4 |
| 0 | inf | inf | inf | inf | 1 | 9 | inf | 8 | 4 |
| 0 | 7 | inf | inf | 19 | 1 | 9 | inf | 8 | 4 |
| 0 | 7 | inf | inf | 19 | 1 | 1 | inf | 8 | 4 |
| 0 | 7 | 12 | inf | 8 | 1 | 1 | 16 | 8 | 4 |
| 0 | 7 | 1 | inf | 8 | 1 | 1 | 11 | 8 | 4 |
| 0 | 7 | 1 | inf | 8 | 1 | 1 | 7 | 8 | 4 |
| 0 | 7 | 1 | 15 | 8 | 1 | 1 | 7 | 8 | 4 |
| 0 | 7 | 1 | 15 | 8 | 1 | 1 | 7 | 8 | 4 |