# On the Optimum Requirement Graph Problem

(1)

## On the Optimum Requirement Graph Problem

### Abstract

Given a requirement aij for each pair of nodes i,j ∈ {1..n}, the optimum requirement graph prob-lem looks for a k-edge graph H such that the routing cost i<jaijdH(i, j) is minimum, where

dH(i, j) is the number of edges of the shortest path

between i and j on H. In this paper, we show that the problem is NP-hard and give a constant ratio approximation algorithm. Furthermore, we deﬁne a suﬃcient condition for the problem to be polynomial-time solvable.

### Introduction

Finding spanning subgraphs of a given graph is a classical problem of network design. Typi-cally, we are given a nonnegative edge-weighted graph G. The weight on each edge represents the distance and reﬂects both the cost to install the link (building cost) and the cost to traverse it after the link is installed (routing cost). Let

G = ({1..n}, E, w) be an undirected graph, where w is a nonnegative edge weight function. The

building cost of G is w(G) = e∈Ew(e), and the routing cost ofG is c(G) = i<jaijdG(i, j), whereaij is the requirement between the two ver-tices, anddG(i, j) is the length of the shortest path between the two vertices. For the case where all the requirements are one, the routing cost of a graph is the sum of all distances in the graph, and was studied under various name in graph theory. For example, it was named as the transmission of a graph in [15].

When considering the building cost only, we are looking for the minimum weight spanning

sub-graph. The optimal solution is the minimum

weight spanning tree (MST) or forest of the graph. However, removing any edge from a graph will in-crease the routing cost unless such an edge can be replaced by a path with the same or smaller length. Therefore graphs with smaller routing cost might come up with larger building cost, and we often need to make a tradeoﬀ between the two costs.

A large number of researchers have studied the problems of ﬁnding a spanning tree with minimum weight or minimum routing cost. Eﬃcient polyno-mial time algorithms for the MST were developed (for example, see [4, 7]). Hu showed how to con-struct a spanning tree with minimum routing cost for two special cases in [10]. When the distances between every two vertices are the same, he gave a polynomial time algorithm to ﬁnd the optimal solution. When all the requirements are the same, he gave a suﬃcient condition for the optimal tree to be a star. The optimal tree for a graph with identical requirements is referred as a minimum

routing cost spanning tree(MRT), or a shortest

to-tal path length spanning tree. In [8, 11], the MRT problem has been shown to be NP-hard , and 2-approximation algorithms were given in [5, 16]. Approximation algorithms with better error ratios were developed in [17], and a polynomial time

ap-proximation scheme(PTAS) for the MRT problem was presented in [18]. Some extensions of the MRT problem were also investigated. Given nonnega-tive weights of vertices, the product-requirement (or the sum-requirement) MRT problem assumes

Proc. of the 19th Workshop on Combinatorial Mathematics and Computation Theory

(2)

that the requirement between two vertices is the product (or the sum, respectively) of their weights. Constant ratio approximation algorithms for these two generalized problems were given in [19], and a PTAS for the product-requirement MRT was shown in [20].

In this paper, we consider the problems of ﬁnd-ing spannﬁnd-ing subgraphs with small buildﬁnd-ing and routing costs. Instead of the general problem with arbitrary requirements and arbitrary distances, we shall focus on the special case that the distances

dG(i, j) are all equal to one, while the

require-mentsaij are arbitrary. We shall call the optimum graph in this case the optimum requirement graph (ORG). An example is illustrated in Figure 1.

Letn be the number of vertices and k the build-ing cost constraint. Ifk = n−1, the ORG problem is equivalent to the optimum requirement spanning

tree problem in [10], and can be optimally solved in polynomial time. Here we consider a more gen-eral case whenn − 1 ≤ k ≤ n(n − 1)/2 and obtain the following results.

• The NP-hardness of the ORG problem for

generalk.

• A suﬃcient condition such that the ORG can

be found in polynomial time. Interestingly, it includes the product requirement and sum requirement cases.

• An approximation algorithm with error ratio

1 + (n − 1)/k. It should be noted that this error ratio is no more than 2.

Several results for trees realizing tradeoﬀs be-tween weight and some distance requirements were studied before. In [12], Khuller et al showed that it is possible to construct a spanning tree balanc-ing the minimum spannbalanc-ing tree and the short-path tree of a speciﬁed node. The NP-hardness of ﬁnd-ing the minimum diameter subgraph with budget constraint was established in [14], while a poly-nomial time algorithm for ﬁnding the minimum diameter spanning tree of a graph with arbitrary edge weights was given in [9]. Considerable work has been done on the spanner of a graph. In gen-eral, a t-spanner of G is a low-weight subgraph ofG such that, for any two vertices, the distance on the spanner is at mostt times the distance in

G. Some results of ﬁnding spanner of a weighted

graph can be found in [1]. Obviously, the spanners can be used to approximate the minimum rout-ing cost subgraph problem with arbitrary require-ments. But since the criteria for a spanner are often much stricter, we may often come up with

better results if we wish to minimize the routing cost only.

The remaining sections are organized as follows. Some basic assumptions are given in Section 2. The NP-hardness of the ORG problem is shown in Section 3, and the approximation algorithm and polynomial-time solvable cases are in Section 4.

### Preliminaries

In this paper, a graph is a simple and undi-rected graph with unweighted edge. The require-ments are assumed to be nonnegative. Let G = (V, E) be a graph with nodes set V and edge set

E, and n be the number of vertices of G. The

distance dG(u, v) between vertices u and v in G is the number of edges of the shortest path in G between them. The weight of graphG is the total number of edges inG.

Definition 1. Let G = ({1..n}, E) be a graph

andaij be the requirement between verticesi and

j. The routing cost of a graph G is deﬁned as c(G) =i<jaijdG(i, j).

Note that the summation is over all unordered

pairs of vertices, i.e. the routing cost between two vertices i and j is counted only once. In some other papers, the summation is over all pairs, and the routing cost is therefore exactly twice of that deﬁned in this paper. Since we consider only undi-rected graph, the two deﬁnitions are equivalent. Also, the input requirements are assumed to be symmetry , i.e. aij = aji for all i and j, and only one of them appeared in the deﬁnition. If the input requirements aij is not symmetry, we can set bij =bji =aij +aji. Since the path is undi-rected, the routing costijaijdG(i, j) is the same as i<jbijdG(i, j).

Definition 2. Given a set of nonnegative re-quirements A = {aij|1 ≤ i < j ≤ n} and an integerk, the optimal requirement graph, denoted byORG, is a graph G = ({1..n}, E) such that the routing cost of G is minimum among all graphs withk edges, where n − 1 ≤ k ≤ n(n − 1)/2. If the vertex set can be partitioned into two sub-sets such that there is no requirement cross the two subsets, we may solve the problem individu-ally. Here we assume that there is at least one positive requirement for any cut.

Proc. of the 19th Workshop on Combinatorial Mathematics and Computation Theory

(3)

1

2

3

4

5

6

1

2

3

4

5

6

### (b)The optimum requirement graph

Figure 1: An instance of the optimum requirement graph problem. (a)The input requirements among nodes. Requirements not shown are assumed to be zero. (b)The optimum graph fork = 6. The routing cost is (10 + 10 + 5 + 5 + 5 + 2)× 1 + (2 + 2 + 1) × 2 = 47. The distances between N1 andN3, N3and

N5,N5and N6are twos; while distances between node pairs with nonzero requirements are all ones.

### The NP-hardness

In this section, we shall show that the ORG problem is NP-hard by reducing the 2-spanner problem to it. The deﬁnition of the 2-spanner problem is as follows:

Definition 3. Let G = (V, E) be a connected

graph. A subgraph H = (V, F ), F ⊂ E, of G

is a 2-spanner of G if dH(i, j) ≤ 2dG(i, j) for all verticesi and j.

Definition 4 . Given a graph G = (V, E), the minimum spanner problem is to ﬁnd the 2-spanner with minimum number of edges. Given an integerk ≥ n − 1, the decision version of the min-imum spanner problem asks if there exists a 2-spanner with no more thank edges. The decision problem is referred to as the 2-spanner problem in this paper.

Theorem 1. The ORG problem is NP-hard even

for the case that all requirements are either 1 or 0.

Proof: We transform the 2-spanner problem to the ORG problem. Given an instance of the 2-spanner problem by the graph G = (V, E) and an integerk, we construct an instance of the ORG problem as follows. For any edge (i, j) ∈ E, we set the requirementaij= 1 andaij = 0 otherwise. The edge constraint of the ORG problem is set to

k. We claim that the ORG problem has a solution

with routing cost at most 2a∗− k if and only if there is a 2-spanner ofG with k edges, where a∗= 

i<jaij is the total requirement.

Suppose that H = (V, F ) is a 2-spanner of

G and |F | = k. Consider H as a solution of

the ORG problem. Every edge in H corresponds to one requirement. There are k requirements are directly routed by one edge. Since H is a 2-spanner, the other requirements are routed by two edges. Consequently the routing cost ofH is

