European Journal of Operational Research 198 (2009) 370–377
Contents lists available at ScienceDirect
European Journal of Operational Research journal homepage: www.elsevier.com/locate/ejor
Discrete Optimization
Up- and downgrading the 1-center in a network Elisabeth Gassner * Department of Optimization and Discrete Mathematics, Graz University of Technology, Steyrergasse 30, A-8010 Graz, Austria
a r t i c l e
i n f o
Article history: Received 17 July 2007 Accepted 17 September 2008 Available online 23 September 2008 Keywords: Combinatorial optimization Location problem Vertex center Upgrading Downgrading Network improvement Network modification Complexity Tree
a b s t r a c t We study budget constrained network improvement and degrading problems based on the vertex 1-center problem on graphs: given a graph with vertex weights and edge lengths the task is to decrease and increase the vertex weights within certain limits such that the optimal 1-center objective value with respect to the new weights is minimized and maximized, respectively. The upgrading (improvement) problem is shown to be solvable in Oðn2 Þ time provided that the distance matrix is given. The downgrading 1-center problem is shown to be strongly NP-hard on general graphs but can be solved in Oðn2 Þ time on trees. As byproduct we suggest an algorithm that solves the problem of minimizing over the upper envelope of n piecewise linear functions in OðK þ nÞ time where K is the total number of breakpoints. Ó 2008 Elsevier B.V. All rights reserved.
1. Introduction Location problems are – due to their practical relevance – among the best investigated problems in Operations Research. There are two classical models, the median problem (minimize the sum of weighted distances to the customers) and the center problem (minimize the maximum among the weighted distances to the customers). Both problems have received much attention during the last decades (e.g., [9,16,19]). However, less attention was paid to network modification problems where the goal is to change the parameters (vertex weights and/or edge lengths) in order to improve or downgrade the quality of a facility location. Network modification play an important role in the design of communication networks (e.g., [21]). Upgrading means that a faster communication technology is installed and hence the edge or vertex delays can be reduced. The problem of upgrading a network has already been applied to several combinatorial optimization problems. In this paper we are interested in upgrading vertices for the 1-center problem, i.e., we have to solve a location problem combined with a network improvement problem: assume that we are faced with a network which can be improved by upgrading vertices. Then there are two questions to be answered: which vertices should be upgraded and where to locate the facility? Downgrading, the canonical counterpart of upgrading, has reached much less attention in the literature. Here the task is to at* Tel.: +43 316 873 5358. E-mail address:
[email protected] 0377-2217/$ - see front matter Ó 2008 Elsevier B.V. All rights reserved. doi:10.1016/j.ejor.2008.09.013
tack a network within certain bounds such that the quality of every location is bad, i.e., the optimal objective value is maximally degraded. Both problems can be seen as bilevel problems with an actor who changes the vertex weights and a reactor who locates the center. While in the improvement model both decision makers, the actor and reactor, have the same goal, i.e., to minimize the maximum weighted distance, in the downgrading model the goals of the decision makers are conflicting. 1.1. Related problems Network up- and downgrading versions have been applied to several classical combinatorial optimization problems. Chepoi et al. [7] solved the problem of changing the lengths within certain bounds such that the diameter of a tree is minimized subject to a budget constraint in Oðn2 Þ time. This problem is equivalent to upgrading the 1-center in an unweighted tree where edge lengths are allowed to be changed. Observe that we deal with changing vertex weights instead of edge lengths and allow vertex weights. Fulkerson and Harding [11] and Hambrusch and Tu [13] investigated how to maximally reduce the length of a shortest and longest path, respectively, in a directed graph by edge length modifications. Phillips [22] introduced a flow interdiction problem, i.e., the problem of attacking edges to reduce the maximum flow value. Frederickson and Solis-Oba [10], Drangmeister et al. [8] and Krumke et al. [17] investigated network improvement and
E. Gassner / European Journal of Operational Research 198 (2009) 370–377
degrading versions for the minimum spanning tree and Steiner tree problem. A general framework for up- and downgrading versions of 0/1-combinatorial optimization problems was investigated by Burkard et al. [3] and Burkard et al. [4]. Network modification problems are closely related to reverse problems where the task is to maximally improve a prespecified solution within certain limits. Observe that for reverse problems a feasible solution (location) is given while this is not the case for up- and downgrading problems. Due to the large number of publications in this area, we restrict ourselves to location problems. Burkard et al. [1] proved NP-hardness of the reverse 1-median problem with edge length modification on general graphs and suggested a linear time algorithm for the problem on a cycle. In [2] the same authors presented an Oðn log nÞ time algorithm for the reverse 2-median problem on trees as well as the reverse 1-median problem on unicyclic graphs. Zhang et al. [24,25] investigated the problem of how to shorten the lengths of edges at minimum cost (measured in different norms) such that the shortest distances between the vertices are within given bounds. For the case of the ‘1-norm a strongly polynomial algorithm is developed while for ‘1- and ‘2-norm the problem is even hard to approximate. Finally, the class of inverse problems should be mentioned. The goal of an inverse location problem is to modify parameters at minimum cost such that a given feasible solution becomes optimal. Several papers deal with inverse location problems like the inverse p-median problem on a graph and the inverse 1-median problem in the plane with ‘1- or ‘1-norm and vertex weight modification [5]. Gassner [12] proved NP-hardness of the inverse 1-maxian problem with variable edge lengths (even on series-parallel graphs) and suggested an Oðn log nÞ time algorithm for this problem on a tree. And Cai et al. [6] proved that the inverse center problem with edge length modification is NP-hard. The reader is referred to the comprehensive survey on inverse combinatorial optimization by Heuberger [15]. 1.2. Organization and contribution of this paper In this paper, we investigate up- and downgrading versions of the 1-center problem. The (vertex) 1-center problem is given by a graph G=(V, E) with positive edge lengths ‘e 2 Rþ for e 2 E and positive vertex weights wt 2 Rþ for v 2 V. The task is to find a vertex x 2 V which minimizes
f ðxÞ ¼ maxfwt dðt; xÞ j t 2 Vg; where d(i, j) denotes the shortest distance between the vertices i and j with respect to edge length ‘. The optimal objective value with respect to vertex weights w is denoted by
zðwÞ ¼ min maxfwt dðt; xÞ j t 2 Vg: x2V
In Section 2, we give a short introduction to the 1-center problem and related problems. The up- or downgrading 1-center problem is given by an instance of the 1-center problem and in addition we are given cost coefficients ct 2 Rþ , bounds ut 2 Rþ for the vertices v 2 V and a total budget B. A vertex modification d = (dv)v2V of the up- or downgrading problem is called feasible if d 2 D with
(
D¼
) X d 2 RjVj ct dt 6 B and 0 6 dt 6 ut 8t 2 V : t2V
The upgrading 1-center problem, Up1Center for short, is to solve
min zðw dÞ ¼ min min maxfðwt dt Þdðt; xÞ j t 2 Vg: d2D
d2D
x2V
The downgrading 1-center problem, Down1Center for short, is to solve
371
max zðw þ dÞ ¼ max min maxfðwt þ dt Þdðt; xÞ j t 2 Vg: d2D
d2D
x2V
In Section 3, we deal with Up1Center and suggest an Oðn2 Þ time algorithm for this problem on general graphs provided that the distance matrix is given. Section 4 is dedicated to Down1Center. We show that the problem is in general NP-hard (Subsection 4.1) and suggest an efficient algorithm for trees that runs in Oðn2 Þ time (Subsection 4.2). 1.3. Notation Throughout this paper, we will use the following notation: let G=(V, E) be a graph. Then n = jVj is the number of vertices and m = jEj is the number of edges. Let T=(V, E) be a tree and (i, j)2E. Then Ti(i, j) denotes the subtree that contains vertex i after deleting edge (i, j). If no confusion is possible, we write v 2 Ti(i, j) instead of v 2 V(Ti(i, j)). A function f(x):X ? Y is called unimodal if there exists a value y such that either f is monotonically increasing for x 6 y and monotonically decreasing for x P y or f is monotonically decreasing for x 6 y and monotonically increasing for x P y. 2. A short survey of the 1-center problem Given a graph G = (V, E) with vertex weights wv and edge lengths ‘e, the (vertex) 1-center problem is to find a vertex x 2 V that minimizes
f ðxÞ ¼ max wdð; xÞ; 2V
where d(v,x) denotes the shortest distance between t and x. Based on the property that the 1-center objective function f(x) is a convex function if x moves continuously along a path in a tree, the 1-center problem on trees can be solved in linear time [18]. On general graphs the 1-center problem can be solved by determining the 1-center objective value for every vertex and then choosing the best one. Observe that the bottleneck of this procedure is the computation of the distance matrix (e.g., using Floyd– Warshall’s algorithm which runs in Oðn3 Þ time). More attention was paid to so-called absolute center problems where the center may be located anywhere on the graph, i.e., on vertices or in the interior of edges. An absolute 1-center can be found in Oðmn log nÞ time provided that the distance matrix is available (Kariv and Hakimi [16]). The following lemma is crucial for solving the absolute 1-center in a tree: Lemma 2.1 (Kariv and Hakimi [16]). Let v 2 V and let s, t 2 V such that s and t lie in different subtrees Ta(a, v) and Tb(b, v) (a–b) and let wðsÞdðs; tÞ ¼ wðtÞdðt; tÞ ¼ maxt0 2V wðt0 Þdðt0 ; tÞ. Then v is an absolute 1-center. The previous lemma immediately implies that the absolute 1center problem is equivalent to
max i;j2V
wi wj dði; jÞ: wi þ wj
Observe that this is a dual formulation of the absolute 1-center problem. In this paper we will present a similar dual formulation for the vertex 1-center problem. The optimality criterion for the absolute 1-center is also called midpoint-property. In case of unit weights the criterion means that an absolute 1-center lies on the midpoint of a longest path in the tree. Based on this lemma Kariv and Hakimi developed an Oðn log nÞ time algorithm which was improved to a linear time algorithm by Megiddo [18]. Next we discuss some properties of the 1-center in a graph that will be of interest for the investigations of up- and downgrading
372
E. Gassner / European Journal of Operational Research 198 (2009) 370–377
versions of center problems. We will mainly focus on necessary and sufficient conditions for the optimal objective value to be at most and at least a threshold L, respectively. Let us start with an upper bound on the optimal objective value. Lemma 2.2. Let (G, ‘, w) be an instance of the 1-center problem and let L 2 Rþ . Then Fig. 2. An illustration for the proof of Lemma 2.4.
min f ðxÞ 6 L; x2V
if and only if there exists a vertex x 2 V such that wvd (v, x)6L for all v 2 V. The above lemma is trivial. However, we mention it in order to point out the contrast to the lower bound. Lemma 2.3. Let (G, ‘, w) be an instance of the 1-center problem and let L 2 Rþ . Then
min f ðxÞ P L; x2V
if and only if for every v 2 V there exists a vertex q(v)2V such that
wqðtÞ dðt; qðtÞÞ P L: Proof. There exists a solution x 2 V with minx2Vf(x) P L if and only if f(x) P L for all x 2 V and hence max 2Vwvd(, x)PL for every x 2 V. And this is true if and only if for every x 2 V there exists a vertex q(x)2V with wq(x)d(q(x), x) P L. h Lemma 2.3 implies a kind of anti-domination property of the 1center problem. There exists a feasible solution with objective value at least L if and only if for every vertex m 2 V there exists another vertex q(m) 2 V that is far away. If we ask for a set S of vertices such that for every m 2 V there exists a vertex q(m) 2 S such that q(m) is near to m then we get a generalized domination problem. Due to this relationship, a vertex m 2 V is called anti-dominated by q(m) 2 V if wq(m) d(q(m), m)PL holds and q(m) is called anti-domination vertex to m. Observe that there may exist a threshold L such that every vertex is an anti-domination vertex. This is illustrated in the following example: Consider the graph of Fig. 1. The edge lengths are given in the figure, all vertex weights are equal to 1 and L = 2. Observe that w2d(2, 1)=1 = w3d(3, 1) and w4d(4, 1)=2 P L. Therefore, vertex 1 is uniquely anti-dominated by vertex 4. By similar arguments, we see that vertex 2 is only anti-dominated by vertex 3, vertex 3 is only anti-dominated by vertex 2 and finally vertex 4 is only antidominated by vertex 1. Hence, the set of anti-domination vertices is unique and contains all vertices. However, if the underlying graph is a tree then there exists a set of two vertices that anti-dominate the rest of vertices: Lemma 2.4. Let (G, ‘, w) be an instance of the 1-center problem where G = (V, E) is a tree and let L 2 Rþ . Then
min f ðxÞ P L; x2V
if and only if there exist two vertices s, t 2 V such that
maxfws dði; sÞ; wt dði; tÞg P L for every i 2 V: Proof. Clearly, if there are two vertices s, t 2 V that anti-dominate all vertices, then every vertex is anti-dominated and hence Lemma 2.3 implies that the optimal objective value is at least L. Hence, we assume that minx2Vf(x) P L, i.e., every vertex t is anti-dominated by another vertex q(v) 2 V. Let k 2 V and let q*(k) be a vertex of maximum weighted distance to k, i.e.
wq ðkÞ dðk; q ðkÞÞ ¼ maxfwt dðk; tÞ j t 2 Vg: Since k 2 V is anti-dominated by assumption, we conclude that k is also anti-dominated by q*(k), i.e.
wq ðkÞ dðk; q ðkÞÞ P L; for every k 2 V. Now let
L0 :¼ wq ðiÞ dði; q ðiÞÞ ¼ minfwq ðkÞ dðk; q ðkÞÞ j k 2 Vg: Then
L 6 L0 ¼ wq ðiÞ dði; q ðiÞÞ 6 wq ðkÞ dðk; q ðkÞÞ; holds for all vertices k 2 V. Consider the path from i to q*(i) and let vertex j be adjacent to i on this path. See Fig. 2 for an illustration. We will prove that q*(i) and q*(j) anti-dominate all vertices. This means, we have to show that
either wq ðiÞ dðk; q ðiÞÞ P L or wq ðjÞ dðk; q ðjÞÞ P L; for every k 2 V. We partition the set of vertices into two subsets. Let Ti(i, j) = (Vi, Ei) and Tj(i, j) = (Vj, Ej). Then every vertex is either in Vi or in Vj. Let k 2 Vi, then by definition q*(i) 2 Vj and therefore d(k, q*(i)) = d(k, i)+d(i, q*(i)). Hence, we get
wq ðiÞ dðk; q ðiÞÞ ¼ wq ðiÞ ðdðk; iÞ þ dði; q ðiÞÞÞ P wq ðiÞ dði; q ðiÞÞ ¼ L0 P L: It remains to show that q*(j) 2 Vi. Assume that q*(j) 2 Vj then
L0 ¼ wq ðiÞ dði; q ðiÞÞ P wq ðjÞ dði; q ðjÞÞ ¼ wq ðjÞ ðdði; jÞ þ dðj; q ðjÞÞÞ > wq ðjÞ dðj; q ðjÞÞ: Observe that the first inequality holds because of the maximality property of q*. The above statement contradicts the minimality of vertex i and proves that q*(j) 2 Vi. Let k 2 Vj then we have d(k, q*(j)) = d(k, j) + d(j, q*(j)) and
wq ðjÞ dðk; q ðjÞÞ ¼ wq ðjÞ ðdðk; jÞ þ dðj; q ðjÞÞÞ P wq ðjÞ dðj; q ðjÞÞ P L: Hence, every vertex is either anti-dominated by s = q*(j) or by t = q*(i) which proves the lemma. h The previous lemma as well as the additional properties used in its proof immediately imply that minx2Vf(x) P L if and only if there exists an edge (i, j) 2 E and vertices s 2 Ti(i, j), t 2 Tj(i, j) such that Fig. 1. An instance of the 1-center problem where every vertex is an antidomination vertex for L = 2.
ws dðs; jÞ P L and wt dði; tÞ P L:
373
E. Gassner / European Journal of Operational Research 198 (2009) 370–377
Therefore, the following theorem follows: Theorem 2.5. Let (G, ‘ , w) be an instance of the 1-center problem where G = (V, E) is a tree. Then the optimal objective value is equal to
max minfws dðs; jÞ; wt dði; tÞg:
ði;jÞ2E s2T i ði;jÞ t2T j ði;jÞ
Observe that Theorem 2.5 provides a dual formulation of the vertex 1-center problem (which is a minimization problem). Finally, let us compare Lemma 2.2 and Theorem 2.5. Lemma 2.2 provides a sufficient and necessary condition that guarantees that the optimal objective value is at most some threshold L. The condition is based on the existence of a vertex with special properties. On the other hand, Theorem 2.5 implies that the optimal objective value is at least L if and only if there exists an edge (i, j) 2 E with min{wsd(s, j), wtd(i, t)} P L for some s 2 Ti(i, j) and t 2 Tj(i, j). Hence, here we have a condition that is based on the existence of an edge with special properties.
3. Upgrading the 1-center by vertex weight modification This section is dedicated to the network improvement problem Up1Center. The task of Up1Center is to modify the vertex weights within certain limits in such a way that the optimal 1-center objective value with respect to the new vertex weights is minimized. Recall that Up1Center is defined as follows:
min min maxfðwt dt Þdðx; tÞg: d2D
x2V
t2V
Clearly, we can reverse the first two minimization tasks and get an equivalent problem
min min maxfðwt dt Þdðx; tÞg: x2V
d2D
t2V
Let x 2 V be a fixed vertex, then
PðxÞ
min maxfðwt dt Þdðx; tÞg; d2D
t2V
is the problem of maximally improving the potential center location x 2 V. Problem P(x) is a reverse center problem where the goal is to maximally improve a given location within certain limits. Since for upgrading problems the locations are not fixed a priori, we have to try out all locations, maximally improve them and take the best choice, i.e., Up1Center is equivalent to
min hðxÞ; x2V
The optimal solutions of P(x) for all vertices x 2 V are given in the following table.
P(1) P(2) P(3) P(4)
Fig. 3. Instance of Up1Center where h(x) is not unimodal along a path.
Optimal objective value
d3 = 8 d1 = d3 = 4 d1 = 8 d1 = 7, d3 = 1
4 6 4 9
It can be seen that vertex 2 is the unique 1-center before the weight modification while either vertex 1 or vertex 3 are 1-centers after an optimal weight modification. Moreover, the optimal objective value is not unimodal along a path. Therefore, we determine h(x) for every x 2 V. Let us start with the following characterization of an optimal solution of P(x). Lemma 3.1. Let d* be an optimal solution of P(x) and let minx 2 V h(x) = L*. Then ðw d Þdð; xÞ ¼ L if wvd(v, x) P L* and d ¼ 0 otherwise. Hence, the problem can be solved by sorting the vertices according to wvd(v, x), i.e., wt1 dðt1 ; xÞ P wt2 dðt2 ; xÞ P P wtn dðtn ; xÞ. Then decrease the weight of vertex t1 until the upper bound ut1 is reached, or the whole budget is used, or ðwt1 dt1 Þdðt1 ; xÞ ¼ wt2 dðt2 ; xÞ. If one of the first two stop criteria occurs then an optimal solution is found. Otherwise decrease simultaneously the weights of t1 and t2 until one of the upper bounds is reached, the whole budget is used or ðwt1 dt1 Þ dðt1 ; xÞ ¼ wt3 dðt3 ; xÞ and ðwt2 dt2 Þdðt2 ; xÞ ¼ wt3 dðt3 ; xÞ, and so on. Clearly, this algorithm solves problem P(x) in Oðn2 Þ time because there are at most n iterations and in iteration i we have to change i weights. However, we can solve the problem even in linear time if we use a search and prune approach similar to that of Megiddo for solving linear programming problems with two variables. Let L 2 Rþ be a test value. The task is to decide whether L is a lower or upper bound for minx 2 V h(x) = L*. In order to answer this question, a solution d(L) is defined in the following way: if wvd(, x) P L L otherwise dv(L) = 0. If d(L) is infeasible (because then dðLÞ ¼ w dð;xÞ an upper bound or the budget constraint is violated) then L is too small, i.e., L* > L. In this case all vertices with wvd(, x) 6 L can be deleted because d ¼ 0 holds for all of them. Otherwise, if d(L) is a feasible solution then L* 6 L holds. We know that all vertices in I = {v 2 Vjwvd(v, x)PL} satisfy dt ¼ wt L . Hence, instead of taking all these vertices separately into acdðt;xÞ count they are accumulated as follows: the total cost incurred by vertices in I is equal to
X t2I
where h(x) is the optimal objective value of P(x). Observe that the optimal 1-center before changing the vertex weights and the optimal location after an optimal weight modification is in general not the same. This is the reason why it is not sufficient to solve only P(x*) where x* is a 1-center with respect to the original weights w. Moreover, h(x) is not unimodal along a path. This is shown by the following example: consider the instance given in Fig. 3 with B = 8.
Optimal solution
ct wt L
X t2I
ct ; dðt; xÞ
and their lower bounds are satisfied for
maxðwt ut Þdðt; xÞ 6 L: t2I
Hence, we can replace all vertices in I and take the accumulation terms for the budget and bound constraints into account. In each iteration either all vertices with wvd(v, x) 6 L or those with wvd(v, x) P L can be deleted. If the median among the values wvd(v, x) of the remaining vertices serves as test value then half of the remaining vertices are deleted in each iteration. Moreover, iteration i can be done in Oðni Þ time where ni is the number of remaining vertices in iteration i. This implies a linear time algorithm for solving P(x). Since we have to determine h(x) for all x 2 V, we get an overall running time of Oðn2 Þ. Theorem 3.2. Upgrading the 1-center problem can be solved in Oðn2 Þ time provided that the distance matrix is given.
374
E. Gassner / European Journal of Operational Research 198 (2009) 370–377
4. Downgrading the 1-center by vertex weight modification In this section, we deal with increasing the vertex weights within certain bounds and fulfilling a budget constraint such that the optimal 1-center objective value after the modification is maximized. It is shown that the problem is in general NP-hard but for the special case of trees there exists a polynomial time algorithm that solves Down1Center in Oðn2 Þ time.
max minfðws þ ds Þdðs; jÞ; ðwt þ dt Þdði; tÞg:
ði;jÞ2E s2T i ði;jÞ t2T j ði;jÞ
Therefore, Down1Center on trees can be rewritten in the following way:
max max minfðws þ ds Þdðs; jÞ; ðwt þ dt Þdði; tÞg: d2D
ði;jÞ2E s2T i ði;jÞ t2T j ði;jÞ
4.1. NP-hardness proof for general graphs Obviously, this is equivalent to In this section, we show that Down1Center is strongly NPhard on general graphs. Lemma 2.4 already suggests a reduction from the total domination problem, which is known to be NPhard even on bipartite, split, line, circle graphs and several further graph classes (see Haynes, Hedetniemi and Slater [14] for a comprehensive survey). An instance of the total domination problem is given by a (simple) graph G = (V, E) and a natural number K. The task is to find a total dominating set of cardinality at most K, i.e., find a subset of vertices S # V such that for every i 2 V there exists another vertex j 2 S such that (i, j) 2 E. Observe that in contrast to the classical dominating set problem we have to make sure that all vertices within the set S are dominated by another vertex in S, that is, vertices in S do not dominate themselves. Let G = (V, E) and K 2 N be an instance of the total dominating set problem. Then G ¼ ðV; EÞ denotes the complement of G. We construct an associated instance of Down1Center in the following way: Down1Center should be solved on graph G ¼ ðV; EÞ, all edge lengths are equal to one and all vertex weights are equal to zero. Moreover, cv = uv = 1 for all v 2 V and B = K. Observe that the distance d(i, j) between two vertices i, j 2 V is equal to 1 if ði; jÞ 2 E ((i, j) R E) and at least 2 if ði; jÞ R E ((i, j) 2 E). The reduction of the total dominating set problem to Down1Center is clearly polynomial (there are at most n2 edges in G). We show that there exists a total dominating set of cardinality at most K if and only if there exists a feasible solution of the associated Down1Center problem with objective value at least 2. Let S be a total dominating set of cardinality at most K then set dv = 1 if v 2 S and 0 otherwise. Clearly d is a feasible solution of Down1Center. For every i 2 V there exists a vertex j 2 S with (i, j) 2 E, i.e., there exists a vertex j with modified weight wj + dj = 1 such that ði; jÞ R E. Therefore, max{(wj + dj)d(i, j)jj 2 V} P 2 for every i 2 V and hence, we have a feasible solution of Down1Center with objective value at least 2. Now let d be a feasible solution of Down1Center with objective value at least 2. We conclude that for every i 2 V there exists a vertex j 2 V such that (wj + dj)d(i, j) P 2. Obviously, i – j, dj = 1 and ði; jÞ R E because otherwise either (wj + dj) = 0 or d(i, j) 6 1. Let S = {j 2 Vjdj = 1}. Clearly, jSj 6 B and for every i 2 V there exists a vertex j 2 S with (i, j) 2 E. Theorem 4.1. Downgrading the 1-center by vertex weight modification is in general strongly NP-hard. Observe that due to our construction of the reduction above Down1Center is NP-hard on all graph classes G such that the total domination problem is NP-hard on the complement graphs of G.
4.2. An efficient algorithm for trees In this subsection a quadratic time algorithm for Down1Center on trees is developed. Let d be a feasible solution of Down1Center then Theorem 2.5 implies that the associated optimal objective value with respect to the new weights w + d is equal to
max max minfðws þ ds Þdðs; jÞ; ðwt þ dt Þdði; tÞg: ði;jÞ2E
d2D s2T i ði;jÞ t2T j ði;jÞ
The last formulation of Down1Center on trees immediately leads to the following algorithm: for every edge (i, j) 2 E solve the inner maximization problem. Finally, take the solution associated to that edge that leads to the maximal objective value. Therefore, our task is to solve the following subproblem for every (i, j) 2 E:
Pði; jÞ
max minfðws þ ds Þdðs; jÞ; ðwt þ dt Þdði; tÞg:
d2D s2T i ði;jÞ t2T j ði;jÞ
Let us start with an example. Consider the instance of Down1Center given in Fig. 4. Vertex 3 is the (vertex) 1-centers with respect to weight w. We solve P(i, j) for every edge (i, j) and get the following optimal solutions for the subproblems: Optimal solution P(1, 2) P(2, 3) P(3, 4) P(4, 5) P(5, 6)
29 11 2 , d6 ¼ 2 181 159 , d ¼ 6 17 17 149 171 , d ¼ 6 16 16
d1 ¼ d1 ¼ d1 ¼ d1 = 6, d6 = 14 d6 = 20
Optimal objective value 201.5 186.4 175.3 210 21
First, we can see that the optimally downgraded vertex 1-center is equal to vertex 4 or 5. Moreover, the optimal objective value for the subproblem P(i, j) are not unimodal along a path. Observe that a feasible solution of P(i, j) is a triple (d, s, t). Let us start with some observations about the structure of an optimal solution of P(i, j): 1. (Obs. 1) We may assume without loss of generality that ckuk 6 B for all k 2 V. Otherwise, we may use the modified bounds ~ k ¼ minfuk ; cB g. u k 2. (Obs. 2) There exists an optimal solution (d, s, t) such that at most two weights are changed, i.e., dk = 0 for all k – s, t. 3. (Obs. 3) There exists an optimal solution (d, s, t) of P(i, j) such that either csds + ctdt = B or ds = us, dt = ut and csus + ctut < B. This can be proved by assuming that csds + ctdt < B. If ds < us then ds can be increased without violating the feasibility of the solution while the new solution is still optimal. The same can be done for dt. This procedure is repeated until either csds + ctdt = B or ds = us and dt = ut. In order to solve P(i, j), we have to decide about the amount of investment into subtree Ti(i, j) and Tj(i, j). Assume that we know that k is invested into subtree Ti(i, j) and B k is invested into Tj(i, j). If the weights of the vertices s 2 Ti(i, j) and t 2 Tj(i, j) should be modified, then consider modifications of the form
k Bk dt ¼ min ut ; ds ¼ min us ; cs ct
ð1Þ
375
E. Gassner / European Journal of Operational Research 198 (2009) 370–377
Fig. 4. Instance of Down1Center with B = 20.
These modifications are feasible and maximal subject to the constraint that k is the available budget for Ti(i, j). Hence, if k is fixed then the maximal weighted distance from vertex s 2 Ti(i, j) to j is
ps ðkÞ :¼
k ws þ min us ; dðs; jÞ: cs
Hence, ps(k) describes the profit we get if k is invested into subtree Ti(i, j) and the weight of s 2 Ti(i, j) is modified. The profit function is therefore defined as follows:
( pk ðkÞ :¼
ðwk þ minfuk ; ck gÞdðk; jÞ k
ðwk þ
minfuk ; Bk gÞdði; kÞ ck
if k 2 T i ði; jÞ if k 2 T j ði; jÞ;
for k 2 V. Consider the instance given in Fig. 5 with B = 10 and c1 = c2 = 1, c3 = 2, c4 = 5 and u1 = 3, u2 = u3 = 4 and u5 = 2. An illustration of the corresponding profit functions for fixed edge (i, j) = (2, 3) is given in Fig. 6. Every optimal solution is of the form (1) for some 0 6 k 6 B and vertices s 2 Ti(i, j) and t 2 Tj(i, j) because non-maximal weight modifications can not be optimal. Hence, our problem can be written in the following form:
max minfps ðkÞ; pt ðkÞg:
06k6B s2T i ði;jÞ t2T j ði;jÞ
For every fixed k there exists an optimal solution such that we invest into the most valuable vertices, i.e.
aðkÞ :¼ ps ðkÞ ¼ maxfpk ðkÞ j k 2 T i ði; jÞg bðkÞ :¼ pt ðkÞ ¼ maxfpk ðkÞ j k 2 T j ði; jÞg
and hence
max minfps ðkÞ; pt ðkÞg ¼ max minfaðkÞ; bðkÞg
06k6B s2T i ði;jÞ t2T j ði;jÞ
06k6B
Observe that a(k) is monotonically increasing because all profit functions for vertices k 2 Ti(i, j) are monotonically increasing while b(k) is monotonically decreasing. If there exists an intersection point k0 of a(k) and b(k) with 0 6 k0 6 B then k0 is an optimal investment into Ti(i, j). Let a(k0 ) = ps(k0 ) and b(k0 ) = pt(k0 ) then modifying the weights of s and t according to (1) for k = k0 yields an optimal solution. The monotonicity implies that the intersection point (if one exists) satisfies maxk 2Vpk(k0 ) = min06k6B maxk2Vpk(k). However, if there is no intersection point in the interval [0, B] then either a(k) < b(k) or a(k) > b (k) holds for all k 2 [0, B]. Let us consider the first case where a(k) < b(k) holds for all 0 6 k 6 B. The monotonicity property implies that this case happens if and only if a(B) < b(B), i.e., even if the total investment is put into Ti(i, j) the weighted distance from the most valuable vertex in Ti(i, j) to j is less than the weighted distance from the best vertex in Tj(i, j) to i. Hence, the best choice is to invest the whole budget into Ti(i, j) and k = B. The second case reflects the reverse situation to the first one, i.e., the whole budget is used for Tj(i, j) but still the minimum is attained by a vertex in Tj(i, j). The previous observations imply the following lemma: Lemma 4.2. The optimal objective value z* of P(i, j) is of the form
8 max ps ðBÞ if max ps ðBÞ 6 max pt ðBÞ > > s2T i ði;jÞ t2T j ði;jÞ > s2T i ði;jÞ > < max pt ð0Þ if max ps ð0Þ P max pt ð0Þ z ¼ t2T s2T i ði;jÞ t2T j ði;jÞ j ði;jÞ > > > > : min max pk ðkÞ otherwise 06k6B
k2V
Based on Lemma 4.2 we get the following algorithm for Down1Center on trees: Fig. 5. Example: illustration.
For every (i, j) 2 E: – If max ps ðBÞ 6 max pt ðBÞ then invest B into the most valus2T i ði;jÞ
t2T j ði;jÞ
able vertex in Ti(i, j), i.e., k = B. – Else if max ps ð0Þ P max pt ð0Þ then invest B into the most s2T i ði;jÞ
t2T j ði;jÞ
valuable vertex in Tj(i, j), i.e., k = 0. – Else solve min max pk ðkÞ. 06k6B
Fig. 6. Example: illustration of the functions pk(k).
k2V
The first two cases can be solved in OðnÞ time since one has to evaluate the profit functions p at certain values and compare the function values. For the third case the problem of minimizing over the upper envelope of piecewise linear and monotone functions has to be solved. We use the fact that the profit functions are of a very special form: they are piecewise linear and each profit function has at most one breakpoint (at ckuk if k 2 Ti(i, j) and at B ckuk if k 2 Ti(i, j)). Hence, we have to minimize over the upper envelope of piecewise linear and monotone functions. The total number of breakpoints is at most OðnÞ. Kariv and Hakimi [16] showed that the upper envelope of unimodal, piecewise linear functions with at most two segments can be computed in Oðn log nÞ time.
376
E. Gassner / European Journal of Operational Research 198 (2009) 370–377
We are, however, not interested in the whole upper envelope but only in a minimizer of it. In the next section it is proved that this problem can also be solved in OðnÞ time. Therefore, we get the following theorem: Theorem 4.3. The Downgrading 1-center problem on a tree can be solved in Oðn2 Þ time. 5. Minimizing over the upper envelope of piecewise linear and monotone functions In this section, we consider the problem of minimizing over the upper envelope of n piecewise linear functions. Observe that we do not require that the functions are convex. This is the reason why it is not possible to directly apply results like [20,23]. Let n piecewise linear functions fi : ½0; B ! R for i = 1, . . . , n be given. Assume that it is possible for every k 2 [0, B] to decide in linear time whether k lies to the right or to the left of the minimizer of the upper envelope. We consider the following problem:
min max fi ðkÞ;
06k6B i¼1;...;n
ð2Þ
this means, we want to find a minimizer on the upper envelope. We assume that every function has at least one breakpoint. If this is not the case then we assign breakpoint B to all affine-linear functions. Let K be the total number of breakpoints then clearly n 6 K holds. Our algorithm is a generalization of Megiddo’s search and prune algorithm for solving linear programs with two variables which is equivalent to problem 2 where all functions are affine-linear. The main idea is to reduce the number of breakpoints successively. This is done by splitting up the current interval into two subintervals and continuing with that subinterval which contains an optimal solution. In each interval reduction procedure at least 18 of the breakpoints are dropped. During the whole algorithm it is guaranteed that every function has at least one breakpoint in the current interval. Let k 2 [0, B] be a test value. Then by assumption it can be decided in linear time if k lies to the left or to the right of a minimizer. This is especially true if the functions are monotone as it is the case for our profit functions. The test of a fixed value k is used several times during our algorithm. Each iteration of the algorithm consists of two steps: in the first step the number of breakpoints is reduced and in the second step the number of functions is reduced. 1. The breakpoint reduction step:Determine the median m among the breakpoints and test the value m. In order to simplify the notation let us assume that m 6 k*. Then there are a 6 K2 breakpoints in (m, B]. Hence, we have halved the number of breakpoints. 2. The function reduction step:Observe that there are K a breakpoints in [0, m] and since every function has at least one breakpoint there are at most b 6 K a functions having no breakpoint in (m, B]. Observe that our goal is to continue with interval [m, B]. Even if there are at most a 6 K2 breakpoints in this interval, we have to make sure that every function has at least one breakpoint in [m, B]. Simply assigning breakpoint m to all functions that are affine-linear in [m, B] will in general not decrease the number of breakpoints, e.g., if every function has exactly one breakpoint. Therefore the goal is to reduce the number of affine-linear functions in [m, B]. We do this on the line of Megiddo’s linear time algorithm for linear programming problems with two variables:Take all functions that are affine-linear in [m, B] and arrange them in disjoint pairs. If the number of affine-linear functions is odd then one function remains unmatched. Then determine the intersection points of these pairs. If two affine-linear functions have no intersection point,
i.e., they are parallel, then one function can be deleted since it is dominated by its partner function. Let 2b1 be the number functions that are matched with a parallel function and let 2b2 be the number of remaining matched functions. Then there are b2 intersection points. Then the median m0 of the intersection points is determined and it is tested whether m0 6 k* or m0 P k*. Assume that m0 P k* then there are at least db22 e P b22 breakpoints in [m0 , B] (in the wrong subinterval). Observe that we will continue with interval [m, m0 ]. For every pair whose intersection point is in [m0 , B] one affine-linear function can be deleted since it is dominated in [m, m0 ] by its partner function. Hence, we can delete at least b22 affine-linear functions in addition to all those function that were deleted because they have a parallel partner function. Therefore the number of remaining affine-linear functions is at most
b2 3b þ 1 b1 þ 2b2 : þ16 4 2 Finally, one (arbitrarily chosen) endpoint of the new interval is assigned to the remaining affine-linear functions as breakpoint. Again every function has a breakpoint. Next the running time of the algorithm is analyzed. We start with the breakpoint reduction step: it takes OðKÞ time to determine the median among the breakpoints. Since every function has at least one breakpoint, we have n 6 K and therefore OðKÞ is an upper bound for the time needed to decide whether m 6 k* or m P k*. Next the running time of the function reduction step is investigated: first we have to find all affine-linear functions, match them and determine the intersection points. This can be done in OðbÞ time. Then the median among the intersection points is determined. This takes again OðbÞ time. To test the median m0 , we have to consider all functions (including all functions with at least one breakpoint). Therefore, we need OðKÞ time. And finally all intersection points are checked and several functions are deleted. This takes again OðbÞ time. Therefore, the total running time of this second step is OðKÞ time. Putting all together the number of breakpoints in the new interval [m, m0 ] is at most
aþ
3b þ 1 3 1 3 1 1 7 1 6 a þ ðK aÞ þ ¼ K þ a þ 6 K þ : 4 4 4 4 4 4 8 4
Let T(K) be the time needed to solve the problem if there are K breakpoints then we conclude that the following recurrence equation holds:
TðKÞ ¼ OðKÞ þ T
7 1 Kþ 8 4
and hence TðKÞ ¼ OðKÞ. If in general not every function has a breakpoint then we get OðK þ nÞ as running time. 6. Conclusion In this paper two network modification problems, the upgrading 1-center problem and the downgrading 1-center problem, are investigated. The upgrading 1-center problem can be solved in quadratic time if the shortest distances are available while the corresponding downgrading version is in general strongly NP-hard. However, if the underlying graph is a tree then the downgrading can be solved in quadratic time. The suggested algorithm for the downgrading version of the 1center problem includes an algorithm for minimizing over the upper envelope of n piecewise linear functions in OðK þ nÞ time where K is the number of breakpoints. We assume that this algorithm can be used as subroutine for several problems in different
E. Gassner / European Journal of Operational Research 198 (2009) 370–377
areas of optimization in order to improve the running time of existing algorithms. Acknowledgement This research is partially supported by the Austrian Science Fund Project P18918-N18 Efficiently solvable variants of location problems. References [1] R.E. Burkard, E. Gassner, J. Hatzl, A linear time algorithm for the reverse 1median problem on a cycle, Networks 48 (1) (2006) 16–23. [2] R.E. Burkard, E. Gassner, J. Hatzl, The reverse 2-median problem on trees, Discrete Applied Mathematics 156 (2008) 1963–1976. [3] R.E. Burkard, B. Klinz, J. Zhang, Bottleneck capacity expansion problems with general budget constraints, RAIRO Recherche Operationelle 35 (2001) 1–20. [4] R.E. Burkard, Y. Lin, J. Zhang, Weight reduction problems with certain bottleneck objectives, European Journal of Operational Research 153 (2004) 191–199. [5] R.E. Burkard, C. Pleschiutschnig, J. Zhang, Inverse median problems, Discrete Optimization 1 (2004) 23–39. [6] M.C. Cai, X.G. Yang, J. Zhang, The complexity analysis of the inverse center location problem, Journal of Global Optimization 15 (1999) 213–218. [7] V. Chepoi, H. Noltemeier, Y. Vaxes, Upgrading trees under diameter and budget constraints, Networks 41 (2003) 24–35. [8] K.U. Drangmeister, S.O. Krumke, M.V. Marathe, H. Noltemeier, S.S. Ravi, Modifying edges of a network to obtain short subgraphs, Theoretical Computer Science 203 (1998) 91–121. [9] Z. Drezner, H.W. Hamacher, Facility Location. Applications and Theory, Springer, Berlin, 2002. [10] G.N. Frederickson, R. Solis-Oba, Increasing the weight of minimum spanning trees, Journal of Algorithms 33 (1999) 244–266.
377
[11] D.R. Fulkerson, G.C. Harding, Maximizing the minimum source-sink path subject to a budget constraint, Mathematical Programming 13 (1977) 116– 118. [12] E. Gassner, The inverse 1-maxian problem with edge length modification, Journal of Combinatorial Optimization 16 (2008) 50–67. [13] S.E. Hambrusch, Hung-Yi Tu, Edge weight reduction problems in directed acyclic graphs, Journal of Algorithms 24 (1) (1997) 66–93. [14] T.W. Haynes, S.T. Hedetniemi, P.J. Slater, Fundamentals of domination in graphs, Pure and Applied Mathematics, Marcel Dekker, New York, 1998. [15] C. Heuberger, Inverse combinatorial optimization: A survey on problems, methods, and results, Journal of Combinatorial Optimization 8 (2004) 329– 361. [16] O. Kariv, S.L. Hakimi, An algorithmic approach to network location problems. I: The p-centers and II: The p-medians, SIAM Journal on Applied Mathematics 37 (3) (1979) 513–560. [17] S.O. Krumke, M.V. Marathe, H. Noltemeier, R. Ravi, S.S. Ravi, Approximation algorithms for certain network improvement problems, Journal of Combinatorial Optimization 2 (1998) 257–288. [18] N. Megiddo, Linear-time algorithms for linear programming in R3 and related problems, SIAM Journal on Computing 12 (4) (1983) 759–776. [19] P.B. Mirchandani, R.L. Francis, Discrete location theory, Interscience Series in Discrete Mathematics and Optimization, John Wiley & Sons Ltd., New York, 1990. [20] W. Ogryczak, A. Tamir, Minimizing the sum of the k largest functions in linear time, Information Processing Letters 85 (2003) 117–122. [21] D. Paik, S. Sahni, Network upgrading problems, Networks 26 (1995) 45–58. [22] C.A. Phillips, The network inhibition problem, in: Annual ACM Symposium on Theory of Computing, Proceedings of the Twenty-Fifth Annual ACM Symposium on Theory of Computing Table of Contents, San Diego, California, United States, 1993, pp. 776–785. [23] E. Zemel, An O(n) algorithm for the linear multiple choice knapsack problem and related problems, Information Processing Letters 18 (1984) 123–128. [24] J. Zhang, X.G. Yang, M.C. Cai, Inapproximability and a polynomially solvable special case of a network improvement problem, European Journal of Operational Research 155 (2004) 251–257. [25] J. Zhang, X.G. Yang, M.C. Cai, A network improvement problem under different norms, Computational Optimization and Applications 27 (2004) 305–319.