TC-NNC Algorithm: A Faster Approach to Computing Degree-Constrained Minimum Spanning Trees, Papers of Computer Science

The tc-nnc algorithm, a new approach to computing degree-constrained minimum spanning trees (d-mst) that improves upon the ir and tc-rnn algorithms. A high-level description of the tc-nnc algorithm, which is based on the idea of nearest neighbor chains, and presents experimental results demonstrating its faster execution time and comparable quality of solutions to the ir algorithm.

Typology: Papers

Pre 2010

Uploaded on 11/08/2009

koofers-user-nil
koofers-user-nil 🇺🇸

10 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
A Parallel Algorithm for the Degree-Constrained Minimum Spanning Tree
Problem Using Nearest-Neighbor Chains
Li-Jen Mao, Narsingh Deo, and Sheau-Dong Lang
School of Computer Science, University of Central Florida
Orlando, FL 32816-2362, U.S.A.
Email: {mao, deo, lang}@cs.ucf.edu
Abstract
The Minimum Spanning Tree (MST) problem with an
added constraint that no node in the spanning tree has
the degree more than a specified integer d, is known as
the Degree-Constrained MST (d-MST) problem. Since
computing the d-MST is NP-hard for every d in the range
2
d
(n
2) where n denotes the total number of
nodes, several approximate algorithms have been
proposed in the literature. We have previously proposed
two approximate algorithms, TC-RNN and IR, for the d-
MST problem. Our experimental results show that while
the IR algorithm is faster, the TC-RNN algorithm
consistently produces spanning trees with a smaller
weight. In this paper, we propose a new algorithm, TC-
NNC, which is an improved version of TC-RNN. Our
experiments using randomly generated, weighted graphs
as input demonstrate that the execution time of TC-NNC
is smaller than that of TC-RNN, and is very close to that
of IR. Further, the quality-of-solution of TC-NNC is
better than that of IR and is very close to that of TC-RNN.
Keywords: Parallel approximate algorithm, degree-
constrained MST, minimum spanning tree, reciprocal
nearest neighbors.
1. Introduction
Given a connected, edge-weighted, undirected graph
G and a positive integer d, the Degree-Constrained MST
(d-MST) problem is to find a spanning tree with the
smallest weight among all possible spanning trees of G
which contain no nodes of degree greater than d. This
problem is NP-hard, because the Hamiltonian Path
problem (Problem ND1 in Garey and Johnson [6]), which
is NP-complete, is a special case of d-MST with d = 2
and all edge weights identical.
The Degree-Constrained MST problem was first
studied by Deo and Hakimi [3]. Since computing a d-
MST is NP-hard for every d in the range 2 d (n 2),
several approximate algorithms have been proposed in the
literature [2, 14, 18]. Ravi, Marathe, Ravi, Rosenkrantz,
and Hunt [17] showed that finding approximate solutions
to d-MST within a constant factor of the weight of an
optimal tree is also NP-hard. They also developed a
polynomial-time algorithm that approximates both the
weight and the maximum degree of the spanning tree.
For a graph of n nodes and a given degree bound d, their
algorithm computes a degree-constrained spanning tree
with the maximum degree at most O(d log n) times, and
the weight at most O(log n) times, of that of an optimal d-
MST tree. Moreover, for the special case that the weights
satisfy the triangle inequality, they presented another
approximation algorithm that computes a spanning tree
satisfying the specified degree bound and having the
weight no worse than
)(
1
2
2
n
d
times of that of an MST.
The latter algorithm employs the "short-cutting" method
that was proposed by Rosenkrantz, Stearns, and Lewis
[18] for the Traveling Salesman problem.
A restricted version of d-MST is the Minimum-
Degree Spanning Tree problem which computes a
spanning tree of a given unweighted graph with the
maximum degree being the smallest among all the
spanning trees of the given graph. This NP-hard problem
admits polynomial-time approximations within an
additive constant of one from the optimal degree, as
shown by Fürer and Raghavachari [4, 5]. The d-MST
problem has also been studied for the complete graphs of
points in a plane. This restricted problem was shown to
be NP-hard for d = 3 by Papadimitriou and Vazirani [16],
who also conjectured the NP-hardness for d = 4. Khuller,
Raghavachari, and Young recently gave approximation
algorithms [10] that produce spanning trees whose total
weight is no more than 50% (25%) from the MST weight
pf3
pf4
pf5

Partial preview of the text

Download TC-NNC Algorithm: A Faster Approach to Computing Degree-Constrained Minimum Spanning Trees and more Papers Computer Science in PDF only on Docsity!

A Parallel Algorithm for the Degree-Constrained Minimum Spanning Tree

Problem Using Nearest-Neighbor Chains

Li-Jen Mao, Narsingh Deo, and Sheau-Dong Lang

School of Computer Science, University of Central Florida

Orlando, FL 32816-2362, U.S.A.

Email: {mao, deo, lang}@cs.ucf.edu

Abstract

The Minimum Spanning Tree ( MST ) problem with an added constraint that no node in the spanning tree has the degree more than a specified integer d, is known as the Degree-Constrained MST ( d-MST ) problem. Since computing the d-MST is NP-hard for every d in the range 2d  ( n2 ) where n denotes the total number of nodes, several approximate algorithms have been proposed in the literature. We have previously proposed two approximate algorithms, TC-RNN and IR, for the d- MST problem. Our experimental results show that while the IR algorithm is faster, the TC-RNN algorithm consistently produces spanning trees with a smaller weight. In this paper, we propose a new algorithm, TC- NNC, which is an improved version of TC-RNN. Our experiments using randomly generated, weighted graphs as input demonstrate that the execution time of TC-NNC is smaller than that of TC-RNN, and is very close to that of IR. Further, the quality-of-solution of TC-NNC is better than that of IR and is very close to that of TC-RNN. Keywords: Parallel approximate algorithm, degree- constrained MST, minimum spanning tree, reciprocal nearest neighbors.

1. Introduction

Given a connected, edge-weighted, undirected graph G and a positive integer d , the Degree-Constrained MST ( d -MST) problem is to find a spanning tree with the smallest weight among all possible spanning trees of G which contain no nodes of degree greater than d. This problem is NP-hard, because the Hamiltonian Path problem (Problem ND1 in Garey and Johnson [6]), which is NP-complete, is a special case of d -MST with d = 2 and all edge weights identical. The Degree-Constrained MST problem was first studied by Deo and Hakimi [3]. Since computing a d - MST is NP-hard for every d in the range 2  d  ( n  2), several approximate algorithms have been proposed in the literature [2, 14, 18]. Ravi, Marathe, Ravi, Rosenkrantz, and Hunt [17] showed that finding approximate solutions to d -MST within a constant factor of the weight of an optimal tree is also NP-hard. They also developed a polynomial-time algorithm that approximates both the weight and the maximum degree of the spanning tree. For a graph of n nodes and a given degree bound d , their algorithm computes a degree-constrained spanning tree with the maximum degree at most O( d log n ) times, and the weight at most O(log n ) times, of that of an optimal d - MST tree. Moreover, for the special case that the weights satisfy the triangle inequality, they presented another approximation algorithm that computes a spanning tree satisfying the specified degree bound and having the

weight no worse than ( 2 ^ dn^^  12 )times of that of an MST.

The latter algorithm employs the "short-cutting" method that was proposed by Rosenkrantz, Stearns, and Lewis [18] for the Traveling Salesman problem. A restricted version of d -MST is the Minimum- Degree Spanning Tree problem which computes a spanning tree of a given unweighted graph with the maximum degree being the smallest among all the spanning trees of the given graph. This NP-hard problem admits polynomial-time approximations within an additive constant of one from the optimal degree, as shown by Fürer and Raghavachari [4, 5]. The d -MST problem has also been studied for the complete graphs of points in a plane. This restricted problem was shown to be NP-hard for d = 3 by Papadimitriou and Vazirani [16], who also conjectured the NP-hardness for d = 4. Khuller, Raghavachari, and Young recently gave approximation algorithms [10] that produce spanning trees whose total weight is no more than 50% (25%) from the MST weight

for d = 3 ( d = 4). They also proved that for plane graphs there always exists a degree-5 MST with the same weight as that of an MST. For the d -MST problem on general weighted graphs, several heuristic solutions have been proposed which, in general, have no guaranteed bounds on the quality of the solutions. Yamamoto [23] proposed an approximate solution by computing the minimum cycle basis of two matroids associated with the given graph. Narula and Ho [15] formulated a branch-and-bound procedure based on Held and Karp's [6, 9] method for the Traveling Salesman problem. Gavish [7] used subgradient optimization for deriving Lagrangian-based lower bounds. Savelsbergh and Volegnant [19] used a branch-and-bound method based on an edge-elimination approach that was previously applied to the Traveling Salesman problem [20]. Volegnant [21] gave a branch-and-bound procedure based on Lagrangian Relaxation and edge exchanges. Krishnamoorthy, Craig, and Palaniswami [11] recently explored several heuristic solutions to the problem using neural networks, simulated annealing, greedy algorithms, and greedy randomized algorithms. Most of these methods, with the exception of the greedy heuristics of Krishnamoorthy et al., seem very time-consuming and become ineffective for graphs of more than a few hundred nodes. We have recently proposed two complementary approaches to solving the d -MST problem, and presented a comparison of the parallel implementation of two approximate algorithms, IR and TC-RNN [13]. The IR algorithm applies Prim's algorithm with a penalty heuristic which successively recalculates the MST and penalizes those edges incident to nodes violating the specified degree-bound. It was shown [12] that the IR algorithm is expected to converge to a feasible solution for the d -MST problem when d  3. The TC-RNN algorithm was obtained by modifying Sollin's MST algorithm, incorporating a check for the degree constraint in every step of the tree-construction. Both the IR and TC-RNN algorithms lend themselves naturally to parallel implementation, especially on massively-parallel SIMD machines. In this paper, we present a new parallel algorithm, TC-NNC, for the d -MST problem. The new algorithm improves upon the two previous algorithms in both speed and quality of solution. The remainder of the paper is organized as follows. Section 2 briefly reviews the two previous approximate algorithms (TC-RNN and IR). The new algorithm TC-NNC and its implementation details are described in Sections 3. Section 4 presents the experimental results comparing the new algorithm to the two previous ones. Section 5 concludes the paper and points out directions for further research. Throughout the paper, graphs are assumed to be complete and undirected, with the edge weights represented by a weight-matrix.

2. Two Approximate d -MST Algorithms In this Section, we briefly describe the approximate algorithms IR and TC-RNN that we designed earlier for the d -MST problem.

2.1. The Iterative-Refinement (IR) Algorithm

The IR algorithm uses an iterative refinement process consisting of two phases: (1) Computing an MST; and (2) Penalizing edges. First, an MST using the initial weight- matrix is computed. Then, in the penalty phase we increase the weights of those tree edges that are incident to the nodes with the degree exceeding the constraint d. The MST of the graph with the new weights is computed next. Note that those tree edges with an increased weight from the penalty phase are discouraged from appearing in the next spanning tree. Alternations of the penalty phase followed by the MST computation are repeated until a spanning tree is produced in which every node satisfies the degree bound. Details of the penalty function and the parallel implementation of the IR algorithm can be found in [2, 12, 13].

2.2. The TC-RNN Algorithm

The TC-RNN algorithm is based on Sollin's MST algorithm described as follows: First, we initialize a forest F consisting of all nodes as single-node trees. Then, the shortest edge incident to each tree is selected, and these shortest edges for all the trees are added to the forest F. This process continues until the forest contains ( n  1) edges, where n denotes the total number of nodes. A straightforward sequential implementation of Sollin's algorithm requires O( n^2 log n ) time, which has been improved to O( n^2 log log n ) by Yao [22] using clever data structures. In adapting Sollin's algorithm to solving the d -MST problem on a parallel machine, we assign each node to a single processor, and these processors simultaneously find nearest neighboring trees to merge until a single tree remains. In each iteration of the parallel loop, two trees assigned to two processors are merged if they are nearest neighbors of each other through a common shortest edge connecting the two trees, assuming the edge doesn't cause degree constraint violations. (The two trees are named reciprocal nearest neighbors .) Details of the parallel implementation can be found in [12, 13].

3. The TC-NNC Algorithm In this section, we present a new algorithm which

weights of the adjacent n 1 edges. After completing this task, the nearest neighbor (with the smallest edge weight) of each node is located at the top of the heap. We adapted the well-known heap procedure heapify [1] and developed its parallel version for this task. It is well known that the time complexity of this Procedure is O( n ) [1].

3.4. Vote for an Outgoing Edge

The first subtask of the tree-merge operation of the TC-NNC algorithm is for each tree to choose a shortest outgoing edge to its nearest neighbor tree. This operation consists of the following steps:

  1. Every node sets itself to be an active node if the degree limit is not reached; otherwise, if the node has already reached the degree limit, it sets itself to be an inactive node and does nothing further.
  2. Every active node reads the id of its nearest neighbor node from the local MINheap , let it be nid. The node inactivates itself if its nearest neighbor nid has reached the degree limit; otherwise, let nidWgt denote the edge weight of the edge connected to nid.
  3. Every active node uses the MasPar's parallel communication function send_with_min () to send the local variable nidWgt to its root node. After the function call, the minimum among these edge weights is stored at the root node.
  4. Every active node reads the variable nidWgt from the remote root node, and compares it to the same variable stored locally. If a node finds both variables have the same value, it means this node is a winner of the competition. Let all such nodes be win_nodes.
  5. To avoid conflicting nodes with the same minimum nidWgt value, all win_nodes use the MasPar's function send_with_min () to send their own node id to their root node. If more than one node in a tree have the same minimum nidWgt value, the node with the smallest node id will win. We name the winning node win_out , and name the associated minimum nidWgt value minWgt.
  6. Every node other than the win_out nodes adjusts its local MINheap , so that the next nearest neighbor node will be available at the top of the MINheap. After executing the above procedure, each tree produces exactly one outgoing edge to the associated win_out node. The next task is to let win_out node connect to its nearest neighbor node nid , with an edge weight equals minWgt. This is described in the next section.

3.5. Vote for the Incoming Edges

After each tree has selected an outgoing edge with the smallest weight, the next subtask is for each tree to choose one or more incoming edges to form the NN- Chains, while conforming to the degree constraint. This subtask is described as follows:

  1. Every tree T has a node win_out that wishes to connect to its nearest neighbor node nid which belongs to the tree NN ( T ), using an edge weight equal to minWgt. Before going any further, the node win_out first checks the degree of node nid to make sure it has not reached the degree limit; otherwise, the node win_out becomes inactive and does nothing in this iteration.
  2. Each node nid sends the edge weight nidWgt to its destination tree NN ( T ) and competes with others to be the next shortest incoming edge to NN ( T ).
  3. Every tree chooses a shortest incoming edge received from other trees, and replies to the senders the winner which is named node win-in.
  4. If node win_out of tree T becomes the winner win-in of its destination tree NN ( T ), tree T is allowed to be merged with tree NN ( T ). Both node win_out and the corresponding node nid increase their degree by one; node win_out becomes inactive for this iteration.
  5. If node win_out of tree T failed to become the win-in of its destination tree, repeat step 1 through step 4 until the merge procedure is completed or until the nearest neighbor node has reached the degree limit.

3.6. Merge Trees and Update to New Root

After all trees have completed their voting of the incoming edges, the next subtask is to perform the tree merge operations along the NN-chains. This involves first updating the root pointer for the root nodes of the trees along the NN-chains, which is accomplished by using the Maspar's router () function to access the data in another processor. The double-pointer technique is used to ensure an O(log n ) worst-case time complexity. After all root nodes have finished updating to the new root, we then update the root pointers for the non-root nodes of each tree along the NN-chains.

4. Experimental Results In this section we report the experimental results comparing the IR, TC-RNN and TC-NNC algorithms. All three algorithms were implemented on a SIMD parallel computer MasPar MP-1 with 8192 processors. We generated randomly weighted graphs as input for our experiments. In the following, we first describe the parameters used in generating the test data, and then report the experimental results. A biased-random weight-matrix generator was used to construct the input graphs for which the initial MST has a high value for the maximum node-degree. The

random-graph generator takes the following input parameters (more details can be found in [12, 13]): n – the size of the matrix; f – the number of nodes with large degree; and ld ( ud ) – lower (upper) bounds for the degree of the large-degree nodes. Figure 2 shows the experimental results comparing the three algorithms for the 5-MST problem. For all the randomly weighted input graphs, the degree bounds ld and ud were fixed at 15 and 20, respectively. Figure 2(a) compares the runtime for calculating a 5-MST as the number of nodes n varies from 500 to 3500. The runtime for the TC-NNC algorithm ranges from 1.02 seconds ( n =

  1. to 3.11 seconds ( n = 3500), which is much faster than the TC-RNN algorithm (4 seconds to 14 seconds), but is slightly slower than the IR algorithm (0.6 seconds to 4 seconds). Figure 2(b) compares the quality of the solutions, i.e., the ratio of ( d -MST weight/MST weight), for the same input graphs. The ratios for algorithm IR range from 1.45 to 1.10, the ratios for algorithm TC-RNN range from 1.35 to 1.05, and the ratios for algorithm TC- NNC range from 1.37 to 1.07. These experimental results demonstrate that algorithm TC-NNC, like algorithm TC- RNN, consistently produces solutions of better quality than algorithm IR does. To study how the degree constraints may affect the performance of these algorithms, we compared the three algorithms using a randomly weighted graph of 2000 nodes with varying degree constraints. Figure 3 presents the experimental results. When the degree constraint increases from 2 to 10, the execution times of these algorithms decrease and approach the same limit. The quality-of-solutions of algorithm TC-RNN ranges from 1.04 to 1.33, the quality-of-solutions of algorithm IR from 1.08 to 1.21 (with minimum d = 4), and the quality-of- solutions of algorithm TC-NNC from 1.04 to 1.33. These results demonstrate that the TC-NNC algorithm seems stable and competitive over a range of the degree constraints. (a) MP-I Execution Time (b) Quality of Solutions Figure 2. Comparison of IR, TC-RNN, and TC-NNC for computing d -MST with degree-bound d = 5, using randomly-weighted complete graphs with an MST forced to have max-degree 20. (a) MP-1 Execution time (b) Quality of Solutions Figure 3. Comparison of IR, TC-RNN, and TC-NNC for computing d -MST with varying degree-bound d , using a randomly-weighted complete graph of 2000 0 2 4 6 8 10 12 14 16 500 1000 1500 2000 2500 3000 3500 Number of Nodes (5-MST) Tim e^ (secs) TC-RNN IR TC-NNC

500 1000 1500 2000 2500 3000 3500 Number of Nodes (5-MST) 5-M STweight / M STweight TC-RNN IR TC-NNC 2000 Nodes 1

2 3 4 5 6 7 8 9 10 Degree-limit d-MST weight / MST weight IR TC-RNN TC-NNC 2000 Nodes 0 5 10 15 20 25 30 2 3 4 5 6 7 8 9 10 Degree lim it Time (secs) TC-RNN IR TC-NNC

[23] Y. Yamamoto. The Held-Karp algorithm and degree- constrained minimum 1-tree. Mathematical Programming , 15:228-238, 1978.