k + 2(a∗− k) = 2a− k. Conversely, suppose that

the ORG problem has a solution H with routing cost 2a∗− k. For any k-edge graph, there are at most k requirements can be routed by only one edge and the others needs at least two edges. The lower bound of the routing cost of a k-edge sub-graph is 2a∗−k, and such a routing cost is achieved only whenk requirements are routed by one edge and all others by two edges. Therefore every edge in H is also an edge in G and dH(i, j) = 2 for any edge (i, j) in G but not in H. It also implies that H is a 2-spanner of G. Since the 2-spanner problem is NP-complete [3, 13], by the above re-duction, the ORG problem is NP-hard.

### Polynomial-time algorithms

In the following, we shall deﬁne a suﬃcient con-dition that the ORG problem can be solved in polynomial time.

Definition 5. For a set of requirements {aij},

a vertex m is a heavy vertex if aim ≥ aij for all verticesi and j.

Theorem 2. The optimal requirement graph problem can be solved optimally in O(n2) time if the input contains a heavy vertex.

Proc. of the 19th Workshop on Combinatorial Mathematics and Computation Theory

(4)

Proof: Without loss of the generality, we assume that vertex n is the heavy vertex. Let

Y = {ain|1 ≤ i < n} and X be the subset of

the largest k − (n − 1) requirements of the set

{aij|1 ≤ i < j ≤ n − 1}. Let a∗ be the total

requirement, and x and y be the total require-ment in X and Y respectively. For a graph with

k edges, there are only k requirements may be

routed directly and others will be routed by at least two edges. Since there is at least one edge incident to each vertex and n is the heavy ver-tex, for any graph G with k edges, the routing cost c(G) ≥ (x + y) + 2(a∗− (x + y)), and the equality holds when the requirement in X ∪ Y are routed directly and others are routed by ex-actly two edges. However, the graph with edge set

{(i, j)|aij ∈ X ∪ Y } achieves the lower bound of

the routing cost. Therefore such a graph is opti-mal and can be constructed in O(n2) time by a linear time algorithm [2] ﬁnding the k-th largest element in a set ofO(n2) numbers.

The next two corollaries can be proved simi-larly.

Corollary 3. Any graph with diameter 2 is an

optimal solution of the ORG problem with identi-cal requirements.

Corollary 4. Let A be a set of requirements over a vertex set {1..n} and A1 be the subset of the largest k requirements in A. Assume H = ({1..n}, E), where E = {(i, j)|aij ∈ A1}. If the

diameter ofH is 2, then H is the ORG.

Letqi be a nonnegative weight of vertex i. As deﬁned in [19], requirements are called product

re-quirements(or sum requirements) ifaij =qiqj (or

aij =qi+qj respectively) for all verticesi and j.

Corollary 5. The ORG problem with product

requirements or sum-requirements can be solved inO(n log n + k) time.

Proof: Letqibe the given nonnegative weight of vertex i. Sort the vertices by their weights in nondecreasing order. We have qi ≤ qi+1 for all

i < n. The requirement matrix is a sorted matrix, i.e. all rows and columns are sorted. Obviously the vertexn is a heavy vertex. By theorem 2, all we need to do is to ﬁnd the k − (n − 1) largest numbers in the set{qij|1 ≤ i < j < n}. Since it is a sorted matrix, the selection can be done inO(n) time by the algorithm in [6]. Then it takesO(k) time to report the selected requirements , and the time complexity isO(n log n + k).

We now turn to an approximation algorithm for the ORG problem with arbitrary requirements. The idea is to take a vertexm as if it was a heavy vertex. We connect all other vertices to it, i.e.

m is the center of the constructed graph, and the

remainingk−(n−1) edges are added to the vertex pairs with larger requirements. Since the diameter of the constructed graph is two, the cost is within twice of that of the optimum. The next theorem gives us a slightly better result for largek.

Theorem 6. The ORG problem with arbitrary

requirements can be approximated with error ratio 1 + (n − 1)/k in O(n2) time.

Proof: LetA1be the summation of the largest

k requirements and the remaining total

require-ment be A2. Obviously the routing cost of the optimal graph is no less than A1+ 2A2. LetA3 be the summation of the largest k − (n − 1) re-quirements. For the constructed graph, since its diameter is two and the largest k − (n − 1) re-quirements are routed directly, its routing cost is no more than A3 + 2(A1 − A3+A2). Since

A3 ≥ ((k − n + 1)/k)A1, the relative error ratio

