first need to understand two types of graphs:
NOTE: total number of spanning trees with n
vertices that can be created from complete graph is equal to n^(n-2)
- with n = 4
, max possible number of spanning trees equal to 4^(4-2) = 16
original graph:
A - B
| |
D - C
some possible spanning trees that can be created from above graph:
// 1
A - B
|
D - C
// 2
A - B
|
D - C
// 3
A B
| |
D - C
// 4
A - B
| |
D C
// 5
A - B
| \
D C
// 6
A B
| / |
D C
original graph:
4
A - B
5 | | 1
D - C
2
possible spanning trees from above graph:
// 1
// - sum = 11
4
A - B
5 |
D - C
2
// 2
// - sum = 8
A B
5 | | 1
D - C
2
// 3
// - sum = 10
4
A - B
5 | | 1
D C
// 4 (the minimal spanning tree)
// - sum = 7
4
A - B
| 1
D - C
2
Minimum spanning tree from graph is found using following algorithms: