Compur. Opns Res. Vol. 15, No. 2, pp. 103-113, 1988
0305-0548/88
THE LOCATION REX
K.
$3.00 + 0.00
CopyrIght 0 1988 Per@,,,On Journals Ltd
Printed in Great Britain. All rights reserved
OF CENTRAL
KINCAID”~,
TIMOTHY
STRUCTURES
J. LDWE’*$ and
THOMAS
IN TREES L. MORIN~$
‘Department of Mathematics, College of William and Mary, Williamsburg, VA23185. ‘Krannert Graduate School of Management, Purdue University and ‘School of Industrial Engineering, Purdue University, West Lafayette, IN 47907, U.S.A.
(Received October 1986; revised Maq’ 1987)
Scopeand Purpose-- We study four constrained optimization problems posed on trees. The first two are path location problems with a minimax type objective function. The other two are subtree covering location problems. All four problems are relatively new to the network location literature (see [1,2] for recent surveys). We extend previous work on the path location problems to include nonlinear functions of the distance measure. This extension allows situations in which travel time is a nonlinear function of travel distance to be modeled. In the absence of these nonlinear functions we give linear time algorithms for one of the path location problems and one of the subtree covering problems. The complexities of these two algorithms are the best to date for these problems. Abstract-A nonlinear version of the path center location problem is analyzed. We introduce a closely related problem called the subtree location problem. Variants in which the endpoints of the central structure to be located may or may not be restricted to the vertex set are also studied. We give theoretical results for the nonlinear cases when the underlying structure is a tree with edges of varying length and linear time algorithms for the unweighted vertex case. The linear time algorithms have their basis in an efficient data structures for representing trees.
1. INTRODUCTION
Traditional center and covering problems are point location studies, however, there are a host of meaningful problems in which structures (paths or subtrees) instead of points are required. Examples of such problems include the location of pipelines, evacuation routes, mass transit routes, and routes for AGVs (automated guided vehicles) in flexible manufacturing systems. These problems provided impetus for Slater [3,4], Hedetniemi, Cockayne and Hedetniemi [S], and Minieka [6] to propose various central structure location problems. In particular, Slater [4] and Hedetniemi et al. [5] gave linear time algorithms to locate a path with the fewest vertices such that the maximum distance to all vertices not in the path is as small as possible. The solution is termed a path center and was posed on a tree with edges of equal length. This development was essential, but limited. Realistic problems involve trees where edge lengths may vary and weights may be assigned to the vertices. Minieka [6] provided the first extension. He solved, in polynomial time, a path center location problem with an equality constraint on the length of the path to be located for trees with edges of any nonnegative length. A second extension is provided by Kim, Lowe, Ward and Francis [7]. They solve, in linear time, a nonlinear subtree cover problem for trees with edges of any nonnegative length. We develop the theoretical framework for nonlinear versions of the path center location problem in which the edge lengths may vary, the endpoints of the path center may be any point along an edge (as opposed to just vertices), and increasing, continuous, nonlinear vertex weight functions are allowed. In addition, we analyze the subtree cover location problem. We discuss its applications and natural relationship to the path center problem. Finally, we provide linear time algorithms for tRex K. Kincaid is Assistant Professor of Mathematics at the College of William and Mary. He received his Ph.D. in operations research in the School of Industrial Engineering and his M.S. in applied mathematics both from Purdue University. His B.A. is from DePauw University. His current research interests include network location and multiobjective optimization. :Timothy J. Lowe is Professor of Management in the Krannert Graduate School of Management at Purdue University. He received a B.S. and a Master’s degree in industrial engineering from Iowa State University and a Ph.D. in operations research from Northwestern University. His research interests include location theory, logistics, and mathematical programming theory and algorithms. His research articles have appeared in several journals including Management Science. IIE Transactions, Mathematical Programming, and Operations Research. @Thomas L. Morin is Professor of Operations Research in the School of Industrial Engineering at Purdue University. He received a B.A. from Rutgers University and a Ph.D. in operations research from Case Western Reserve Univeristy. Professor Morin is a Fulbright Scholar who is known for his work in dynamic programming. He is a principal investigator for the Office of Naval Research’s University Research Initiative in Computational Combinatorics at Purdue University. 103
REX K. KINCAIDet al.
104
both path center and subtree cover optimization problems posed on trees with unweighted vertices and edges of varying length. The plan of our paper is as follows. In Section 2 we formally introduce the problems to be studied. Our theoretical results are presented in Section 3, and Section 4 describes the two linear time algorithms in detail. The paper concludes with a discussion in Section 5. 2. PRELIMINARIES
We begin with a presentation of relevant graph theoretic results. The interested reader is referred to Harary [8] for further explanations and examples. A tree T( V, E) is defined to be a finite, connected, undirected, acyclic graph. The vertex set of T is denoted V and the edge set E. We assume that the edge lengths of T are all positive. A subtree of T is a connected subgraph of T. Given a subtree S of T, we let V(S) and E(S) denote the vertices and edges of S. An endvertex of S is a vertex of S of degree one relative to the edge set of S. Given points x and y in T (x and/or y can be vertices of T or points on the edges of T) we denote the path between x and y by P(x, y) and its length by d(x, y). Given a path P(x, y) and a vertex v $ P(x, y), we define d(v, P) by Min(d(v, z) 1z E P). Also, when A is an arbitrary set, and USEA, then A\ai denotes the deletion of ai from A. For trees this operation is defined whenever the set A is V(T), or E(T). Throughout the paper the symbol V means “for all”. The path center location problem is an extension of the point center location problems. An absolute center (vertex center) is the point in T (vertex of T) for which the vertex furthest away from it is as close as possible. Point center solutions are crucial to the development of our algorithms for locating paths and subtrees. Two nonlinear versions of the path center location problem, (NLPl) and (NLP2), are defined below. Determining the optimal location of an evacuation route is an example of a problem that could be formulated as either (NLPl) or (NLP2). The minimax objective is appropriate due to the emergency setting of the evacuation route location problem. The constraint on the length of (or the number of vertices in) the evacuation route provides a way to include the cost of maintaining such a route. ‘(NLPl) s.t.
Min e(P) I W)l~
(NLP2)
Min e(P)
c
e(P’) > e(P)VP’ c P
e(P’) > e(P)VP’ c P
P, P’ paths
4
CEZ+
In (NLPl) the endpoints of the path center are restricted to V(T) while in (NLP2) they can be any point of T. In both (NLPl) and (NLP2), e(P)= Max(fj(d(vj,P))lVjEV(T)) and the vertex weight functions fj can be any continuous increasing functions. We note that for (NLPl), d(vj, P) = Min(d(uj, Vi)1UiE V(P)). For (NLP2), since x and y (the endpoints of P) need not be vertices of T, we have d(vj, P) = Min(d(vj, xi) 1X~E V(P)u {x} u (y})). In (NLPl), C is an integer and is a restriction on the number of vertices in P. In (NLP2), l(P) is the length of the path P and U 3 0 is an upper bound on that length. In both problems, the path containment constraint e(P’) > e(P) ensures that when paths P, and P, satisfy e(Pl) = e(P,), but P, c P, then P, is not the optimal solution. Furthermore, we assume that C 2 2 in (NLPl) in order to avoid trivial paths. [If C = 1, then (NLPl) is equivalent to the nonlinear vertex center problem.] These assumptions do not preclude the possibility that the optimal path center may contain only one vertex. It simply is not constrained to be so. We note also that if P* solves either (NLPl) or (NLP2), then e(P*) < e(x), whenever x is either an absolute or vertex center, since a point is a degenerate path. The covering problems (NLSTI) and (NLSTZ) defined below arise naturally from (NLPl) and (NLPZ). A potential application for (NLSTl) and (NLST2) is the problem of locating a main material handling system (MMHS) for a flexible manufacturing system (FMS). We desire that the MMHS cover a graph representing the floor layout of the factory. By cover we mean that the MMHS be within r (3 0) units of distance from each machine center, where the machine centers are located at the endvertices of a graph. (NLSTl) and (NLST2) will construct a tree to do this with as few vertices
The location
of central
Min
IV(S)
S.1.
d(Vj,S)~
2 e(S)
for all SCS
a subtree
I
Fig. 1. Example
105
in trees
I
e(S)> 5,s
structures
of vertex restricted
e
subtree
covering
problem-(NLSTI).
as possible, or of minimum total length, respectively. We call these problems subtree cover problems since a path solution is not guaranteed to exist for certain values of r. Indeed, Fig. 1 illustrates a situation in which unless edge e is added the constraint will not be satisfied. Hence, a subtree of T(V, E) is required for a solution to exist. As expected the endpoints of the subtree cover in (NLSTl) are required to be vertices while in (NLST2) they are not. d(uj, S) is defined analogous to d(vj, P) in the previous problems. Also, in NLST2, I(S) is the sum of the edge lengths in the subtree S.
e(S’) > e(S)VS’ c S
(NLST2)
Min I(S)
s.t.
fjCdCuj,
S))G
r
e(S’) > e(S)VS’ c S S, S’ subtrees rE.JA+
3. THEORETICAL
RESULTS
Our approach to solving the nonlinear path center problems (NLPl) and (NLP2) and the nonlinear subtree covering problems (NLSTI) and (NLST2) is the same; namely, locate an absolute center or vertex center and grow the path center or subtree cover from it until a constraint is violated. In this section we prove results that establish the validity of this approach. We first note that specialized versions of problems (NLP2) and (NLST2) have been studied by Minieka [6] and Kim et al. [7] respectively. Kim et al. solve, in linear time, a problem identical to (NLST2) without the subtree containment constraint by using a dual based approach. Minieka solves a version of (NLP2), in polynomial time, in which each fj is a constant valued function for all j and the constraint on the length of the path is an equality constraint. With regard to this specialized version he proved the following lemma. Lemma I. If x is an absolute center of a tree T, then x is contained in the path center (as defined in [ 1 I]) St” r
In a tree network without vertex weights there are easy, O(n), algorithms to find the absolute and vertex centers (see Tansel, Francis and Lowe [ 1,2]). Several of these algorithms are based upon finding the longest path of the tree first, and then calculating its midpoint. If the midpoint is a vertex, then the absolute center and vertex center are coincident at that point. Otherwise, the absolute center is the midpoint and a vertex center is the closest vertex (or vertices in case of a tie) to the midpoint. Analogous ideas have been developed by Dearing [9] and Francis [lo] to locate a one center for the
REX K.
106
KINCAID ef al.
case when the weights on the vertices are nonlinear continuous increasing functions of the distance metric. In particular Dearing [9] established that the absolute center is unique for the nonlinear version of the absolute center problem on trees. Moreover, Dearing [9] proves that if the vertex weight functions are nonlinear, continuous, increasing functions of the shortest path distance metric and the underlying graph is a tree, then the resulting optimization problem is the minimization of a strict quasiconvex function. It is easy to see then that a solution to the nonlinear vertex center problem on a tree is not necessarily unique. However, due to strict quasiconvexity the only candidates for the vertex center(s) (whenever the absolute center is not a vertex) are the endvertices of the edge containing the absolute center. We now state and prove a theorem that extends the result of Lemma 1. We let the edge lengths of T be any positive real numbers with weights allowed on the vertices. In fact, following Dearing [9] and Francis {lo], we allow the weights to be any nonlinear function of the shortest path distance as long as these functions are increasing and continuous. In what follows, let x* be the absolute center of T, and let u* be a vertex center. Furthermore, let Pj* be an optimal path center solution to (NLPj) for j = 1,2. Theorem 1. (a) x*cPi*,j= 1,2. (b) U*EP:. (c) If there are two
(ur,uZ)nP$
distinct vertex centers, UT and UT, then the edge (VT,I$) satisfies # 0. Further, if U >&$,u;), then uj*EPf,j= 1,2.
proof. With x* an absolute center, there exist vertices ui and yj such that x* E P(vi, uj) and
To establish (a), let P* represent both PT for (NLPL) and PT for (NLP2). Suppose to the contrary that x* $ P* and let z be the closest point in P* to x *. But then, a result due to Francis, Lowe and Ratliff [ll] states that either x* is on the path from ui to z or x* is on the path from uj to z. Assume, without loss of generality, the former case. We note that d(ui, z) = d(yj, P*) > d(vi, x*), so that fi(d(oi, P*)) > fi(d(vi, x*)). But then, e(P*) > e(x*), a contradiction. Thus, x* E P*, whichcompletes the prooffor (a). To prove (b), we consider two possible locations for the absolute center x* in T. Either x* is a vertex of T or it is not. If x* is a vertex of T then x* is the only vertex center of T and it follows from (a) that x* is contained in PT. Thus, suppose that x* is not a vertex of T, so that x* is contained in some edge e = (u,, v2) of T. Then the only candidates for vertex center(s) of T are ui and u2 (see [9]). We assumed, however, that C 3 2 for (NLPI). Consequently, it is clear that both u1 and u2 are contained in P:, so that Pt contains the vertex center(s) of T. The proof of part (c) follows immediately from (a) and (b). The impact of this theorem is twofold. First, we observe that the collection of points that are centers (vertex and absolute) induce a central structure that is contained in the path center. Secondly, it provides us with a starting point from which to grow the path center. When the underlying graph is a tree we also have Theorem 2. The path center solution to problems (NLPI) and (NLP2) is unique whenever the underlying gruph is a tree. Proof. Case 1. Problem (NLPl).
Suppose to the contrary that a path center solution is not unique. Then there exist two paths P, and P; of minimum eccentricity such that P, # P; and neither path is contained in the other. Furthermore, P, and Pi must have a nonempty intersection, I, as a consequence of Theorem 1. Let u, $1/(Z) be an end vertex of P, (clearly at least one endvertex of P, is not in I) and label the closest vertex in I to ot by 6,. Now I is a path and let F(Z) = (Ui, . . . , Vi) where i 3 1, Consider the first edge on the path from z+to 6, and label it (u,, us),where u, may be the same vertex as 6, if P(u,, &) has only one edge. The deletion of edge (u,, u,) partitions V(T) into two disjoint sets V,and V, as depicted in Fig. 2 with v, E V,, u, E V,, and V,u V,= T/(T). Note that u, is the only vertex of P, E V,; therefore, it is the
The location of central structures
in trees
107
Fig. 2. Example for proof of Theorem 2
closest point of P, to any other vertex of V,. Now, there must exist some vertex vk E V,, where
For if not, then the path P’= Pl\(v,, vJ~P, attains e(P’)
since d(v,, U1)= d(v,, vs) + d(v,, 17~)).Thus, since e(P;) >fk(d( vk, 17~))we have e(P;) > e(Pl) which is a contradiction and, therefore, P, = Pi. Case 2. Problem (NLP2) Suppose that P, and P; are optimal solutions to problem (NLP2), where P, # pi, and let I be defined as in Case 1 of this proof. Let x, be any endpoint of P, such that x, $1. [Recall that the endpoints of path centers are not restricted to the vertex set for (NLP2).] Similar to Case 1, it can be shown that there exists a vertex vkwhere fk(d(uk, x,)) = e(PJ and x, is on the path from ukto the closest point in Pi. But then, since fk is an increasing function, we have e(P,) > e(P2) which is a contradiction. The same argument holds mutatis mutandis for an endpoint of Pi. Therefore P, = Pi. Before proceeding with descriptions of the algorithms in Section 4, we give an explanation of the stopping criteria and prove the validity of the constructive approach of the algorithms. The algorithms given in Section 4 are for (NLPI) and (NLSTl) with the assumption that fj = b (b E 2) for all j. We focus on algorithms for these two problems since no algorithms currently exist for them. Minieka [6] and Kim et al. [7] have developed algorithms for problems closely related to (NLP2) and (NLSTZ) respectively. Our algorithms construct the path center iteratively beginning with either a vertex or the absolute center and successively append adjacent edges. However, if T\P(k) has three or more components each of which contains a vertex of maximum eccentricity, or there is a vertex of P(k) with eccentricity greater than or equal to the eccentricity of the endvertices, then we can no longer append additional edges, maintain a path structure, and gain further improvement in the objective function. We next prove the validity of the solution procedure for problem (NLPl).
108
REX K. KINCAIDet al. I = P (vs.vr P(v,&
c
1 P(k 1
P(vk_, ,v ) = PC k-t)
“k-1
Fig. 3. Example for proof of Theorem 3.
Theorem 3. Let P(C) be the optimal path center to problem (NLPl). (Recall that C is the right hand side ofthe constraint on 1V(P)l.) Then P(k - 2) c P(k) for all k < C. Proof. Throughout the proof we will make use of the following facts about path centers: (i) every vertex center is contained in every path center, (ii) P(k) is unique for any k such that 2 6 k G C, and (iii) if P’ is a subpath of P(k), then e(P’) > e(P(k)). If e(P(k - 1)) = e(P(k)), then we are done. That is, if P(k - 1) solves problem (NLPl) for C = k - 1 and e(P(k - 1)) = e(P(k)), then P(k - 1) is an optimal solution for C = k, and since the path center is unique (Theorem 2), P(k - 1) = P(k). Thus, for the remainder of the proof we shall assume e(P(k - 1)) > e(P(k)). Suppose to the contrary that P(k - 1) # P(k). We know that P(k - l)n P(k) # @ since both contain the vertex center(s) of T. Let uk_ 1 be an endvertex of P(k - 1) which is not contained in P(k) and let uqbe the vertex which is the closest point in P(k) to uk_ 1. We note that uqE P(k - 1) since I = P(k - 1)n P(k) # 0. Let ur be the vertex adjacent to uk_ 1, where u1 E P(u, _ 1, uq). Finally, let v be the set of vertices such that u E v if and only if P(u, _ 1, u) n P(u, _ 1, u,J = uk_ 1; and let u, be a vertex of v which is farthest from uk_ 1. Figure 3 depicts the above definitions. We note in the figure that ur = v, is possible, but vk_ 1 = u1 is not possible [since uk_1 4 P(k) by assumption]. We note that
d(u,,ul) > e(P(k- l)),
(1)
because otherwise the subpath obtained from P(k - 1) by removing vk_ 1 and the edge between vk_ 1 and u1 would have the same eccentricity as P(k - l), which contradicts the optimality of P(k - 1). Now, with vr E P(u, _ r, v,), we have d(u,, v,J2 d(v,,UI).
(2)
But with v, being the closest point in P(k) to v, it follows that
e(W)) 2 d(u,,v,J. From
(l), (2) and (3) we have e(P(k)) > e(P(k - 1)) which is a contradiction.
(3) Therefore,
P(k - 1) E P(k).
We do not give the proofs for the similar nested properties that exist for problems (NLP2), (NLSTl), and (NLSTZ) since they follow mutatis mutandis. Theorem 3 verifies that our constructive approach to solving problem (NLPl) is valid.
109
The location of central structures in trees 4. ALGORITHMS
In this section we give linear time algorithms for the unweighted versions (fj = b, b E .!J? for all j) of problem (NLPl), the vertex restricted path center problem, and problem (NLSTl), the vertex restricted subtree cover problem. To implement the algorithms an efficient data structure is employed. It is a canonical (or recursive) representation of T(V, E) and it uniquely represents T. Consider the tree in Fig. 4 with 12 vertices. (Note that the edge lengths are given in parentheses.) The vertex labeled 1 is the root and every other vertex is adjacent to exactly one vertex with a smaller label. R(l, N) below is T’s canonical representation. That is, R( 1, j) is the label of the unique vertex adjacent to vertex j possessing a smaller label than j. R(2, j) gives the length of the edge (R(l, j), j) in E(T).
R=
0 1 1 1 1 2 02124332312
!
3
4
3
9
3
11 2
In our algorithms we choose a vertex center as the root, and if there are two vertex centers, then the vertex center that is not the root has label 2. We base our algorithms on one given in [5] for determining the path center of a tree with equal edge lengths. Our algorithms, however, subsume theirs as a special case since ours apply to trees of varying edge lengths. The variables used in the algorithms are defined below. LEFT, RIGHT ONE(LEFT) ONE(RIGHT) NEXT(LEFT) NEXT(RIGHT) BRANCH TWO(LEFT) TWO(RIGHT)
vertices at the ends of the current path center length of a longest path (from LEFT/RIGHT to an endvertex) that contains no vertex (except LEFT/RIGHT) of the current path center vertex adjacent to LEFT/RIGHT on a path of length equal to ONE(LEFT)/ONE(RIGHT) length of a longest path from an interior vertex in the path center to an endvertex that contains no other vertex of the path center length of a second longest path [from LEFT/RIGHT to an endvertex of T and edge disjoint from ONE(LEFT/RIGHT)] that contains no other vertex of the path center
Algorithm (NLPl) grows the path center out from the vertex center until either the eccentricity, e(P), of the path cannot be decreased further by appending vertices, or )I’(P)1 = C. When e(P) cannot be decreased it implies that the constraint, P is a path, is binding and any further reduction in e(P) would require a subtree that is not a path. We must also keep track of whether or not the vertex center of a tree is a single vertex or two adjacent vertices. If it is a single vertex then we create a dummy vertex, N + 1, which is a copy of vertex 1, the vertex center. We use this dummy vertex to determine if
Fig. 4. T(V, E) with edge lengths
in parentheses.
110
REX
K.KINCAID et al.
the path center consists solely of vertex 1. Both algorithms are stated in pidgin PASCAL similar to the SPARK language found in Horowitz and Sahni [ 121. Note that Steps O-2 are essentially the same as Hedetniemi et al. [5]. We reproduce them here for completeness since these steps are needed for Algorithm NLSTl as well. Algorithm NLPl Input. A canonical representation R of T(V, E) rooted at a vertex center and a variable CTR, such that CTR = 1 if the vertex center is vertex 1 or CTR = 2 if the vertex center is vertices 1 and 2. [When CTR = 1 then THREE is the length of the third longest path (edge disjoint from ONE and TWO) from vertex 1 to an endvertex.] N is the number of vertices in T while C is the upper limit on the number of vertices in the path center PC. Output. A path center PC of T(V, E) with C or less vertices. Step 0. [Initialization] THREE +-0
if CTR = 2 then LAST+-3 else LAST+2
endif for I c 1 to N do ONE(I) +- 0 TWO(I) c 0 NEXT(Z) c 0
end Step 1. [Determine
length of paths ONE and TWO from each vertex]
for END c N to LAST by - 1 do [get remote vertex] REMOTE
+ R&END)
[update ONE and TWO] if ONE(REMOTE) 6 ONE(END) + R(2,END) then if CTR = 1 and REMOTE = 1 then THREE c TWO(REMOTE) NEXT(N + 1) + NEXT(REMOTE) endif TWO(REMOTE) +-ONE(REMOTE) ONE(REMOTE) +- ONE(END) + R(2,END) NEXT(REMOTE) + END
else if TWO(REMOTE) 6 ONE(END) + R(2,END) then if CTR = 1 and REMOTE = 1 then THREE c TWO(REMOTE) NEXT(N + 1) + END endif TWO(REMOTE)
+ONE(END)
+ R(2,END)
endif endif end Step 2. [Initialize PC]
if CTR=2
then PC+{1,2} LEFT+ 1 RIGHT+ 2
else PC+(l)
The location
of central
structures
in trees
Ill
LEFT+ 1 RIGHT-N + 1 TWO(LEFT) + THREE TWO(RIGHT) +-- THREE
endif DIST+ONE(l) BRANCH +- 0 Step 3. [Get the next vertices]
while DIST > max{ TWO(LEFT),TWO(RIGHT),BRANCH} do if /PC1 = C then exit [constraint is tight] if ONE(NEXT(LEFT)) = ONE(NEXT(RIGHT)) then if IPC( 6 C - 2 then PC t PCU {NEXT(LEFT),NEXT(RIGHT)) BRANCH +- max{ TWO(LEFT),TWO(RIGHT),BRANCH) LEFT+- NEXT(LEFT) RIGHT+ NEXT(RZGHT) DIST+ONE(LEFT)
endif else PC +-PCu{NEXT(LEFT)} and exit endif if ONE(NEXT(LEFT)) > ONE(NEXT(RIGHT)) then PC c PCU (NEXT(LEFT)~
else
BRANCH +-max{TWO(LEFT),BRANCH) LEFT+- NEXT(LEFT) DIST+-max{ONE(RIGHT,ONE(LEFT)} PC + {NEXT(RZGHT)J BRANCH +max{TWO(RIGHT),BRANCH} RIGHT+- NEXT(RZGHT) DISTcmax{ONE(RZGHT),ONE(LEFT)}
P~U
endif end Algorithm NLSTl Input. Same as Algorithm (NLPl) except there is no C value. Instead, we have r = RADIUS > 0, the radius of coverage. Output. A subtree cover STC (note that a path is a subtree) such that all vertices not in STC are within r units of STC.
Steps 0, 1 and 2. [same as Algorithm (NLPl) with STC replacing PC] Step 3. [Get the next vertices and label all vertices in STC with a I] while DIST > max{TWO(LEFT),TWO(RIGHT),BRANCH} and DIST > RADIUS do if ONE(NEXT(LEFT)) = ONE(NEXT(RIGHT)) then STC~JSTC(NEXT(LEFT),NEXT(RIGHT)} BRANCH tmax{TWO(LEFT),TWO(RIGHT),BRANCH} LEFT+ NEXT(LEFT) RIGHT+ NEXT(RIGHT) DZST+-ONE(LEFT) R(l,NEXT(LEFT)) = 1 R(l,NEXT(RZGHT)) = 1 else if ONE(NEXT(LEFT)) > ONE(NEXT(RIGHT))
REX K. KINCAIDet al.
112
then STC +-STCu
{NEXT(LEFT)} BRANCH cmax{ TWO(LEFT),BRANCH} LEFT+- NEXT(LEFT) DIST+max{ONE(RIGHT,ONE(LEFT)} R(l,NEXT(LEFT)) = 1 else STC c STCU {NEXT(RIGHT)) BRANCH +max(TWO(RIGHT),BRANCH} RIGHT+- NEXT(RIGHT) DIST+max{ONE(RIGHT),ONE(LEFT)} R(l,NEXT(RZGHT)) = 1
endif end forI+-NtoLASTby -1do if R(lJ) = LEFT then R(l,I) c 1 if R(l,I) = RIGHT then R(l,Z) c 1 end Step 4. [Add vertices to subtree cover]
if DIST > RADIUS then exit forIcNtoLASTby
-1do
END+--1 TEMPtI TOTAL + R(2,END) while TOTAL < RADIUS and END # J and END # 0 do END +- R(l,END) TOTAL + TOTAL + R(2,END)
end END + TEMP
if TOTAL 3 RADIUS then repeat
sTc
+STCU {R(~,END)} TEMPc END END +- C(1,END) R(l,TEMP) + 1 until END = 1
endif end A simple computational complexity analysis demonstrates that Algorithms (NLPl) and (NLSTl) are polynomial, in fact linear, time. Let N = 1V(T)I. Clearly Step Ocan be done in O(N) time. The loop in Step 1 requires that each of the statements in Step 1 be executed at most N - 2 times, but each of these statements requires only constant time. Step 3 in both algorithms appends vertices to PC or STC. Since no vertex in PC (or STC at Step 3) is a link to more than one vertex in PC (or STC), each vertex is visited at most once. Hence, Step 3 requires at most O(N) time. Step 4 of Algorithm (NLSTl) labels every vertex not in STC (except those vertices of degree one) exactly once with either a 0 or a 1. When a 0 label is reached it signals that all children of that vertex have been explored. A label of 1 signals that all children of that vertex are already in STC. Hence, at most N vertices are visited. Algorithms (NLPl) and (NLSTl), therefore, are linear time algorithms for a tree T with N unwtighted vertices. 5. DISCUSSION
We have seen that the notions of path centers and subtree covers arise quite naturally in a variety of contexts. This paper extended the formulation and theoretical development of path center problems to include nonlinear vertex weight functions for both continuous and vertex restricted versions-
The location
of central structures
in trees
113
problems (NLPl) and (NLP2). It was proved that the solutions to these problems are unique and that they contain the traditional one center solutions as points along the path center. The covering analogues of these problems, (NLSTl) and (NLST2), were defined. It was shown that solutions to these problems are not restricted to paths for all values of r, the cover radius, but may require subtrees that are not paths. However, it is interesting to note that when a solution to (NLSTI) or (NLST2) is a path P, then there exists a value of C or U for which P solves (NLPl) or (NLPZ) respectively. In addition to these theoretical developments the paper also presented linear time algorithms to solve problems (NLPl) and (NLSTl) when fj is some constant value b E d for all j. The only related complexity results for (NLPl) and (NLSTl) are those developed in [3] and [5] for path centers of trees with edges of unit length. However, there are related complexity results for problems analogous to (NLPZ) and (NLST2) given by Minieka [6] and Kim et ul. [7]. Minieka gave polynomial time algorithms for versions of (NLP2) and (NLST2) in which fj is a constant valued function for all j and the path or subtree length constraint is an equality constraint. Kim et ul. provide a linear time algorithm for a closely related problem to (NLST2) by solving its dual. These results give rise to a variety of interesting research questions. For example, do there exist similar algorithms to ours for (NLPl) and (NLSTl) when fj is not restricted to a constant function? (This is answered in part for (NLST2) in [7].) What are the complexity of problems (NLPl), (NLP2). (NLSTl), and (NLST2) on a general graph? If each of these problems is NP-complete on a general graph, are there simpler structures for which they are not? For instance, cactus graphs and Husimi trees have been successfully exploited for point center problems by Kincaid [13,14] and Gurevich, Vishkin and Stockmeyer [ 151. Many other questions can be generated by examining the results for point centers and point covers and attempting to extend them to path centers and subtree covers. A~~,low/rdgemrnts of the third author
The research ofthe second author was partially supported by NSF grant No. ECS-83 17026. The research was partially supported by ONR contract No. NOOO14-86-K-0689.
REFERENCES 1. B. C. Tansel, R. L. Francis and T. J. Lowe, Locations on networks: a survey. Part I: The P-center and P-median problems. Mgmt Sci. 29, 482.-497 (1983). 2. --~. Locations on networks: a survey. Part II: Exploiting tree network structure. Mgmt Sci. 29, 498851 I 11983). 3. P. J. Slater. Central paths in graphs. Transport. Sci. 16, 1-18 (1982). 4. ~~. Some definitions of central structures in a graph. Working Paper, Dept of Mathematics, University of Alabama. Huntsville. Ala. (1982). 5. S. M. Hedetniemi, E. J. Cockayne and S. T. Hedetniemi, Linear algorithms for finding the jordan center of a tree. Transport. Sci. 15, 988114 (1981). 6. E. Minieka. The optimal location of a path or tree in a tree network. Networks 15, 309321 (1985). 7. T. U. Kim. T. J. Lowe, J. E. Ward and R. L. Francis, A minimal length covering subtree of a tree. Working Paper, Purdue University. Krannert Graduate School of Management, West Lafayette, Ind. (1986). 8. F. Harary. Graph Theory, Addison-Wesley, Reading, Mass. (1969). 9. P. M. Dearing. Minimax location problems with nonlinear costs. d. Res. Nat. hr. Stand. 82, 65-72 (1977). 10. R. L. Francis. A note on a nonlinear minimax location problem for tree networks. J. Res. Naf. Bur. Stand. 82. 73~~80 (1977). I I, R. L. Francis, T. J. Lowe and H. D. Ratliff, Distance constraints for tree multifacility location problems. Opns Res. 26, 570- 596 (1978). 12. E. Horowitz and S. Sahni, Fundamentals of Data Structures. Computer Science Press, Potomac, Md. (1976). 13. R. K. Kincaid, The location of central structures in graphs. Unpublished Ph.D dissertation, Purdue University, West Lafayette, Ind. (1984). 14. R. K. Kincaid, Locating an absolute center on graphs that are almost trees. Working Paper. Dept of Mathematics. College of William and Mary, Williamsburg, Va (1987). 15. Y. Gurevich, L. Stockmeyer and V. Vishkin, Solving NP-hard problems on graphs that are almost trees and an application to facility location problems. J. Ass. Compur. Mach. 31, 4599473 (1984).