is 1 + (n − 1)/k. The time complexity is domi-nated by the time to select the largestk − (n − 1) requirements. By a linear time algorithm for the selection problem, the time complexity is O(n2) since there areO(n2) requirements.

In fact, there exists a vertexm such that there are at least 2k/n of the largest k requirements incident to m. By choosing m as the center, we may get a little better ratio but it is not asymp-totically better.

### References

[1] I. Alth¨ofer, G. Das, D. Dobkin, D. Joseph, and J. Soares, On sparse spanners of weighted graphs, Discrete and Computational

Geome-try, 9(1993), pp. 81–100.

[2] M. Blum, R.W. Floyd, V.R. Pratt, R.L. Rivest, abd R.E. Tarjan, Time bounds for se-lection, J. Comput. Syst. Sci., 7(1972), pp. 448–461.

[3] L. Cai, NP-completeness of minimum spanner problems, Discrete Applied Math., 48(1994), pp. 187–194.

[4] T.H. Cormen, C.E. Leiserson, and R.L. Rivest, Introduction to Algorithms, the MIT Press, 1994.

Proc. of the 19th Workshop on Combinatorial Mathematics and Computation Theory

(5)

[5] R.C. Entringer, D.J. Kleitman, and L.A. Szekely, A note on spanning trees with min-imum average distance, Bulletin Inst. Comb.

Appl., 17(1996), pp. 71–78.

[6] G.N. Frederickson and D.B. Johnson, Gener-alized selection and ranking: sorted matrices,

SIAM J. Computing, 13(1984), pp. 14–30. [7] M.L. Fredman and R.E. Tarjan, Fibonacci

heaps and their uses in improved network optimization algorithms, J. of the ACM, 34(1987), pp. 596–615.

[8] M.R. Garey and D.S. Johnson, Computers

and Intractability: A Guide to the Theory of NP-Completeness, W.H. Freeman and Com-pany, San Fransisco, 1979.

[9] R. Hassin and A. Tamir, On the minimum diameter spanning tree problem, Information

Processing Letters, 53(1995), pp. 109–111. [10] T.C. Hu, Optimum communication spanning

trees, SIAM J. Computing, 3(1974), pp. 188– 195.

[11] D.S. Johnson, J.K. Lenstra, and A.H.G. Rin-nooy Kan, The complexity of the network design problem, Networks, 8(1978), pp. 279– 285.

[12] S. Khuller, B. Raghavachari, and N. Young, Balancing minimum spanning trees and shortest-path trees, Algorithmica, 14(1995), pp. 305–321.

[13] D. Peleg and A.A. Sch¨aﬀer, Graph spanners,

J. Graph Theory 13(1989), pp. 99–116. [14] J. Plesnik, The complexity of designing a

network with minimum diameter, Networks, 11(1981), pp. 77–85.

[15] J. Plesnik, On the sum of all distances in a graph or digraph, J. of Graph Theory, 8(1984), pp. 1–21.

[16] R. Wong, Worst-case analysis of network de-sign problem heuristics. SIAM J. Algebraic

Discrete Methods, 1(1980), pp. 51–63. [17] B.Y. Wu, K.-M. Chao, and C.Y. Tang,

Ap-proximation algorithms for the shortest total path length spanning tree problem, Discrete

Applied Math., 105(2000), pp. 273–289.

[18] B.Y. Wu, G. Lancia, V. Bafna, K.-M. Chao, R. Ravi, and C.Y. Tang, A polynomial time approximation scheme for minimum routing cost spanning trees, SIAM J. Computing, 29(2000), pp. 761–778. A preliminary version appeared in the Proceedings of the Ninth

An-nual ACM-SIAM Symposium on Discrete Al-gorithms (SODA’98), pp. 21–32, 1998. [19] B.Y. Wu, K.-M. Chao, and C.Y. Tang,

Ap-proximation algorithms for some optimum communication spanning tree problems,

Dis-crete Applied Math., 102(2000), pp. 245–266. Partial results of this paper appeared in the

Proceedings of the Ninth Annual Interna-tional Symposium on Algorithm and Compu-tation (ISAAC’98), Lecture Notes in Com-puter Science, (Springer Verlag), Vol. 1533, pp.407-416, 1998.

[20] B.Y. Wu, K.-M. Chao, and C.Y. Tang, A polynomial time approximation scheme for optimal product-requirement communication spanning trees, J. Algorithms, 36(2000), pp. 182–204.

Proc. of the 19th Workshop on Combinatorial Mathematics and Computation Theory