Nothing Specail 4
Nothing Specail 4
Discrete Mathematics
Farnham Trois-Rivières
200 100
150 150
Sherbrooke 170
200 200 Bedford
200 Cowansville
160
Granby
Farnham Trois-Rivières
200 100
150 150
Sherbrooke 170
200 200 Bedford
200 Cowansville
160
Granby
Farnham Trois-Rivières
100
150 150
Sherbrooke 170
Bedford
Cowansville
160
Granby
Definition
A minimum spanning tree, in a connected weighted graph, is a
spanning tree that has the smallest possible sum of weights of its
edges.
a 2 b 3 c 1 d
3 1 2 5
4 f 3 g 3
e h
4 2 4 3
3 3 1
i j k l
Find the edges {b, f }, {c, d} and {k, l } with minimum cost.
a 2 b 3 c 1 d
3 1 2 5
4 f 3 g 3
e h
4 2 4 3
3 3 1
i j k l
Initialise the minimum spanning tree T with the edge {b, f }, which
is the first in lexicographic order amongst the minimum edges.
a 2 b 3 c 1 d
3 1 2 5
4 f 3 g 3
e h
4 2 4 3
3 3 1
i j k l
a 2 b 3 c 1 d
3 1 2 5
4 f 3 g 3
e h
4 2 4 3
3 3 1
i j k l
a 2 b 3 c 1 d
3 1 2 5
4 f 3 g 3
e h
4 2 4 3
3 3 1
i j k l
Add the edges {c, g }, {c, d}, {g , h}, {h, l } and {k, l } to T .
a 2 b c 1 d
3 1 2
f 3 g 3
e h
2 3
3 1
i j k l
a 2 b 3 c 1 d
edge $
edge $
{b, f } 1
{g , h} 3
3 1 2 5 {c, d} 1
{h, l } 3
4 f 3 g 3 {k, l} 1
e h {i , j} 3
{a, b} 2
{j, k} 3
{c, g } 2
4 2 4 3 {e, f } 4
{f , j} 2
3 3 1 {e, i } 4
{a, e} 3
{g , k} 4
i j k l {b, c} 3
{d, h} 5
{f , g } 3
List of edges of G sorted by weight.
a 2 b 3 c 1 d
edge $
edge $
{b, f } 1
3 1 2 5 {g , h} 3
{c, d} 1
4 f 3 g 3 {h, l } 3
e h {k, l } 1
{i , j} 3
{a, b} 2 {j, k} 3
4 2 4 3 {c, g } 2
{e, f } 4
3 3 1 {f , j} 2
{e, i } 4
{a, e} 3
i j k l {g , k} 4
{b, c} 3
{d, h} 5
Add the edges {b, f }, {c, d} and {f , g } 3
{k, l }.
a 2 b 3 c 1 d
edge $
edge $
{b, f } 1
3 1 2 5 {g , h} 3
{c, d} 1
4 f 3 g 3 {h, l } 3
e h {k, l } 1
{a, b} 2 {i , j} 3
{j, k} 3
4 2 4 3 {c, g } 2
{e, f } 4
3 3 1 {f , j} 2
{e, i } 4
{a, e} 3
i j k l {g , k} 4
{b, c} 3
{d, h} 5
Add the edges {a, b}, {c, g } and {f , g } 3
{f , j}.
a 2 b 3 c 1 d
edge $
3 1 2 5 edge $
{b, f } 1
4 f 3 g 3 {g , h} 3
e h {c, d} 1
{h, l } 3
{k, l } 1
{i , j} 3
4 2 4 3 {a, b} 2
{c, g } 2 {j, k} 3
3 3 1
{f , j} 2 {e, f } 4
i j k l {a, e} 3 {e, i } 4
{g , k} 4
Add the edges {a, e}, {b, c}, {g , h}, {b, c} 3
{d, h} 5
{h, l } and {i , j}. The edge {f , g } {f , g } 3
was not added because it forms a
circuit.
a 2 b 3 c 1 d edge $
{b, f } 1 edge $
{c, d} 1 {g , h} 3
3 1 2 {h, l } 3
f g 3 {k, l } 1
e h {i , j} 3
{a, b} 2
{j, k} 3
{c, g } 2
2 {e, f } 4
{f , j} 2
3 3 1 {e, i } 4
{a, e} 3
{g , k} 4
i j k l {b, c} 3
{d, h} 5
Final solution. {f , g } 3