In a connected, undirected graph, a spanning tree,T, is a subgraph that connects all nodes on the network. Given that each arc has a weightcij, the length (or cost) of the spanning tree is equal to the sum of the weights of all arcs on that tree, that is,
(i,j)∈Tcij. The minimum spanning tree problem identifies the spanning tree with the minimum length. In other words, a minimum spanning tree is a spanning tree with a length less than or equal to the length of every other spanning tree. The minimum spanning tree problem is similar to the shortest path problem discussed in Section 4.4, with the following differences: In shortest
TABLE 4.4 Solving an Assignment Problem Using the Hungarian Method
2 0 4
6 0 0
0 2 0
5 1 1 1
1
1 5 3 1
4 0 0
0 2 6
0 4 2
Column Minimum Row Minimum
0 0 0
(a) Subtract the row minimum (b) Subtract the column minimum
Uncovered minimum⫽2
4 0 0
0 2 6
0 4 2
(c) Minimum number of lines to cover zeros is two, thus not optimal
(d) Minimum number of lines to cover zeros is three, thus optimal
6 0 0
2 0 4
0 2 0
5 1 1
1 3 7
1 5 3
(e) Assignment of jobs to machines on the modified cost matrix
(f) Assignment of jobs to machines on the orignal
cost matrix, total cost⫽5
1 3 7
path problems, the objective is to determine the minimum total cost of a set of links (or arc) that connect source to sink. In minimum spanning tree problems, the objective is to select a minimum total cost set of links (or arcs) such that all the nodes are connected and there is no source or sink node. The optimal shortest path tree from an origin to all other nodes is a spanning tree, but not necessarily a minimum spanning tree.
Minimum spanning tree problems have several applications, specifically in network design.
For example, the following problems can be optimized by minimum spanning tree algo- rithms: connecting different buildings on a university campus with phone lines or high-speed Internet lines while minimizing total installation costs; connecting different components on a printed circuit board to minimize the length of wires, capacitance, and delay line effects;
and constructing a pipeline network connecting a number of towns to minimize the total length of pipeline.
4.7.1 Linear Programming Formulation
LetA(S)⊆Adenote the set of arcs induced by the node setS, that is, if (i, j)∈A(S) then i∈S andj∈S. The linear programming formulation can be stated as follows:
Minimize:
(i,j)∈A
cijxij (4.19)
Subject to:
(i,j)∈A
xij=|N| −1 (4.20)
(i,j)∈A(S)
xij=|S| −1 S⊆N (4.21) xij ∈ {0,1} (i, j)∈A (4.22) In this formulation,xijis the decision variable that identifies if arc (i, j) should be included in the spanning tree. The objective is to minimize the total cost of arcs included in the spanning tree. In a network with |N| nodes, |N| −1 arcs should be included in the tree (Equation 4.20). Using Equation 4.21, we ensure that there are no cycles on the minimum spanning tree subgraph. Note that whenA(S) =A, Equations 4.20 and 4.21 are equivalent.
4.7.2 Kruskal’s Algorithm
Kruskal’s algorithm builds an optimal spanning tree by adding one arc at a time. By defining LIST as the set of arcs that is chosen as part of a minimum spanning tree, Kruskal’s algorithm can be stated as follows:
Step 1: Sort all arcs in non-decreasing order of their costs to obtain the setA. Step 2: Set LIST = ỉ.
Step 3: Select the arc with the minimum cost, and remove this arc fromA. Step 4: Add this arc to the LIST if its addition does not create a cycle.
Step 5: If the number of arcs in the list is|LIST|=|N| −1, then stop; arcs in the LIST form a minimum spanning tree. Otherwise, go to step 3.
In the example below, a network design problem is considered. In this problem, Wichita State University has six buildings that are planned to be connected via a gigabit network.
The cost of connecting the buildings (in thousands) for which there can be a direct con- nection is given in Figure 4.5a. Using Kruskal’s algorithm, the minimum cost design of the gigabit network for Wichita State University is determined. First, all arcs are sorted in nondecreasing order of their costs: (5,6), (4,5), (1,2), (2,4), (4,6), (1,3), (2,5), (3,5), and (2,6). In the first four iterations, arcs (5,6), (4,5), (1,2), and (2,4) are added, that is, the LIST ={(5,6), (4,5), (1,2), (2,4)}(see Figure 4.5b–e). In the fifth iteration, arc (4,6) cannot be added as it creates the cycle 4-5-6 (see Figure 4.5f). Finally, when arc (1,3) is added to the LIST, all nodes on the network are connected, that is, the minimum spanning tree is obtained. As shown in Figure 4.5g, the minimum spanning tree is LIST ={(5,6), (4,5), (1,2), (2,4),(1,3)}, and the total cost of the minimum cost tree is 10 + 10 + 20 + 20 + 25 = 85.
Other types of minimum spanning tree problems (Garey and Johnson 1979) are as follows:
A degree-constrained spanning tree is a spanning tree where the maximum vertex degree is limited to a certain constant k. The degree-constrained spanning tree problem is used to determine if a particular network has such a spanning tree for a particular k. In the maximum leaf spanning tree problem, the goal is to determine if the network has at least
1
2 4
3 5 6 20
25
35 55
35
10 25
10 20
1
2 4
3 5
6 20
25
35 55
35
10 25
10 20
1
2 4
6 20
25
35 55
35
10 25
10 20
(a) (b)
(c) (d)
(e) (f)
(g)
1
2 4
3
6 20
25
35 55
35
10 25
10 20
1
2 4
6 20
25
35 55
35
10 25
10 20
1
2 4
3 5
6 20
25
35 55
35
10 25
10 20
1
2 4
3 5
6 20
25
35 55
35
10 25
10 20
5
3 5
FIGURE 4.5 Application of Kruskal’s algorithm to determine the minimum spanning tree for the net- work shown in Figure 4.5a. (a) Original network. (b) Arc (5,6) is added. (c) Arc (4,5) is added. (d) Arc (1,2) is added. (e) Arc (2,4) is added. (f) Arc (4,6) cannot be added as it creates a cycle. (g) Arc (1,3) is added. Algorithm terminates.
k nodes having a degree 1, wherek <|N|. In the shortest total path length spanning tree problem, the goal is to ensure that the distance between any two nodes on the minimum spanning tree is less than a constantB.