Professional Documents
Culture Documents
CONTENTS
10
25
30
20
35
35
25
10
20
30
40
40
15
3
2
15
Applications
l Construct a pipeline network to connect a number of towns
using the smallest possible total length of the pipeline.
10
30
15
35
40
6
20
25
3
35
Notation
20
10
30
15
35
40
6
20
25
3
35
l For any nontree arc (k, l), let P[k, l] denote the unique tree
path from node k to node l.
P[3, 5] : 3-1-2-4-5
P[5, 6] : 5-4-6
P[2, 3] : 2-1-3
l For any tree arc (i, j), let Q[i, j] denote the cut formed by
deleting the arc (i, j) from T.
Q[1, 2] : {(1, 2), (3, 2), (3, 5)}
Q[1, 3] : {(1, 3), (3, 2), (3, 5)}
Q[2, 4] : {(2, 4), (2, 5), (3, 5)}
5
T*
i
T*
i
10
30
15
35
40
6
20
25
3
35
A Simple Algorithm:
Replace a lower cost nontree arc with a higher cost tree arc.
Repeat until no such pair of arcs remains.
Time per iteration: O(nm)
Number of iterations: O(m 2)
Total time: O(nm 3)
8
Kruskals Algorithm
l Sort all arcs in the non-decreasing order of their costs.
l Set T * = , a tree null.
l Examine arcs one-by-one in the sorted order and add them to
T* if their addition does not create a cycle.
Kruskals Algorithm
10
10
35
35
25
20
30
25
30
20
10
35
15
10
35
25
20
30
40
15
15
10
35
25
20
30
40
30
20
40
15
25
40
35
40
10
25
20
30
40
10
15
15
Kruskals Algorithm
l BASIC OPERATIONS:
u Maintain a collection of subsets
u Find operation: Find whether the subsets containing
11
Prims Algorithm
l This algorithm is a by-product of the cut optimality
conditions and in many ways, it is similar to Dijkstra's
shortest path algorithm.
Prims Algorithm
10
10
35
35
25
20
30
25
30
20
10
35
15
10
35
25
20
30
40
15
15
10
35
25
20
30
40
30
20
40
15
25
40
35
40
10
25
20
30
40
13
15
15
Sollins Algorithm
l This algorithm is also a by-product of the cut optimality
conditions.
15
Sollins Algorithm
10
10
20
35
35
25
20
30
1
20
40
15
10
35
20
16
15
15
10
30
15
35
40
20
25
3
35
17
18
10
30
15
35
40
20
25
3
35