24
Algorithms for the Constrained Maximum-Weight Connected Graph Problem Heungsoon Felix Lee * Industrial Engineering, Southern Illinois University, Edwardsville, Illinois 62026 Daniel R. Dooly Computer Science, Southern Illinois University, Edwardsville, Illinois 62026 Given a positive integer R and a weight for each vertex in a graph, the maximum-weight connected graph ( MCG) problem is to find a connected subgraph with R vertices that max- imizes the sum of the weights. The MCG problem is strongly NP-complete, and we study a special case of it: the constrained MCG (CMCG) problem, which is the MCG problem with a constraint of having a predetermined vertex included in the solution. We first show that the Steiner tree problem is a special case of the CMCG problem. Then we present three optimization algorithms for the CMCG problem. The first two algorithms deal with special graphs (tree and layered graphs) and employ different dynamic programming techniques, solving the CMCG problem in polynomial times. The third one deals with a general graph and uses a variant of the Balas additive method with an imbedded connectivity test and a pruning method. We also present a heuristic algorithm for the CMCG problem with a gen- eral graph and its bound analysis. We combine the two algorithms, heuristic and optimiza- tion, and present a practical solution method to the CMCG problem. Computational results are reported and future research issues are discussed. 0 1996 John Wiley & Sons, Inc. I. INTRODUCTION Consider a positive integer R and an undirected graph G = (V, E), in which each vertex is assigned a weight (or value). The maximum-weight connected graph (MCG) problem is to find a subgraph with R vertices that is connected and maximizes the sum of the weights (or values) of the R vertices. Lee and Dooly [ 71 prove that the MCG problem is strongly NP-complete for even a partially connected bipartite graph, and present various decompo- sition algorithms that can significantly reduce computation. These algorithms decompose the MCG problem into a number of small-sized one-vertex-fixed MCG (CMCG) prob- lems, where the CMCG problem is the MCG problem with a constraint of having a prede- termined vertex included in the solution. In this article we study the CMCG problem and present several algorithms to solve it. MCG/CMCG problems have potential applications to communication network design problems [ 81 and facility expansion problems. For example, suppose we have designed an optimal fiber-optic network to connect node set V. The topology of the designed network is represented by G = (V, E). The nodes are assigned values reflecting the degree of impor- tance to be included in the network. Because of, for example, a budget constraint, we want * Correspondence author. Naval Research Logistics, Vol. 43, pp. 985- 1008 ( 1996) Copyright 0 1996 by John Wiley &Sons, Inc. CCC 0894-069X/96/070985-24

Algorithms for the constrained maximum-weight connected graph problem

Embed Size (px)

Citation preview

Page 1: Algorithms for the constrained maximum-weight connected graph problem

Algorithms for the Constrained Maximum-Weight Connected Graph Problem

Heungsoon Felix Lee * Industrial Engineering, Southern Illinois University, Edwardsville, Illinois 62026

Daniel R. Dooly Computer Science, Southern Illinois University, Edwardsville, Illinois 62026

Given a positive integer R and a weight for each vertex in a graph, the maximum-weight connected graph ( MCG) problem is to find a connected subgraph with R vertices that max- imizes the sum of the weights. The MCG problem is strongly NP-complete, and we study a special case of it: the constrained MCG (CMCG) problem, which is the MCG problem with a constraint of having a predetermined vertex included in the solution. We first show that the Steiner tree problem is a special case of the CMCG problem. Then we present three optimization algorithms for the CMCG problem. The first two algorithms deal with special graphs (tree and layered graphs) and employ different dynamic programming techniques, solving the CMCG problem in polynomial times. The third one deals with a general graph and uses a variant of the Balas additive method with an imbedded connectivity test and a pruning method. We also present a heuristic algorithm for the CMCG problem with a gen- eral graph and its bound analysis. We combine the two algorithms, heuristic and optimiza- tion, and present a practical solution method to the CMCG problem. Computational results are reported and future research issues are discussed. 0 1996 John Wiley & Sons, Inc.

I . INTRODUCTION

Consider a positive integer R and an undirected graph G = (V, E ) , in which each vertex is assigned a weight (or value). The maximum-weight connected graph (MCG) problem is to find a subgraph with R vertices that is connected and maximizes the sum of the weights (or values) of the R vertices. Lee and Dooly [ 71 prove that the MCG problem is strongly NP-complete for even a partially connected bipartite graph, and present various decompo- sition algorithms that can significantly reduce computation. These algorithms decompose the MCG problem into a number of small-sized one-vertex-fixed MCG (CMCG) prob- lems, where the CMCG problem is the MCG problem with a constraint of having a prede- termined vertex included in the solution. In this article we study the CMCG problem and present several algorithms to solve it.

MCG/CMCG problems have potential applications to communication network design problems [ 81 and facility expansion problems. For example, suppose we have designed an optimal fiber-optic network to connect node set V . The topology of the designed network is represented by G = ( V , E ) . The nodes are assigned values reflecting the degree of impor- tance to be included in the network. Because of, for example, a budget constraint, we want

* Correspondence author.

Naval Research Logistics, Vol. 43, pp. 985- 1008 ( 1996) Copyright 0 1996 by John Wiley &Sons, Inc. CCC 0894-069X/96/070985-24

Page 2: Algorithms for the constrained maximum-weight connected graph problem

986 Nuval Research Logistics, Vol. 43 ( 1996)

to set up the network in multiple phases. In the first phase, we select R , nodes such that the resulting network (subgraph of G) is connected and the sum of the node values can be maximized. In the second phase, we expand the network created in the first phase by adding R2 nodes such that the expanded network is connected and the sum of the added node values is maximized. We continue to expand the network in a similar manner until the initial network design is fully installed. To the first phase we can apply the MCG, whereas to each of all the following phases, we can apply the CMCG by consolidating the network created so far into one node and treating this node as the fixed node in the CMCG problem.

There are also other problems or applications in the literature that are related to MCG/ CMCG problems. We will show that the well-known Steiner tree problem is a special case of the CMCG problem. A more generic problem, called the induced connected subgraph with property I1 [4] is classified under a collection of NP-complete problems. Given k specified target nodes and a node failure probability (node weight) for each node, the k- terminal reliability problem [ 51 with node failures seeks a tree that maximizes the proba- bility that the tree is operational; that is, there exists a path between any pair in the k nodes. One approach to this problem is to apply the CMCG with a surrogate objective of minimizing the weight sum of nodes, where the solution of the CMCG problem includes the predetermined k nodes instead of one. A similar application is the uncapacitated net- work design problem [ I ] , where k nodes communicate with each other and there is a fixed cost for each node. This problem seeks intermediate nodes minimizing total node cost so that the resulting subgraph is connected.

The rest of the article is organized as follows. In Section 2, we discuss a relationship between the MCG and the CMCG and present a network-flow formulation for the CMCG. In Section 3 , we investigate the relationship between the CMCG problem and the Steiner tree problem. In Section 4, we present two efficient algorithms to solve the CMCG problem for two special graphs, and we present heuristic and optimization algorithms in Section 5 to solve the CMCG problem for a general graph. In Section 6, we present experimental results with these algorithms to solve CMCG and MCG problems. In Section 7, we intro- duce the improved optimization algorithm that is particularly effective for a sparse graph and its experimental results. Finally, in Section 8, we conclude the article and suggest di- rections for future research.

2. THE MCG AND CMCG PROBLEMS

Lee and Dooly [ 7 ] present three decomposition algorithms to solve the MCG problem. Each algorithm consists of a main procedure and a subroutine. The main procedure sys- tematically fixes one vertex and calls the subroutine to solve the CMCG problem with that vertex fixed. They show that different algorithms significantly affect the number of times CMCG problems are solved and their sizes (i.e., the number of vertices in the CMCGs), consequently affecting computation required to solve the MCG problem. Depending on graph density and the value of R , these algorithms require only 6 to 60% of the number of CMCG problems solved by complete enumeration (i.e., solving CMCG problems n times with size n for each CMCG, where n = I V I ) . The size of CMCG problems solved is also smaller, which is just 33% to 66% of the size of those solved in complete enumeration. However, their study does not address any algorithm to solve CMCG problems. The pur- pose of this article is to investigate algorithms to solve the CMCG problem and thereby to make the solution method to the MCG problem complete.

Page 3: Algorithms for the constrained maximum-weight connected graph problem

Lee and Dooly: Constrained Maximum-Weight Graph Problem 987

We give the simplest algorithm among the three algorithms below. Numbering vertices 1 to y1 , we first let G, be the subgraph induced by the first i vertices and Gi = (V, , E j ) be the connected component of Gi containing vertex i.

Algorithm MAIN: An algorithm for MCG problems

Input: G=( V,E), 1 Vl = n , R , and value v, at vertex i for all i Output: the optimal solution, V, and its value sum, z

for i=R to n, do begin if 1 V, I L R , then begin

Solve CMCG for G, with vertex i fixed update z and L‘, if a better solution is found

end { if} end { do for)

It is interesting to interpret the CMCG problem as a network flow problem. Consider G, = ( V, , E, ) with vertex i fixed. Fixed vertex i can be viewed as a source node where R- 1 units enter the network. R-1 additional vertices are connected with the fixed vertex and are viewed as sink nodes from each of which one unit leaves the network. Connectivity among the R vertices imposes a constraint on the network that there exists a path between the source node and each of the sink nodes. Thus, the CMCG problem can be formulated as the following network flow optimization problem:

Maximize 2 v,6,,

subject to C x,, = R-1,

J E l ’ -

, c I,-

2 x j k s ( R - l ) & , fo ra l lkE Y - , j E L’,

( 3 )

x r k € { O , 1 , . . . , R - l } , 6 , ~ { 0 , I ) , f o r a l l j ~ V i a n d a l l k ~ Y - , ( 4 )

where V - = V , - { i} and x,~ is units of flow from node; to node k. Note that each edge in G, is viewed as two directional arcs in this network flow formulation. Clearly x,, = 0 for all j . If there is no edge between j and k in graph G I , then XJh = 0 and xh , = 0.

Constraint ( 1 ) means that R- 1 units enter the network through source node i. Constraint ( 2 ) means that one unit leaves the network through sink node k when BA = 1. When = 0, flow at node k is simply conserved; that is, at node k units of flow in equals units of flow out. Constraint ( 3 ) ensures the connectivity constraint that a path exists between the source node and each sink node by making a node with positive flow-in units a sink node. Given the above mathematical formulation for a CMCG, one may attempt to solve the associated linear programming problem after replacing constraint ( 4 ) by 0 I x,~ I R- 1 and 0 5 6k I

1. This may not work, because the optimal solution of the linear programming problem is

Page 4: Algorithms for the constrained maximum-weight connected graph problem

988 Naval Resseurch Logistics. Vol. 43 ( 1996)

not guaranteed to be integer valued because the coefficient matrix of constraints ( 1 ) to ( 3 ) is not totally unimodular [ 91.

3. THE CMCG AND STEINER TREE PROBLEMS

We define the undirected Steiner tree problem with nonnegative weights as follows: Given a connected undirected graph G = (V , E ) , a subset V, C V, and an edge weight function w : E + [0, a), find a connected subgraph G' = (V' , E ' ) that has the smallest sum of its edge weights, where Vq C V'. The Steiner tree problem is NP-complete and has numerous applications [ 101. In this section, we show by a graph transformation that the Steiner tree problem is a special case of the CMCG problem.

For any graph G = (V, E ) with weighted edges, and for any V, C V, we let the G,-dual graph of G be the graph obtained by ( a ) replacing each edge e between vertices i and j and its weight we with a new vertex k and a new weight W - w, and two new unweighted edges between i and k and between j and k , where W is any number greater than the weight of any edge in G; ( b ) assigning to all vertices in V - V,, the weight 2 1 V I I W , and ( 3 ) assigning to any vertex in V4 a weight, largestweight, greater than the sum of the weights of any 2 1 V 1 vertices not in V,. For any edge in G, let the corresponding portion of the G,-dual graph be the edges and vertex replacing it. For any vertex in G, let the corresponding vertex be itself. For any subgraph G, of G, let the G,-dual graph of G, be the subgraph of the G,- dual graph of G that contains the edges and vertices that correspond to the edges and vertices of G,. Using this transformation, we present Algorithm STEINER below. This solves the Steiner tree problem with the use of CMCGs.

Algorithm STEINER: to solve the Steiner tree problem with the use of CMCGs

I n p u t : a g r a p h G = ( V , E ) , V,C V, IVI=n, IV,( =q,weightw,foreachedge

Output: The Steiner tree bes t se t and its edge sum bes t sum

Begin

C € E

Convert G to its G,-dual graph, Gd bes tsum t -a pick a vertex i in V, solve CMCG with fixed vertex i and R=2n - 1 to give value-sum and temp-set

for j from 24- I to 2n - 1 increased by 2 do arrays for a l l j < R

if 4. largestweight < value-sum[ j ] and bes t sum < value-sum[j] then best-sum c edge sum corresponding to temp-set [ j ] bes tse t e edges corresponding to temp-set [ j ]

{ end if } { end for }

End.

THEOREM 1: Algorithm STEINER solves the Steiner tree problem. PROOF: Each node in Gd corresponding to a required node of G weighs more than

any possible combination of R nodes not corresponding to required nodes of G. Each node in Gd corresponding to a nonrequired node in G weighs more than any possible combina-

Page 5: Algorithms for the constrained maximum-weight connected graph problem

Lee and Dooly: Constrained Maximum-Weight Graph Problem 989

tion of R nodes corresponding to edges from G. For all k, for any two sets of k nodes in G corresponding to edges in G, El and E2, the edge weight sum of El in G < that of E2 if and only if the node weight sum of the nodes corresponding to El in Gd > that of E2. Therefore, whenj and R are odd, each solution to the CMCG problem on Gd corresponds to a tree on G that contains ( j - 1 ) /2 edges and has the least edge weight of any such tree. Because the number of edges in a solution to the Steiner tree problem must be between q - 1 and n - 1, one of these trees must be a solution to the Steiner problem.

It appears that it is not possible to transform the CMCG problem into the Steiner tree problem. It was possible to replace a weighted edge with a weighted node and two un- weighted edges, because each edge connects exactly two nodes. However, replacing a weighted node with a set of unweighted nodes and weighted edges can cause many edges to end in the same node.

4. ALGORITHMS FOR THE CMCG PROBLEM WITH SPECIAL GRAPHS

We show in this section that there exist efficient algorithms for the CMCG problem when a graph is of a special form.

4.1. Undirected Tree

Consider the CMCG problem where a graph is an undirected tree T . We show that this special CMCG problem is transformed into the tree knapsack problem for an out tree, To = (V, A ) , where A is a set of precedence arcs among vertices in V such that every arc is directed away from the fixed vertex. For To = (V , A ) , a subset V, E V is said to be closed under predecessor i fkE Vsand arc(j, k) € A implyjE V , . Then, the tree knapsack problem seeks a subset V, E V that is closed under its predecessor, such that its weight does not exceed the knapsack size R and its value is maximized [ 61.

When weights of vertices are unequal nonnegative integers, Johnson and Niemi [ 61 give an improved version of a pseudopolynomial algorithm to solve the tree knapsack problem for an out tree To in O ( n - Q), where Q is an upper bound of the optimal solution value. Under the equal weight condition, we can modify their algorithm to solve the tree knapsack problem in O( n . R ) time and with O( n . R) additional storage space. A set of R vertices containing the fixed vertex are connected in Tiff they are closed under predecessors in an out tree To that is derived from T by setting the fixed vertex in T as a root of To and replacing an edge with an arc directed away from the fixed vertex. As a result, we can apply the same algorithm to the CMCG problem for an undirected tree.

4.2. Complete Layered Graphs

A complete layered graph (CLG) can be viewed as levels of parallel vertices. There is an edge connecting every pair of vertices drawn from two adjacent levels. However, there is no edge between a pair of vertices within the same level or from two nonadjacent levels. We assume that vertices on each level are sorted in nondecreasing order of 21,. Thus, a CLG is described by two parameters: Gj = ( L , F) where L is the number of levels and Z is a vector with n, representing the number of vertices at level p . The fixed vertex i is at level 0 and level index p can be negative.

Page 6: Algorithms for the constrained maximum-weight connected graph problem

990 Naval Research Logistics, Vol. 43 ( 1996)

We first consider a special CLG, a left (right) CLG, where level 0 is the leftmost (rightmost) level and has only one vertex, that is, the fixed vertex. We first define S,(j) as the value sum o f j largest valued vertices in level p ; f , ( r ) as the maximum value sum of Y

vertices that are connected with the fixed vertex and are drawn from levels 1 t o p such that at least one vertex is from level p ; and n,( r ) as the number of vertices drawn from level p among r vertices in&( r ) .

LEMMA: & ( r + 1 ) = & ( r ) + max{Af;(r + 1 - n 2 ( r ) ) , AS2(n2(r) + I ) } , where Af,(J) = f i ( j ) - . f ; ( j - l)andAS,(j)= S 2 ( j ) - S 2 ( j - 1)forallpossiblej.

PROOF: Lettingg( k ) = f i ( r + 1 - k ) + S , ( k ) , we will show&( r + 1 ) 2 g ( k ) for all k . (Case 1 ) when k 5 n2( r ) . We rewrite g ( k ) asg(k) = f i ( r - k ) + S 2 ( k ) + Af;(r + 1 - k ) . By definition&( r ) rf; ( Y - k ) + S2( k ) . Also Afi ( r + 1 - n2( Y)) 2 Afi ( Y + 1 - k ) , because A(;) = S , ( j ) and AS, ( , j ) nonincreases with respect to; by definition of S , ( j ) . Thus, the result follows. (Case 2) when k > n2( r ) . We rewrite g ( k ) as g( k ) =.fi( r + 1 - k ) + S2( k - 1 ) + AS2(k). By definition,fi(r) 2 f i ( r + 1 - k ) + S 2 ( k - 1 ) . Also AS2(n2(r) + 1 ) 2

AS2( k ) . Thus, the result follows.

COROLLARY: Aj;( r ) is nonincreasing with respect to r. Similarly, we can prove re- cursively for levels 3,4, . . . , that the results ofthe above lemma and corollary hold. Hence, we can write the following recursive equation:

f ; , ( r> = S,(r) forp = 1,

= A, , ( r - 1 ) + S,( 1 ) forp 2 2 and r = p , where n,(r ) is set to 1,

= ,A,( r - 1 ) + max { AS,-, ( r - np( r - 1 )), AS,( n,( Y - 1 ) + 1 ) } for p 2 2 and r > p .

The optimal value for this CMCG is given as F( R-1 ) = max,, { .A,( R- 1 ) } ,

THEOREM 2: The dynamic programming (DP) algorithm using recursive equation ( 5 ) solves the CMCG problem for a left CLG in O( min(LR, R’)) time and with the same order of additional storage space.

PROOF: Given sorted vertices, computingf,( r ) requires a constant amount of com- putation and additional storage. Because p ranges from 1 to min { R- 1, L } and r ranges from p to min { R- 1, C f - I u/, } , the result immediately follows.

For a general CLGs, we can extend the above DP algorithm. A general CLG can be partitioned into three subgraphs: a left CLG and a right CLG, both sharing the fixed vertex, and the rest of vertices in level 0. The above DP algorithm is applied to both left and right CLGs, separately, and the resulting optimal values are denoted as F ( j ) L and F ( j ) R , respectively, in place of F ( j ) for; = 1 to R-1. Also, F ( 0 ) L and F ( 0 ) R are set to 0. Then, the optimal value of the CMCG for a general CLG is given as max,.k { F( j ) ’ , + F( k ) R + So( R- 1 - j - k ) 1 for all nonnegative j and k such that 1 5 j + k I R-1. Note that this range

Page 7: Algorithms for the constrained maximum-weight connected graph problem

Lee and Dooly: Constrained Maximum-Weight Graph Problem 99 1

eliminates the case where all R-1 vertices are drawn from level 0; such vertices are not connected with the fixed vertex. Computation and storage requirements of the algorithm remain the same.

5. ALGORITHMS FOR THE CMCG PROBLEM WITH GENERAL GRAPHS

In this section, we present an optimization algorithm and a heuristic algorithm to solve the CMCG problem for a general graph. First, we present an optimization algorithm below that consists of three steps. The purpose of Step 1 is to reduce computation in Step 3 by eliminating vertices that cannot be in a solution. A vertex visited by BFS with depth R or more cannot be included in R-1 vertices connected with the fixed vertex since BFS finds the shortest path from the fixed vertex to each vertex visited. This step is particularly effective when R is small and a graph is sparse.

Algorithm OPT: an optimization algorithm for the CMCG problem for a general

Step 1 : Apply the breadth-first search (BFS) to identify vertices visited from the fixed vertex up to depth R- 1.

Step 2: Sort the vertices (excluding the fixed vertex) found from Step 1 in non- increasing order of value, and renumber these vertices in the sorted or- der. Apply to the sorted vertices the Balas additive method [ 21 with the con- nectivity test embedded.

graph

Step 3:

For Step 3 we use a variant of the Balas additive method [ 21, which is an enumeration scheme for solving 0- 1 integer programs. Our method implicitly enumerates all possible choices of R- 1 vertices among the sorted vertices by systematically fixing R- 1 0- 1 variables to one and the rest to zero such that sets of the large-valued vertices are considered first. For a chosen set of R-1 vertices, the connectivity of the R vertices is tested only when their value sum plus the value of the fixed vertex is greater than that of the incumbent solution. If they are connected, a better solution has been found and the incumbent solution is updated. When their value sum is not greater than that of the incumbent, several sets of R- 1 vertices can be fathomed, using the information on the ordering of vertex values. For example, if for R = 4 the value sum of the incumbent solution is greater than that of vertices { 1,3, 5 } and the fixed vertex, then sets of vertices { 1, 3, 6 } to { 1, 3, n - 1 } are fathomed. Step 3 is depicted in Figure 1, where yand j7 ( z and z * ) indicate the current set of R-1 vertices and the incumbent solution (their value sums), respectively. Testing connectivity of vcan be done in linear time by a variant of BFS. Thus, this optimization algorithm requires only O( n ) additional storage space.

EXAMPLE 1: The graph in Figure 2 has 10 vertices with parameter values specified as follows: R = 5 and vl = 1 1 - i for i = 1 to 10. Vertex 10 is fixed. No vertex is eliminated after Step 1, because all vertices can be visited from the fixed vertex 10 up to depth 4. A greedy heuristic algorithm is used to generate the initial solution. A greedy heuristic adopted here initially assigns the fixed vertex to the partial solution V, and repeatedly adds to V, a vertex with the largest value among vertices adjacent to V, until I V, I = R . This

Page 8: Algorithms for the constrained maximum-weight connected graph problem

992 Naval Research Logistics, Vol. 43 ( 1996)

No

Are7 and the fixed vertex connected?

z * <--

I No

Yes ~

Yes 1

+ I YR-1 <-- yR-l

.i <-- R-1

z <-- z + value of vertex y ~ - ~

- value of vertex 1

j = l e optimum solution

Figure 1. A variant ofthe Balas additive method for CMCG problems.

Page 9: Algorithms for the constrained maximum-weight connected graph problem

Lee and Dooly: Constrained Maximum-Weight Graph Problem 993

Figure 2. A connected graph with ten vertices.

greedy solution is { 1, 2, 5, 6 ) with its value sum 30. The detailed execution of Step 3 is summarized in Table 1, which shows that the value sum is computed only for six combi- nations out of a maximum of 126 and that connectivity is tested only three times. A better solution is found only once.

We also present a heuristic algorithm for the CMCG problem that is more sophisticated than the greedy heuristic. A good heuristic solution that serves as the initial solution to the optimization algorithm can make the above fathoming more effective. This heuristic uses BFS to identify vertices that need to be considered in the heuristic. This algorithm first sets G, (i) = { i} . For each vertex k first visited with depth d( 1 5 d I R-1 ), this algorithm finds a set of subgraphs, G,( k ) for g = R down to d + 1, where G,( k ) is a connected graph obtained by adding vertex k to the subgraph G,-, (x) with the largest value sum where x is adjacent to k and has been visited by BFS before vertex k , updating G,(y) for all vertices y in G,_, (x). When the algorithm terminates, G,( i) contains the CMCG solution for rnodes. It employs the following three R by n arrays:

firstvalue[ r , j ] is an array of the best values found for sets with r+ 1 connected nodes

containing vertices i and j at the time that j was first reached by BFS lastadded[r, j] is an array of the previously added vertex for the set for

bestindex [ r , j ] is an array of the last vertex added to the best current set with firstvalue [ Y, j ]

r+ 1

Table 1. An example for Algorithm OPT. - Y z > z* ? Connected ? Better solution ? Terminate ?

{ 1 ,2 ,3 ,4} 34 > 30 No No N o ( j = 4 ) { 1 , 2 , 3 , 5 } 3 3 > 3 0 No No No ( j = 4) { 1 ,2 ,3 ,6} 32 > 30 Yes Yes No ( j = 4) {1 ,2 ,4 ,5} 3 2 = 3 2 - No N o ( j = 3 ) { 1 , 3 , 4 , 5 } 31 < 3 2 - No No ( j = 2) { 2 , 3 , 4 , 5 } 30 < 32 - No Yes(j= 1 )

Page 10: Algorithms for the constrained maximum-weight connected graph problem

994 Naval Research Logistics, Vol. 43 ( 1996 )

connected nodes containing vertices i and j .

These arrays allow us to reconstruct any set without keeping all of them and, hence, to trace the vertices back in the reverse of the order in which they were added. We refer to this heuristic as the depth heuristic. Details of this heuristic are given below as Algorithm DEP-HEU.

Algorithm DEPAIEU: a depth heuristic for the CMCG problem

Input: G = ( V, E), fixed vertex i , value vj for each vertex j Output: the depth heuristic solution bes tse t and its value sum z

Begin for each vertex j do

for each size r from 0 to R- 1 do first-value [ r, j ] c - co las tadded [ Y , j ] c none best-index [ r , j ] c none

{ end for } { end for } firstvalue[ O,i] c v i best index[ O,i] c i for each vertex k visited by BFS with depth d d o

for each size r from R- 1 downto d d o for each vertexj adjacent to k do

iffirstvalue[ r-1,best-index[r- 1,j]] > first-value[r,k] then firstvalue[r,k] +- first-value[ r- l,bestindex[ r - l , j ] ] las tadded [ r,k] +- best index [ r- 1, j ] bestindex[r,k] +- k

{end if} { end for } if bestindex[ r,k] Z none then

firstvalue [ r,k] c firstvalue [ r,k] + vk temp t k for level r- 1 downto 0 do

temp c last-added [ level+ I ,temp] if firstvalue[ r,bestindex [ r,temp]] < firsLvalue[ r,k] then

{end i f} { end for )

bestindex [ r,temp] + k

{end if} {end for )

{ end for } best-start + bestindex [ R-1 ,i] z t firstvalue [ R- 1 ,besLstart] bestset c f bests tar t }

Page 11: Algorithms for the constrained maximum-weight connected graph problem

Lee and Dooly: Constrained Maximum-Weight Graph Problem 995

temp t beststart for level from R-2 downto 0 do

temp + lastadded [ level+ 1 ,temp] best-set + best-set U {temp}

{ end for } End.

THEOREM 3: Algorithm DEP-HEU requires O( R2n + RE) time and O( Rn) storage space to solve the CMCG problem for G = (V, E ) and I V I = n .

PROOF: The time complexity is determined by the two inner for loops. The loop checking vertices adjacent to k takes time O(RE) , because each checked node is connected by a different edge. The loop updating indices on all levels takes time O(R2n) . The total time is O(RE + R2n). The additional storage space is O( Rn) for the three arrays.

One nice feature of Algorithm DEP-HEU is that when it solves the CMCG problem for R = r , it also provides CMCG solutions for every value of R < r . If we use Algorithm DEP-HEU to solve the CMCG problem, then Algorithm STEINER in Section 3 takes O( n 3 + n 2 E ) time to solve the Steiner tree problem. This is because the G,-dual graph of G has n + E nodes and 2 E edges. This is larger than the time complexities of the heuristic algorithms that are available in the literature to solve the Steiner tree problem. For exam- ple, the minimum cost path heuristic and the distance network heuristic take O(qn2) time, while the average distance heuristic and the contraction heuristic take O( n 3 ) time [lo].

We use the same CMCG problem as Example 1. Algorithm DEP-HEU finds the same solution as Algorithm OPT. The detailed execution is summarized in Table 2. The depth heuristic solution is obtained by retrieving vertices in the order of 3, 2,6, 1, 10 and its value sum firstvalue[R-l,bestindex[R-l,i]] =firstvalue[4,3] =33.

EXAMPLE 2:

THEOREM 4: DEP-HEU finds a solution with value at least I / (R -2 ) times that of the optimal solution.

PROOF: Let { I , 2, 3, . . . , R ) be an optimal solution, with the vertices listed in the order that DEP-HEU reaches them. Vertex 1 is the fixed vertex and the component containing vertex 3 must have value at least u, + v2 + ~ 3 . Consider the R-2 numbers ~2 + u3, u4, to uR, associated with the vertices 3 to R. At least one of them must be as large as their average. Let vertex x be that vertex. Then D E P J E U puts vertex x in a component with value sum at least ( U , ) + ( U 2 + U 3 + 1 . . + U R ) / ( R - ~ ) > ( U ~ + U 2 + U 3 + . . . + u ~ ) / ( R - 2 ) .

The above bound seems loose, but we can construct a graph in which, when choosing R nodes, DEP-HEU finds a solution with value approximately 1 /( R-2) times that of the optimal solution. Although DEP-HEU appears to have a poor bound at the worst case, we show in the next experiment section that it works very effectively for various random graphs.

In relation to DEP-HEU and its worst bound, we can construct a sequence of heuristics of increasing computational complexity and improving worst-case behavior. For 2 I i s R , find the maximum value tree of size i, which can be done in O(n'- I). Let the value of

Page 12: Algorithms for the constrained maximum-weight connected graph problem

996 Naval Research Logistics, Vol. 43 ( 1996)

Table 2. An examDle of Aleorithm DEP-HEU for CMCG Droblems. Depth d Vertex k r Temp

1 1

1 5

1

1

2

2

2

5 6

6 6 9

8 8 2

2

2 3

3 3 7

I 3 4

4

1 1 2 2 2 1 3 3 3 3 2 1 4 4 4 4 4 3 2 1 4 4 4 4 4 3 2 4 4 4 4 4 3 3 3 3 2 4 4 4 4 4 3 4 3 4 3

10

1 10

5 1

10

6 5 1

10

6 5 1

10

6 5 I

10

6 1

10

2 6 1

10

Firstvalue Lastadded Bestindex 1 1 10 1

1 17 1 5

5 5

1 1 10 5 22 5 6

6 6 6

16 1 6 6 10 6

24 6 9 9 9 9 9

19 5 9 13 1 9 3 10 9

25 6 8 8 8 8 8

20 5 8 10 5 8 31 6 2

2 2 2 2

25 6 2 2 2 2

15 6 2 33 2 3

3 3 3 3

23 2 3 24 8 7 10 8 7 32 2 4 22 2 4

this tree be z, . Among the nodes visited by BFS with depth R-1 or less, select the one with the largest value and let this value be max-v. If z, > max-v, then find any tree of size R containing thc subtree defining 2 , . Otherwise, find any tree of size R containing the largest-

Page 13: Algorithms for the constrained maximum-weight connected graph problem

Lee and Dooly: Constrained Maximum-Weight Graph Problem 991

Table 3. The number of MCGs for which the optimal solutions were not found. d=0.1,0.2,0.3,0.4,

d = 0.05 and 0.5 Total

max v , = 10 max v, 100 max v, = 10 max v, = 100 max v, = 10 max v, = 100

Number of MCGs 48 48 I92 192 240 240 Greedy heuristic I 1 16 4 12 15 28 Deoth heuristic 2 8 0 I 2 9

value node. We can show that this heuristic solution is at least 1 /( R - i + 1 ) of the opti- mum, using the following argument. Divide an optimal solution into a tree of size i con- taining the root, and the remaining R - i nodes. The tree in the optimal solution has a value at most z, and each of these R - i nodes has a value at most max-u. The heuristic solution has a value that is at least the maximum of max-o and zi . Taking the value ratio of the two solutions, we can derive the lower bound.

6. EXPERIMENTAL RESULTS

We conducted a number of experiments to test algorithms OPT and DEP-HEU to solve the CMCG problem for a general graph. Algorithm MCG was used as the main procedure, which systematically fixes a vertex and defines the CMCG problem.

In order to generate numerous test problems, we specified several levels of the following four parameters: ( i ) n , (ii) R , ( i i i ) max o, , and (iv) d (density), which is the ratio of the number of edges in a graph to (;), that is, the maximum number of edges for the given n . We used four levels of n (40, 80, 160,240); five levels of R ( 5 , 10, 15,20, 30); two levels of max oi ( 10, 100); and six levels of d (0.05, 0.1, 0.2, 0.3, 0.4, 0.5). Values of the vertices were randomly generated from a discrete uniform distribution ranging from 1 to max o, . Vertices are numbered such that vertex 1 has the largest value, vertex 2 has the second- largest value, and so on. Once n and d were specified for a graph, d X ($) edges were also generated such that each edge is equally likely to appear in the graph. Each generated graph was represented by sorted adjacency lists. A total of 480 MCGs were generated.

In addition to the two algorithms to solve the CMCG problem, we also tested a greedy heuristic algorithm. This greedy heuristic chooses each vertex in Gas a starting fixed vertex and finds one solution by repeatedly adding to the partial solution V, a vertex with the largest value among vertices adjacent to V, until 1 V, 1 = R . The best solution among the n solutions found is taken as the greedy heuristic solution. This greedy heuristic with the sorted adjacency list requires O( R 2 . n ) time and O ( R ) additional storage space because it uses the merge sort each time a vertex is added to the partial solution in order to update the list of vertices adjacent to the partial solution. The greedy heuristic solution served as the initial solution for algorithm OPT. All the algorithms were coded in C and run on a PC. To each of the 480 MCGs, the above three algorithms were applied and the following statistics were collected: the value sum of a solution and CPU time.

The statistics are summarized in Tables 3 and 4. Table 3 shows the number of MCGs for which each of the two heuristic algorithms failed to find the optimal solution. The depth heuristic performed significantly better than the greedy heuristic. The greedy algorithm failed to find the optimal solution for 43 out of 480 MCG problems, and the depth algo- rithm failed for only 1 1. Six out of the 1 1 nonoptimal depth heuristic solutions were better

Page 14: Algorithms for the constrained maximum-weight connected graph problem

Table 4. Comparison of CPU time among the three algorithms.

CPU time (s) 51 4 110 530 (60 1300 5600 51800 53600 >36W

Greedy heuristic 451 23" 6 0 0 0 0 0 0 0 Depth heuristic 148 102 54 102 65 5 2 I I 0 Optimum algorithm 251 183 27 65 0 5 0 2 0 7(4)h

a The solutions for 23 MCGs were found within 1-5 s. For four MCGs. the optimum algorithm did not terminate even after 10 h

than the corresponding greedy solutions, but the remaining five solutions were the same. These heuristics performed better for denser graphs. The greedy heuristic failed to find the optimal solution for 27 out of 96 MCG problems with d = 0.05, but only for I6 out of 384 MCG problems with d 2 0. I . The depth heuristic failed to find the optimal solution for I0 out of 96 MCG problems with d = 0.05 but only for 1 out of384 MCG problems with d 2 0. I . This was expected, because graphs with a very low density have a small number of edges and the vertices having large values might not be adjacent to each other. As a result, a myopic heuristic would not work well. Both heuristic algorithms worked better for max u, = 10 than for max u, = 100. The greedy heuristic failed to find the optimal solution for 15 out of 240 MCG problems when max u, = 10 versus 28 out of 240 MCG problems when max u, = 100. On the other hand, the depth heuristic failed to find the optimal solution for 2 MCG problems for the former versus 9 MCG problems for the latter. This may be at- tributed to the fact that there are many optimal solutions when max u, = 10; for example, when n = 240, on the average there are 24 vertices having the smallest value (i.e., u, = I ), contrasted with two or three vertices having the smallest value when max u, T 100.

Table 4 summarizes CPIJ time required by the three algorithms to solve the 480 MCG problems. The greedy algorithm required the smallest CPU time, as expected. It found a solution for each of the 480 MCG problems within 10 s. The depth heuristic required less than I min for all except 9 of the problems. For these 9 problems, it required less than I h. The optimization algorithm performed very well when the density was greater than 0.05. It found the optimal solutions for all MCG problems with density d 2 0. I (384 MCG problems with n up to 240 and R up to 30) within 10 s (this CPU time does not include time taken to find the initial solution by the greedy heuristic). Among MCG problems with density d = 0.05 (96 problems), the optimization algorithm required more than 1 min for 14 problems. For 4 out of 14 problems, the optimization algorithm did not terminate even after 10 h. The optimimtion algorithm required a large CPU time for these MCG problems with d 0.05 because the optimal solution usually had a small value sum and fathoming by the value sum was not effective. Note that the large-valued vertices tend not to be adja- cent to one another when the density is low. As a result, this algorithm had to apply the connectivity test to many sets of R vertices that were disconnected.

We also conducted experiments in order ( a ) to investigate the effect of ratio R / n on performance of the algorithms, and ( b ) to compare algorithms DEP-HEU and OPT with a mathematical programming approach that solves the integer programming (IP) formu- lation for the CMCG problem presented in Section 2. We used CPLEX V.3.0 [ 31 to solve the IP formulation. We applied the two algorithms and CPLEX to each of 108 CMCG problems with the following parameters: n = { 100, 200.400}, R / n ('70) = { 5 , 10, 30, 50, 70,90 } , max u, = { 10, I00 } , and density index m - { 1,5 ,20 } . A graph with density index m has m( n - 1 ) edges randomly chosen from all possible edges. Thus, the IP formulation

Page 15: Algorithms for the constrained maximum-weight connected graph problem

Lee and Dooly: Constrained Maximum-Weight Graph Problem 999

has ( n - 1 ) binary integer variables and 2m( n - I ) general integer variables, and the density of these graphs ranges from 0.005 to 0.4. A fixed vertex for each CMCG was ran- domly selected.

We ran both algorithms on an IBM-6000 workstation with 2-h CPU time limit. We ran CPLEX on a Pentium PC with the default options except the following three: ( I ) time limit = 9,272 seconds which is comparable to the 2-h on the workstation, (2 ) limit nodes = 1,000,000 for the maximum number of nodes permitted for the branch-and-bound tree, and (3) limit solution = 1,000,000 for the maximum number of integer solutions permit- ted. The last two options were set so large such that CPLEX terminated due to either a verified optimum found or the CPU time limit or memory shortage when exceeding 16 megabyte RAM. At termination of each problem, we collected the CPU time taken and the solution value. The results are summarized in Tables 5-7.

Algorithm OPT outperforms CPLEX. OPT did not find a verified optimum for only 8 out of 108 problems, and CPLEX did not find a verified optimum for 48 problems includ- ing the 8 problems of OPT. For these problems, CPLEX terminated without finding a verified optimum due to either the CPU time limit or memory shortage. Among ones for which CPLEX found a verified optimum (60 problems), OPT took only average 8% (ranging from 0.0 1% to 60%) of the CPU time taken by CPLEX. CPLEX also worked well for dense graphs. When rn = 20, CPLEX found a verified optimum for every problem quickly. When m = 20, CPLEX found a tight upper bound and the associated relaxed LP solution was integer valued or almost integer valued, which required a small number of branch-and-bound iterations.

Concerning the effect of R / n , the performance of both OPT and DEP-HEU does not degrade as R / n increases. Figure 3 depicts the average ratio of a DEP-HEU solution to a verified optimum found by OPT for each n over the six R / n values. The ratio curve is almost convex in R / n , and the DEP-HEU solution has the largest deviation from an optimum when R / n is about 50%, and the smallest deviation when R / n is 5% or 90%. OPT found a verified optimum for every problem with R l n > 50% and did not necessarily require a larger CPU time for larger R / n . The eight problems for which OPT did not find a verified optimum occurred when R / n = 10,30, or 50%. One possible explanation for this is that there exists the largest number of candidate solutions to be sought when R / n = 50%, and that a probability that a subgraph formed with R nodes is connected is higher when R l n = 70 or 90% than when R / n = 30 or 10%.

7. AN IMPROVED BALAS ALGORITHM TO SOLVE CMCG PROBLEMS

In the previous section, we showed that algorithm OPT may take a large CPU time for a sparse graph. In this section, we present a pruning method to speed up the algorithm by avoiding many unnecessary connectivity tests. Consider a graph Go = (V, E ) in which each vertexj has value v, and all edges have a unit weight. Given a set of vertices Fo = if;. . . f , 1 in Go, if there is a valid solution of a CMCG problem containing Fo, then the Steiner tree containing Fo must have at most R- 1 edges. Although the Steiner problem is NP complete, there are heuristic algorithms which have good error bounds. We use the minimum cost path heuristic (MCPH) that has an error bound of 2 - 2 / p [lo]. When this heuristic

Page 16: Algorithms for the constrained maximum-weight connected graph problem

1000 Nuvul Research Logistics, Vol. 43 ( 1996)

Table 5. Comparison of the proposed algorithms with CPLEX for n = 100.

DEP-HEU OPT IP (CPLEX) Density CPU time Objec. CPU time Objec. CPU time Objec.

max v, m R/n(%) (9 value ( s ) value (s) value 10 1 5

10 30 50 70 90

5 5 10 30 50 70 90

20 5 10 30 50 70 90

100 1 5 10 30 50 70 90

5 5 10 30 50 70 90

5 10 30 50 70 90

20

0.0 0. I 0.4 I .o 1.5 2.0 0.1 0.2 0.6 1.3 2.0 2.5 0.3 0.4 1.2 2.2 3.1 3.9 0.1 0.1 0.5 1 .o 1.6 2.0 0.1 0.2 0.7 I .3 2.0 2.5 0.3 0.4 1.2 2.2 3.1 3.9

32 60

210 342 44 1 509 40 89

267 395 483 525 41 91

260 40 1 494 548 306 669

1735 2904 3853 4713

355 774

2235 3394 426 1 4768

3 80 828

2336 3478 426 1 4768

0.0 0. I 0.5 1 .o I .6 2.1 0.2 0.2 0.1 0.1 0.1 0.1 0.2 0.2 0.2 0.2 0.2 0.2 0.0 0.1 0.5 1.1 1.6 2.0 0.2 1.6 0. I 0.1 0.1 0.1 0.2 0.2 0.2 0.2 0.2 0.2

32 60

222 367 470 525 40 90

272 402 483 525 41 91

260 40 I 494 548 306 684

1966 3141 4067 474 1

355 798

2332 3478 426 1 4768

380 828

2336 3478 426 1 4768

0.4 1330.5 3059.5 7023.3 443.8

3.5 6.3 1.1 5.9 0.9 0.9 0.8 2.3 1.1 I .2 1 .o 1 . 1 1.3 0.6

3783.0 7200.0 7200.0 7200.0 2088.7

14.3 5285.7 1039.5

1.6 0.9 0.5 1 .o I .o 1.1 1.3 1.3 1 . 1

32 60

N/A" N/A N/A 525 40 90

272 402 483 525 41 9 I b

260' 401b 494b 548' 306 684

N/A N/A N/A N/A 355

N/A N/A 3478' 426 1 4768b

380b 828b

2336b 3478' 426 1 4768b

a N/A: no feasible solution was found until termination due to either memory shortage or CPU time limit, 7200 seconds.

An initial LP relaxed solution was integer valued.

solution with Fo has the weight sum larger than ( 2 - 2/p)(R-1), we can prune all sets containing F,, thereby, avoiding the connectivity test for any set of R vertices containing Fo. This pruning method tends to be more effective for a sparser graph because the Steiner tree containing Fo requires more edges, consequently, larger weight sum. When R was large relative to n , the Steiner tree test would seldom help, because MCPH usually does much betterthantheerrorboundof(2-2/p).(R-I). WhenR>p/(p- 1 ) . n / 2 + 1, thesteiner tree test cannot help, because the error bound 2 n.

Page 17: Algorithms for the constrained maximum-weight connected graph problem

Lee and Dooly: Constrained Maximum-Weight Graph Problem 1001

Table 6. Comparison of the proposed algorithms with CPLEX for n = 200. DEP-HEU OPT IP (CPLEX)

Density CPU time Obiec. CPU time Obiec. CPU time Objec. max v, m R / n ( % ) (s) vaiue (s) vaiue 6)

10 1 5 10 30 50 70 90

5 5 10 30 50 70 90

20 5 10 30 50 70 90

100 1 5 10 30 50 70 90

5 10 30 50 70 90

5 10 30 50 70 90

5

20

0. I 0.4 3.2 7.3

11.5 14.7 0.3 0.7 4.0 8.9

13.8 17.2 0.9 1.6 6.1

12.2 18.1 22.7 0.1 0.5 3.3 7.6

11.8 14.8 0.3 0.8 4.0 9.0

13.9 17.5 0.9 1.6 6.1

12.2 18.4 23.1

67 139 416 64 I 867

1010 89

179 505 753 929

1037 91

191 540 813

1013 1134 60 1

1336 3522 5171 7020 8565

804 1661 4603 6837 8323 9059

858 1743 4700 6907 838 1 9059

0.1 0.4 3.3 7.7

12.3 15.6 74.8

7200.0 7200.0

0.1 0.1 0.1 0.3 0.4 0.4 0.4 0.3 0.4 0.1 0.5 3.4 7.8

12.3 15.4

1850.0 7200.0

54.7 0.1 0.1 0.1 0.4 0.4 0.4 0.4 0.4 0.4

67 142 439 690 896

1030 89

183 5 14 763 939

1038 91

191 540 813

1013 1 I34 60 1

I366 3925 6090 7865 9010

823 I677 4685 6907 838 1 9059

863 1751 4700 6907 838 I 9059

58.0 7200.0 630 1.6 3858.7 1976.0 344 1.2 7200.0 2461.7

793.0 2.7 2.3 1.2 3.0 6.1

68.2 3.3 3.6

31.9 7200.0 7200.0 7200.0 7200.0 1965.0 839.4

7200.0 2545.9 1707.6

2.4 1.1 2.3

23 12.8 19.8 3.1 5.5 5.8 4.6

value 67

N/A" 330

N/A N/A N/A N/A N/A N/A 763b 939

1038b 91

191 540 813'

1013b I134 60 1

N/A N/A N/A N/A N/A N/A N/A N/A 6907b 838Ib 9059

863 1751 4700' 6907b 8381' 9059b

a N/A: no feasible solution was found until termination due to either memory shortage or CPU time limit, 7200 seconds.

An initial LP relaxed solution was integer valued.

Algorithm M i n i m u m C o s t P a t U e u r i s t i c (MCPH): An algorithm to find an approximate solution to the Steiner tree problem when all edges have a unit weight.

Input: So = ( V , E ) , a set of vertices Fo = { f ; Output: A solution TP-, which is a t most 2-2 /p times as large as the optimal

.f,}

Steiner tree

Page 18: Algorithms for the constrained maximum-weight connected graph problem

1002 Naval Research Logistics, Vol. 43 ( 1996)

Table 7. Comparison of the proposed algorithms with CPLEX for n = 400. DEP-HEU OPT IP (CPLEX)

Density CPU time Objec. CPU time max vi n? R/n(%) (s) value (s)

10 1 5 10 30 50 70 90

5 5 10 30 50 70 90

20 5 10 30 50 70 90

100 I 5 10 30 50 70 90

5 5 10 30 50 70 90

5 10 30 50 70 90

20

0.8 149 3.3 305

25.1 853 57.8 1,324 92.0 1,758

116.0 2,114 1.5 190 4.3 376

28.4 1,043 66.0 1,590

106.0 1,98 1 132.0 2,204

3.2 191 7.4 39 I

36.8 1,080 78.9 1,61 I

122.0 1,996 154.0 2,204

0.9 1,403 3.5 2,83 I

25.2 7,923 58.8 12,229 94.0 16,326

118.0 19,061 1.5 1,783 4.4 3,563

28.5 10,007 66.1 14,923

106.0 18,307 133.0 20,085

3.3 1,862 7.4 3,747

37.0 10,258 79.6 15,074

123.0 18,412 155.0 20,085

0.9 3.4

25.0 61.5 98.8

125.0 0.2

7200.0 7200.0 7200.0

0.2 0.3 0.7 0.7 0.7 0.7 0.7 0.7 I .o 3.5

26.2 61.8 99.0

125.0 1900.0 7200.0

10.0 7200.0

0.2 0.2 0.8 0.8 0.8 0.7 0.7 0.8

Objec. CPU time Objec. value (s) value

158 326 943

1,469 1,894 2,188

191 38 1

1,069 1,610 1,996 2,204

191 39 1

1,080 1,61 1 1,996 2,204 1,465 3,064 8.7 13

13,517 17,442 19,888 1,804 3,562

10,252 15,06 1 18,412 20,085

1,868 3,748

10,258 15,074 18,412 20,085

6732.5 5650.7 3547.0 2504.8 3223.5 1940.6

6.2 1936.0 3764.8 4 1 54.0

5.5 9.5

3523.5 89.4 12.7

664.0 181.0

13.3 7200.0 2926.0 226 1 .8 1239.8 765.0 927.9

7200.0 2855.2 2 164.9 3550.3

11.0 2.3

13.7 10.9 15.9 16.4 16.6 14.9

NfA” N/A N/A N/A N/A N/A

N/A N/A N/A 1,996’ 2,204b N/A

39Ib 1 ,080b 1,61 I’ 1 ,996b 2,204b NfA N/A N/A NfA N/A N/A N/A N/A N/A N/A

18,412 20,0Ub

1 ,868b 3,748b

10,258b 1 5,074b 18,412’ 20,085’

19Ib

a N/A: no feasible solution was found until termination due to either memory shortage or CPU time limit, 7200 seconds.

An initial LP relaxed solution was integer-valued.

Begin Start with a tree To = (f; }

forifrom 1 t o p - 1 L e m p 6 . L

Fi = Fi-1 - f & p

consolidate the vertices in TI-, into one super nodef, and replace Ti-I of

super nodef; to get Si with

Page 19: Algorithms for the constrained maximum-weight connected graph problem

Lee and Dooly: Constrained Maximum-Weight Graph Problem

4

98 -

97 -

96 -

loo^ 99

954 94

I003

0 10 20 30 40 50 60 70 80 90 100

Rfn (%I Figure 3. Deviation ofthe DEP-HEU solution from an optimum with respect to R / n .

use BFS to find the closest vertex of F, toh. in S, and set it tof;,,,, T, c T,-, U path connectingAem, and& in S,

end { for } End.

Because all edges have the same weight, Algorithm MCPH takes time O(p( n + E)). We now present the new Balas algorithm, which includes Algorithm MCPH, as follows.

Algorithm O P T S T

Input: G = (V ,E) , fixed vertex i, value for each vertex, initial solution and its

Output: the improved Balas heuristic solution besLset and its value sum

The Balas algorithm with Algorithm MCPH imbedded

value sum

bestsum

Page 20: Algorithms for the constrained maximum-weight connected graph problem

1004 NavuI Rexurch Logistics, Vol. 43 ( 1996)

Figure 4. An example graph for Algorithm OPT-ST

Begin Start with Fo containing only the fixed vertex repeat

repeat if the solution value from Algorithm MCPH I error bound. ( R - 1 ) then

else add next feasible vertex to Fo

remove last vertex added from Fo replace with next feasible vertex

until Fo has R-2 elements Perform Balas Algorithm where 2 nodes are chosen from the remaining ver-

remove last vertex added from Fo replace with next feasible vertex

tices

until all sets containing the fixed vertex have been tested End.

EXAMPLE 3: The following example clarifies Algorithm OPT-ST. We use a tree with nine vertices in Figure 4. Vertex i has value i and R is set to 5. Fixed node is 1. Algorithm OPT-ST starts with the greedy solution { 1, 3,4, 5 ,9 } with value sum of 22.

Steiner test on { 1,9,8 } eliminates { 1,9,8,x,y} since path length = 8 > 5 = 4(2- 2 1 3 ) .

Page 21: Algorithms for the constrained maximum-weight connected graph problem

Lee and Dooly: Constrained Maximum-Weight Graph Problem 1005

Steiner test on { 1,9,7 } eliminates { 1,9,7,x, y} since path length = 7 > 5 = 4( 2-

Steiner test on { 1,9,6} eliminates { 1,9,6,x, y} since path length = 6 > 5 = 4(2-

{1,9,5};valuesumof{1,9,5,4,3} 522 . Eliminates { 1,9,5,x,y}. Steiner test on { 1,8,7 f allows { 1,8,7,x, y} . Exhaustively test { 1,8,7,x, y} where 7

2 / 3 1 .

213) .

> x > y, x = 6 y = 5 not connected x = 6 y = 4 not connected x = 6 y = 3 not connected x = 6 y = 2 connected. { 1,8,7,6,2 } has the new best value sum of 24. x = 5 y = 4 not connected x = 5 y = 3 sum 1 2 4 x = 4 y = 3 sum I 24

{ 1,7 } ; value sum of { 1,7,6,5,4} < 24 eliminates all remaining possibilities.

Thus, Algorithm OPT-ST performed the connectivity test only five times and the Steiner test four times. On the other hand, the original algorithm OPT performed the connectivity test 39 times.

In order to study the effectiveness of the Steiner tree test for sparse graphs, we applied both optimization algorithms to a set of CMCGs with the following parameters: n = { 100, 300,500, 1000,2000}, R = { 5, 1 0 , 3 0 } , max u, = 100, and density index m = { 1, 3 , 5 } . A graph with density index rn has rn( n - 1 ) edges randomly chosen from all possible edges. Thus, the density of these graphs ranges from 0.00 1 to 0.1. A fixed vertex for each CMCG was randomly selected. We used Algorithm DEP-HEU to find an initial solution to the two algorithms.

We solved five CMCG problems for each combination (a total of 225 CMCG problems) with 2-h CPU time limit on an IBM-6000 workstation. We computed the average CPU time of the CMCG problems terminated before 2 h. If an algorithm had not finished within 2 h, it would report the current state (i.e., the incumbent solution and the candidate solu- tion being considered) and stop. By reading the current state, we counted the number of CMCG problems for which one algorithm progressed further toward termination (i.e., fathoming more candidate solutions) than the other. The results are summarized in Table 8.

Algorithm OPT-ST performed better than Algorithm OPT when rn, R , or R / n was small. Among CMCG problems terminated, OPT-ST found the verified optimum solu- tion faster when n > 100 except in one case, achieving 8% to 9 1 % reduction of CPU time. The exception occurred when n = 300, R = 5, rn = 5, where OPT took 0.3% less CPU time than OPT-ST. When n = 100, Algorithm OPT performed faster when R 2 10 or rn = 5. Among ones not terminated, there were only five CMCG problems for which OPT pro- gressed further ahead. All these occurred when m = 5 or R = 30. In contrast, OPT-ST progressed further ahead for 7 1 CMCG problems. Both algorithms did not terminate after 2 h for many large CMCG problems. However, we observed in every tested problem that either algorithm did not find a better solution than an initial one provided by DEP-HEU. Each algorithm spent all CPU time in verifying the optimality of the initial solution. Thus, with a combination of experimental results from Sections 6 and 7, we suggest that a prac- tical solution approach to CMCG problems is to apply DEP-HEU followed by OPT-ST

Page 22: Algorithms for the constrained maximum-weight connected graph problem

1006 Nuvul Research Logistics, Vol. 43 ( 1996)

Table 8. Comparison of Algorithms OPT and OPT-ST. Problem parameters Average CPU time ( s ) Much ahead at 2-hr time limit”

n R m OPT-ST OPT Ratio OPT-ST Neither OPT

100

300

500

1000

2000

5

10

30

5

10

30

5

10

30

5

10

30

5

10

30

1 0.29 3 5.20 5 0.52 1 3 200.8 5 3.6 I 3 594.1 5 160.5 1 1.2 3 425.7 5 580.1 1 2427.6 3 323.2 5 899.4 1 3 5 1 25.2 3 371.1 5 192.6 I 3 5 1 3 5 1 9.2 3 5 1 3 5 1 3 5 I 53.9 3 5 172.6 1 3 5 1 3 5

0.32 6.03 0.47

146.4 2.3

349.1 77.6

1.6 585.9 578.2

2865.8 3542.5 2604.1

65.7 1280.3 209.4

11.2

143.1

260.4

0.90 0.86 1.1 I

1.37 1.55

1.70 2.07 0.79 0.73 1 .oo 0.85 0.09 0.35

0.38 0.29 0.92

0.82

0.38

0.66

5

4 1 2

4 4 4

4 1 4

1 4

1

5 2 3

5 5

5 5

2 3 2 2 5 5 3 2 5 4 1

5

3 2 I 2 4 1 5 3 2 4 1 5

5

a Among CMCGs not terminated at the 2-h time limit, which algorithm is ahead (closer to termina- tion).

Page 23: Algorithms for the constrained maximum-weight connected graph problem

Lee and Dooly: Constrained Maximum-Weight Graph Problem 1007

with a limit on CPU time. These experimental results show that this approach can effectively solve CMCG problems with both sparse and dense graphs.

8. CONCLUSIONS

In this article we presented algorithms to solve CMCG problems, which is essential in solving MCG problems and has applications for communication network design and facil- ity location problems. We showed that the well-known Steiner tree problem is a special case of a CMCG problem and introduced three optimization algorithms for CMCG prob- lems. The first two algorithms deal with special graphs (tree and layer graph) and employ different dynamic programming techniques. Both solve CMCG problems in polynomial times O ( n 2 ) . The third algorithm, OPT, deals with a general graph and uses a variant of the Balas additive method with the connectivity test imbedded. Experimental results show that this algorithm works very well when a graph is not very sparse. When the density is greater than 0.05, it found the verified optimal solution to every tested MCG problem less than 10 s on a PC (384 MCG problems with n up to 240 vertices and R up to 30). In order to speed up this algorithm for sparse graphs, we added to it a pruning method using the minimum cost path heuristic for the Steiner tree problem and empirically showed that this pruning method improves speed for sparse graphs.

We also presented a heuristic algorithm DEP-HEU that requires O( R2n + RE) time. We showed that this algorithm has an error bound 1 /( R-2) and solves CMCG problems far more effectively than the greedy algorithm, which requires O( Rn) time. We presented the integer programming formulation for CMCG problems and applied a commercial IP solver, CPLEX, to the formulation. Experimental results with 108 test problems ( n up to 400 and R / n up to 90%) show evidence that algorithm OPT outperforms CPLEX in both effectiveness and efficiency. The results also indicate that the performances of both algo- rithms OPT and DEP-HEU do not degrade as R / n increases, and they perform very well particularly when R / n > 50%.

For a practical solution approach to CMCG problems, we combine these findings and suggest applying DEP-HEU to obtain an initial solution and then applying OPT with the pruning method and a limit on CPU time. We observed that this approach usually finds the near-optimum solution early and spends most CPU ofthe time verifying its optimality, seldom finding a better solution.

Future research efforts need to be directed to find other pruning methods or algorithms that improve for sparse graphs with large n and R . One possible direction is to use the fact that a sparse graph is treelike and the result of Section 4.1 that provides an efficient optimization algorithm to solve CMCG problems for a tree. Note that a tree is the sparsest connected graph and has density 1 /( n - 1 ). Another direction is to investigate parallel computation to solve MCG problems. Once algorithm MAIN is solved, we know which CMCG problems need to be solved. These CMCG problems could be assigned to different processors and solved in parallel. The only information that needs to be coordinated among different processors is the incumbent solution for the MCG problems. This incum- bent solution is updated whenever a better solution is found by one of the processors.

ACKNOWLEDGMENT

This research is supported in part by a grant from National Science Foundation (Grant No. DDM-9201954) and a grant from Southern Illinois University at Edwardsville. The

Page 24: Algorithms for the constrained maximum-weight connected graph problem

1008 Naval Research Logistics, Vol. 43 ( 1996)

authors thank Dr. H. C. Lee for his valuable suggestions. The authors also express gratitude to anonymous referees whose comments helped to improve the quality and presentation of this article.

REFERENCES [ 1 ] Ahuja. R., Magnanti, T., and Orlin, J., Network Flows: Theory, Algorithms, and Applications,

Prentice Hall, Englewood Cliffs, NJ, 1993. [2] Balas, E., “An Additive Algorithm for Solving Linear Programs with Zero-One Variables,”

Operations Research, 13,517-548 ( 1965). [ 31 CPLEX Optimization, Inc., Using the CPLEX Callable Library, CPLEX Optimization, Inc.,

Incline Village, NV, 1994. 141 Garey, M.R., and Johnson, D.S., Computers and Intractability: A Guide to the Theory ofNP-

Completeness, Freeman, New York, 1979. [ 51 Colbourn, C.J., The Combinatorics ofNetwork Reliability, Oxford University Press, New York,

NY, 1987. [6] Johnson, D.S., and Niemi, K.A., “On Knapsacks, Partitions, and a New Dynamic Program-

ming Technique for Trees,” Mathematics of Operalions Research, 8, 1- 14 ( 1983). [ 71 Lee, H.F., and Dooly, D.R., “The Maximum-Weight Connected Graph Problem,” Technical

Report No. 93-4 (revised November 1995), Industrial Engineering, Southern Illinois Univer- sity, Edwardsville, IL, 1993.

[ 81 Lee, H.F., and Dooly, D.R., “Heuristic Algorithms for the Fiber-optic Network Expansion Problem,” Technical Report No. 94-5 (revised February I996), Industrial Engineering, South- ern Illinois University, Edwardsville, IL, 1994.

[9] Murty, K., Network Programming, Prentice-Hall, Englewood Cliffs, NJ, 1991. [ 101 Winter, P., “Steiner Problem in Networks: A Survey,” Nelworks, 17, 129-167 ( 1987).

Manuscript received October 1994 Revised manuscript received May 1996 Accepted May 22, 1996