4
Operations Research Letters 39 (2011) 437–440 Contents lists available at SciVerse ScienceDirect Operations Research Letters journal homepage: www.elsevier.com/locate/orl Improved algorithms for path partition and related problems Danny Z. Chen, Haitao Wang Department of Computer Science and Engineering, University of Notre Dame, Notre Dame, IN 46556, USA article info Article history: Received 2 May 2011 Accepted 28 July 2011 Available online 7 August 2011 Keywords: Path partition Web proxies placement Monge property k-link shortest path Algorithms abstract We study the L path partition problem: given a path of n weighted vertices and an integer k, remove k1 edges from the path so that the maximum absolute deviation of the weights of the resulting k sub-paths from their mean is minimized. Previously, the best algorithm solves this problem in O(nk log k) time. We present an O(nk) time algorithm. We also give improved solutions for two related problems: the L d path partition problem and the web proxies placement problem. © 2011 Elsevier B.V. All rights reserved. 1. Introduction Let G = (V , E ) be a connected graph with n vertices V ={v 1 , v 2 ,...,v n } and n1 edges E ={(v 1 ,v 2 ), (v 2 ,v 3 ), . . . , (v n1 ,v n )}. For each 1 i n, the vertex v i has a non-negative weight w i . The graph G is called a vertex-weighted path graph. Each sub-path G i of G consists of a set of successive vertices in V connected by their adjacent edges; the weight of G i , denoted by W (G i ), is the sum of the weights of all vertices in G i . Given an integer k with 1 k n 1, let µ = W (G)/k; the L or the Chebyshev path partition problem is to remove k 1 edges from G to obtain k sub- paths G 1 , G 2 ,..., G k such that the value max 1ik |W (G i ) µ| is minimized. As indicated in [12], the L path partition has many applica- tions, including image processing [13,14], workload balancing [3], data base paging [4], cluster analysis [15], etc. The L path partition problem can be solved by a straightfor- ward dynamic programming in O(n 2 k) time. Liverani et al. [12] gave a shifting algorithm of running time O(nk log k). The ‘‘shift- ing’’ techniques have been used elsewhere, e.g., finding a max–min partitioning of a tree [5]. In this paper, we gave an improved algo- rithm that runs in O(nk) time. Our algorithm is based on dynamic programming in which we prove that the involved matrix is totally monotone [1], and thus the linear time row-minima algorithm [1] can be applied. Further, our algorithm works for any arbitrary value µ. In addition, if µ = 0, the problem is solvable in O(n) time by the algorithm in [7], which however does not work for µ = 0. A related problem is the L d path partition problem. Let G be the vertex-weighted path graph defined before. In the L d path partition Corresponding author. E-mail addresses: [email protected] (D.Z. Chen), [email protected] (H. Wang). problem, given an integer k with 1 k n 1 and a real d 1, we aim to remove k 1 edges from G to obtain k sub-paths G 1 , G 2 ,..., G k such that the value k i=1 |W (G i ) µ| d (instead of max 1ik |W (G i ) µ|) is minimized, where µ = W (G)/k. As discussed in [9], the L d path partition problem has appli- cations in image processing [14]. The problem is solvable by a straightforward dynamic programming in O(n 2 k) time. Ho et al. [9] observed that a Monge property is satisfied in the problem, and thus gave a more efficient O(nk) time algorithm. We show that the problem can be modeled as finding a k-link shortest path in a graph with concave Monge property, and by applying the algorithms in [2,16], the problem is solvable in O(min{n k log n, n2 O( log k log log n) }) when k = (log n), which is an improvement over the O(nk) result [9]. In addition, the case when d < 1 is also discussed in [9]. Another related problem is the web proxies placement problem in the Internet of linear topology, which characterizes the problem of minimizing the overall latency of accessing the target web server by using some web proxies (refer to [10] for details). Given a vertex-weighted path graph G defined as before, in this problem, each edge (v i1 ,v i ) has a non-negative length d(v i1 ,v i ), which can represent either latency, or link cost, or hop count. The distance of any two vertices v i and v j , denoted by d(v i ,v j ), is the sum of the lengths of all edges between v i and v j on G. The path graph G thus defined represents an Internet network of linear topology. There is a target web server at v 1 whose data can be accessed by every other vertex v j . If there is a web proxy located on G between v 1 and v j , then v j only needs to access the data cached at the proxy. Given an integer 2 k n, suppose we choose k 1 vertices from V \{v 1 } as positions to place k 1 web proxies. For simplicity, we also view the web server at v 1 as a web proxy. For each vertex v j , suppose v i is a vertex in {v 1 ,...,v j } with largest index such that a web proxy 0167-6377/$ – see front matter © 2011 Elsevier B.V. All rights reserved. doi:10.1016/j.orl.2011.08.001

Improved algorithms for path partition and related problems

Embed Size (px)

Citation preview

Page 1: Improved algorithms for path partition and related problems

Operations Research Letters 39 (2011) 437–440

Contents lists available at SciVerse ScienceDirect

Operations Research Letters

journal homepage: www.elsevier.com/locate/orl

Improved algorithms for path partition and related problemsDanny Z. Chen, Haitao Wang ∗

Department of Computer Science and Engineering, University of Notre Dame, Notre Dame, IN 46556, USA

a r t i c l e i n f o

Article history:Received 2 May 2011Accepted 28 July 2011Available online 7 August 2011

Keywords:Path partitionWeb proxies placementMonge propertyk-link shortest pathAlgorithms

a b s t r a c t

Westudy the L∞ path partition problem: given a path of nweighted vertices and an integer k, remove k−1edges from the path so that the maximum absolute deviation of the weights of the resulting k sub-pathsfrom their mean is minimized. Previously, the best algorithm solves this problem in O(nk log k) time. Wepresent an O(nk) time algorithm. We also give improved solutions for two related problems: the Ld pathpartition problem and the web proxies placement problem.

© 2011 Elsevier B.V. All rights reserved.

1. Introduction

Let G = (V , E) be a connected graph with n vertices V = v1,v2, . . . , vn andn−1 edges E = (v1, v2), (v2, v3), . . . , (vn−1, vn).For each 1 ≤ i ≤ n, the vertex vi has a non-negative weight wi.The graph G is called a vertex-weighted path graph. Each sub-pathGi of G consists of a set of successive vertices in V connected bytheir adjacent edges; the weight of Gi, denoted by W (Gi), is thesum of the weights of all vertices in Gi. Given an integer k with1 ≤ k ≤ n − 1, let µ = W (G)/k; the L∞ or the Chebyshev pathpartition problem is to remove k − 1 edges from G to obtain k sub-paths G1,G2, . . . ,Gk such that the value max1≤i≤k |W (Gi) − µ| isminimized.

As indicated in [12], the L∞ path partition has many applica-tions, including image processing [13,14], workload balancing [3],data base paging [4], cluster analysis [15], etc.

The L∞ path partition problem can be solved by a straightfor-ward dynamic programming in O(n2k) time. Liverani et al. [12]gave a shifting algorithm of running time O(nk log k). The ‘‘shift-ing’’ techniques have been used elsewhere, e.g., finding amax–minpartitioning of a tree [5]. In this paper, we gave an improved algo-rithm that runs in O(nk) time. Our algorithm is based on dynamicprogramming inwhichwe prove that the involvedmatrix is totallymonotone [1], and thus the linear time row-minima algorithm [1]can be applied. Further, our algorithmworks for any arbitrary valueµ. In addition, ifµ = 0, the problem is solvable in O(n) time by thealgorithm in [7], which however does not work for µ = 0.

A related problem is the Ld path partition problem. Let G be thevertex-weighted path graph defined before. In the Ld path partition

∗ Corresponding author.E-mail addresses: [email protected] (D.Z. Chen), [email protected] (H. Wang).

0167-6377/$ – see front matter© 2011 Elsevier B.V. All rights reserved.doi:10.1016/j.orl.2011.08.001

problem, given an integer k with 1 ≤ k ≤ n − 1 and a real d ≥ 1,we aim to remove k − 1 edges from G to obtain k sub-paths G1,

G2, . . . ,Gk such that the value∑k

i=1 |W (Gi) − µ|d (instead of

max1≤i≤k |W (Gi) − µ|) is minimized, where µ = W (G)/k.As discussed in [9], the Ld path partition problem has appli-

cations in image processing [14]. The problem is solvable by astraightforward dynamic programming inO(n2k) time. Ho et al. [9]observed that a Monge property is satisfied in the problem, andthus gave a more efficient O(nk) time algorithm. We show thatthe problem can be modeled as finding a k-link shortest pathin a graph with concave Monge property, and by applying thealgorithms in [2,16], the problem is solvable in O(minn

√k log n,

n2O(√log k log log n)

) when k = Ω(log n), which is an improvementover the O(nk) result [9]. In addition, the case when d < 1 is alsodiscussed in [9].

Another related problem is theweb proxies placement problem inthe Internet of linear topology, which characterizes the problem ofminimizing the overall latency of accessing the target web serverby using some web proxies (refer to [10] for details). Given avertex-weighted path graph G defined as before, in this problem,each edge (vi−1, vi)has a non-negative length d(vi−1, vi), which canrepresent either latency, or link cost, or hop count. The distance ofany two vertices vi and vj, denoted by d(vi, vj), is the sum of thelengths of all edges between vi and vj on G. The path graph G thusdefined represents an Internet network of linear topology. There isa targetweb server at v1 whose data can be accessed by every othervertex vj. If there is a web proxy located on G between v1 and vj,then vj only needs to access the data cached at the proxy. Given aninteger 2 ≤ k ≤ n, suppose we choose k− 1 vertices from V \ v1

as positions to place k−1web proxies. For simplicity, we also viewthe web server at v1 as a web proxy. For each vertex vj, suppose viis a vertex in v1, . . . , vj with largest index such that a web proxy

Page 2: Improved algorithms for path partition and related problems

438 D.Z. Chen, H. Wang / Operations Research Letters 39 (2011) 437–440

Table 1Summary of the results, where T = minn

√k log n, n2O(

√log k log log n)

.

Problem Previous Ours Ours is better when

L∞ path partition O(nk log k)[12] O(nk) AlwaysLd path partition O(nk) [9] O(T ) k = Ω(log n)Web proxies placement O(nk) [17] O(T ) k = Ω(log n)

is placed at vi (e.g., if vj holds a proxy, vi = vj); then the latencycaused by vj is the value wj · d(vi, vj). The web proxies placementproblem is to find k − 1 vertices in V \ v1 for placing k − 1 webproxies to minimize the latency of all vertices of V . This problem isalso recognized as an asymmetric or one-sided k-median problemin the literature.

The web proxies placement problem was first proposed byLi et al. [10], where the problem was solved in O(n2k) time bydynamic programming. Later, Woeginger [17] showed that theproblem has a Monge property and thus solvable in O(nk) time.As the Ld path partition problem, we show that the web proxiesplacement problem can be modeled as finding a k-link shortestpath in a graph with concave Monge property, and thus solvablein O(minn

√k log n, n2O(

√log k log log n)

) for k = Ω(log n), which isan improvement over the O(nk) result [17]. Refer to [10] for moredetails on the applications of the problem. In addition, Li et al. [11]generalized the problem to a tree topology.

Note that the transformation to k-link shortest path problemscan also be used to solve other problems, e.g., some k-median andk-coverage problems [6], but additional challenges may need to beovercome.

All our results are summarized in Table 1.

2. The L∞ path partition problem

In this section, we present our algorithm for the L∞ pathequipartition problem. Our algorithm is based on dynamic pro-gramming.We prove that thematrix involved is totally monotone,so that the linear time row-minima algorithm [1] is applicable.

Given the vertex-weighted path graph G = (V , E), a dynamicprogramming scheme for finding an L∞ path partition on G worksas follows. For any j ≤ i, let Gji denote the sub-path of G from thevertex vj to the vertex vi (both vj and vi are inGji). Recall thatW (Gji)is the sum of the weights of all vertices in Gji. For 1 ≤ i ≤ n and1 ≤ l ≤ k, let W(i, l) denote the minimum objective value for par-titioning the sub-path G1i into l sub-paths. Our goal is to computeW(n, k). It is easy to see that W(i, l) = min1≤j≤imaxW(j − 1,l − 1), h(j, i), where h(j, i) = |W (Gji) − µ| and µ = W (G)/k.

Initially, we set W(0, l) = 0 for any 1 ≤ l ≤ k and W(i, 1) =

|W (G1i)−µ| for any 1 ≤ i ≤ n. Then, in a straightforwardmanner,an optimal partition of G can be found in O(n2k) time. Note thatthis dynamic programming might yield an optimal partition withless than k (non-empty) sub-paths. To deal with this issue, anO(n) time procedure is given in [12] to convert such an optimalpartition to another optimal partition with exactly k sub-paths.Our focus below is on reducing the running time of this dynamicprogramming.

A matrix M is totally monotone [1] if for all i1 < i2 and j1 < j2,M[i1, j1] > M[i1, j2] implies M[i2, j1] > M[i2, j2]. Given an n × ntotallymonotonematrixM such that each element can be obtainedin constant time, Aggarwal et al. [1] gave an O(n) time row-minimaalgorithm that can find a minimum element for each row ofM .

For 2 ≤ l ≤ k, letMl = Ml[1, n; 1, n] be an n× nmatrix, whereeachmatrix elementMl[i, j] = maxW(j−1, l−1), h(j, i) if j ≤ i,and Ml[i, j] = +∞ otherwise. Observe that for 1 ≤ i ≤ n, W(i, l)is the minimum element of the i-th row of Ml. In other words, foreach 2 ≤ l ≤ k, computing the values W(i, l) for all 1 ≤ i ≤ n isequivalent to computing the row-minima of Ml. Lemma 1 shows

that each matrix Ml, 2 ≤ l ≤ k, is totally monotone, and thusthe linear time row-minima algorithm [1] can be applied. Notethat we do not compute the matrix Ml explicitly. Instead, withO(n) time preprocessing, any h(j, i) can be computed in O(1) time.Specifically, inO(n) time,we compute the prefix sums of the vertexweights along G, i.e.,

∑mt=1 wt , for all 1 ≤ m ≤ n. Then, any h(j, i)

can be obtained in O(1) time. Thus, each matrix element Ml[i, j]can be computed in constant time. Note that we consider thematrices in the order of M2,M3, . . . ,Mk. Thus, when we considerthe matrix Ml[i, j], the row-minima for the matrix Ml−1[i, j] (i.e.,the values W(m, l − 1) for m = 1, 2, . . . , n) have already beencomputed. Initially, before we consider the matrix M2[i, j], allW(m, 1)’s form = 1, 2, . . . , n can be easily computed inO(n) time.Consequently, by the linear time row-minima algorithm [1], thedynamic programming for finding an L∞ path partition on G runsonly in O(nk) time.

Lemma 1. For each 2 ≤ l ≤ k, the matrix Ml[1, n; 1, n] is totallymonotone.

Proof. For any 1 ≤ i1 < i2 ≤ n and 1 ≤ j1 < j2 ≤ n, assumeMl[i1, j1] > Ml[i1, j2]. Our goal is to proveMl[i2, j1] > Ml[i2, j2].

Assume to the contrary Ml[i2, j1] ≤ Ml[i2, j2]. Below, by caseanalysis, we derive Ml[i1, j1] ≤ Ml[i1, j2], which incurs contradic-tion.

First of all, if j2 > i1, thenMl[i1, j2] = +∞. Thus, the inequalityMl[i1, j1] ≤ Ml[i1, j2] always holds andwe are donewith the proof.In the following, we assume j2 ≤ i1. Thus, j1 < j2 ≤ i1 < i2.

Since j1 < j2 ≤ i1 < i2, we have Ml[i1, j1] = maxW(j1 − 1,l − 1), h(j1, i1), Ml[i1, j2] = maxW(j2 − 1, l − 1), h(j2, i1),Ml[i2, j1] = maxW(j1 − 1, l − 1), h(j1, i2), and Ml[i2, j2] =

maxW(j2 − 1, l − 1), h(j2, i2).For simplicity, for any j ≤ i, let W (j, i) = W (Gji). Recall that

h(j, i) = |W (Gji) − µ| = |W (j, i) − µ|. Consider the four valuesW (j2, i1),W (j2, i2),W (j1, i1), andW (j1, i2). Since j1 < j2 ≤ i1 < i2,W (j2, i1) is the smallest and W (j1, i2) is the largest among thesefour values. However, either W (j2, i2) ≤ W (j1, i1) or W (j2, i2) >W (j1, i1) may hold.

Since W (j2, i1) ≤ W (j2, i2), depending on the value of µ, thereare three cases: µ ≤ W (j2, i1), W (j2, i1) < µ ≤ W (j2, i2), andW (j2, i2) < µ. In the following,weprove that in each caseMl[i1, j1]≤ Ml[i1, j2] holds.

1. If µ ≤ W (j2, i1), we have h(j2, i2) ≤ h(j1, i2) due to µ ≤

W (j2, i2) ≤ W (j1, i2). SinceMl[i2, j1] ≤ Ml[i2, j2], by definitions(i.e.,Ml[i2, j1] = maxW(j1−1, l−1), h(j1, i2) andMl[i2, j2] =

maxW(j2 − 1, l − 1), h(j2, i2)), it must be W(j1 − 1, l − 1) ≤

W(j2 − 1, l − 1) and h(j1, i2) ≤ W(j2 − 1, l − 1).Since µ ≤ W (j2, i1), we have µ ≤ W (j1, i1) ≤ W (j1, i2),and thus h(j1, i1) ≤ h(j1, i2). Since we have proved above thath(j1, i2) ≤ W(j2 − 1, l − 1), h(j1, i1) ≤ W(j2 − 1, l − 1) holds.The above shows that maxW(j1 −1, l−1), h(j1, i1) ≤ W(j2 −

1, l−1). By the definitions ofMl[i1, j1] andMl[i1, j2],Ml[i1, j1] ≤

Ml[i1, j2].2. If W (j2, i1) < µ ≤ W (j2, i2), we have h(j2, i2) ≤ h(j1, i2) due

to µ ≤ W (j2, i2) ≤ W (j1, i2). Since Ml[i2, j1] ≤ Ml[i2, j2], asin Case 1, it must be W(j1 − 1, l − 1) ≤ W(j2 − 1, l − 1)and h(j1, i2) ≤ W(j2 − 1, l − 1). Depending on whether µ <W (j1, i1) orW (j1, i1) ≤ µ, there are two sub-cases.(a) If µ < W (j1, i1), the analysis is the same as Case 1. Since

µ ≤ W (j1, i1) ≤ W (j1, i2), we have h(j1, i1) ≤ h(j1, i2), andthus h(j1, i1) ≤ W(j2 − 1, l− 1). Hence, maxW(j1 − 1, l−1), h(j1, i1) ≤ W(j2 − 1, l − 1), andMl[i1, j1] ≤ Ml[i1, j2].

(b) If W (j1, i1) ≤ µ, we have h(j2, i1) ≥ h(j1, i1) due toW (j2, i1) ≤ W (j1, i1) ≤ µ. Since W(j1 − 1, l − 1) ≤

W(j2 − 1, l− 1), we have maxW(j1 − 1, l− 1), h(j1, i1) ≤

maxW(j2 − 1, l − 1), h(j2, i1), i.e.,Ml[i1, j1] ≤ Ml[i1, j2].

Page 3: Improved algorithms for path partition and related problems

D.Z. Chen, H. Wang / Operations Research Letters 39 (2011) 437–440 439

Fig. 1. Illustrating the DAG G′ .

3. If W (j2, i2) < µ, depending on the values of W(j1 − 1, l − 1)and W(j2 − 1, l − 1), there are two sub-cases.(a) IfW(j1−1, l−1) < W(j2−1, l−1), then ifW (j1, i1) ≤ µ, we

have h(j1, i1) ≤ h(j2, i1) due to W (j2, i1) ≤ W (j1, i1) ≤ µ.As in Case 2(b), it isMl[i1, j1] ≤ Ml[i1, j2].Ifµ < W (j1, i1), we have h(j1, i1) ≤ h(j1, i2). SinceMl[i2, j1]= maxW(j1 − 1, l − 1), h(j1, i2), it must be h(j1, i1) ≤

Ml[i2, j1]. Further, due to Ml[i2, j1] ≤ Ml[i2, j2], we haveh(j1, i2) ≤ Ml[i2, j2] = maxW(j2 − 1, l − 1), h(j2, i2).Since W (j2, i1) ≤ W (j2, i2) < µ, we have h(j2, i1) ≥

h(j2, i2). Thus, Ml[i1, j2] ≥ Ml(i2, j2) ≥ h(j1, i2) ≥ h(j1, i1).Further, recall that W(j1 − 1, l − 1) < W(j2 − 1, l − 1).Hence, Ml[i1, j1] ≤ Ml[i1, j2].

(b) If W(j2 − 1, l − 1) ≤ W(j1 − 1, l − 1), then due toMl[i2, j1] ≤ Ml[i2, j2], we have h(j1, i2) ≤ h(j2, i2) andW(j1−1, l−1) ≤ h(j2, i2). SinceW (j2, i1) ≤ W (j2, i2) < µ,we have h(j2, i1) ≥ h(j2, i2). Thus, h(j2, i1) ≥ W(j1−1, l−1)and h(j2, i1) ≥ h(j1, i2).Due to W (j2, i1) ≤ W (j1, i1) ≤ W (j1, i2), h(j1, i1) ≤ maxh(j2, i1), h(j1, i2) always holds. Due to h(j2, i1) ≥ h(j1, i2),we obtain that h(j1, i1) ≤ h(j2, i1). Consequently, we havemaxW(j1 − 1, l − 1), h(j1, i1) ≤ h(j2, i1), which impliesMl[i1, j1] ≤ Ml[i1, j2].

The lemma thus follows.

In summary, we have the following result.

Theorem 1. The L∞ path partition problem is solvable in O(nk) time.

3. The Ld path partition problem

In this section,we discuss our algorithm for the Ld path partitionproblem. Our algorithm is based on a new problem modeling.

Given the vertex-weighted path graph G = (V , E), we firstconstruct a directed acyclic graph (DAG) G′

= (V ′, E ′) as follows.The vertex set V ′ consists of all vertices in V and a dummy vertexvn+1, where the weight of vn+1, denoted by wn+1, is zero. In otherwords, V ′

= v1, v2, . . . , vn, vn+1. For any i and jwith 1 ≤ i < j ≤

n+ 1, there is a directed edge (vi, vj) in E ′ from vi to vj (see Fig. 1),and the edge has a weight, denoted by w(i, j), which is defined asthe value |

∑j−1t=i wt − µ|

d with µ = W (G)/k (recall that W (G) isthe sum of the weights of all vertices in the given path graph G).

A k-link path in G′ refers to a path that has k edges. Theweight ofany path inG′ is defined as the sumof theweights of all edges in thepath. A k-link shortest path from v1 to vn+1 in G′ is a k-link path thathas the minimumweight among all k-link paths from v1 to vn+1 inG′. Then, our algorithm is based on the following observation.

Lemma 2. A k-link shortest path from v1 to vn+1 in G′ corresponds toan optimal Ld path partition on the given path graph G.

Proof. Consider an arbitrary k-link path P (not necessarily short-est) from v1 to vn+1 in G′. The path P corresponds to a path parti-tion on G in the following way. For each directed edge (vi, vj) ∈ P ,it corresponds to a sub-path Gt of G that consists of the verticesvi, vi+1, . . . , vj−1. Since P has k edges, we have k sub-paths ofG. Since P is a path from v1 to vn+1, each vertex vi of G is con-tained in one and only one sub-path of G obtained above. Thus, weobtain a path partition on G into k sub-paths. Further, the weight

of the edge (vi, vj) is |∑j−1

t=i wt − µ|d, which is |W (Gt) − µ|

d. Sup-pose the sub-paths of G correspond to P are G1,G2, . . . ,Gk; thenthe weight of the path P is equal to

∑ki=1 |W (Gi) − µ|

d. Therefore,it is easy to see that if P is a k-link shortest path from v1 to vn+1 inG′, the corresponding path partition on G is an optimal solution forthe Ld path partition problem. The lemma thus follows.

By Lemma 2, to compute an optimal solution for the Ld pathpartition problem on G, it is sufficient to find a k-link shortest pathfrom v1 to vn+1 in the DAG G′. Note that the proof of Lemma 2also gives a way to compute in O(n) time the corresponding pathpartition on G once we have a k-link path from v1 to vn+1 in G′.

It is shown in [8,9] that the following concave (called convexin [9]) Monge property holds.

Lemma 3 ([8,9]). The inequality w(i, j)+w(i+1, j+1) ≤ w(i, j+1) + w(i + 1, j) holds for all 1 < i + 1 < j < n + 1.

In addition, it is easy to see (also indicated in [9]) that with O(n)time preprocessing we can compute each edge weight w(i, j) inconstant time (since the value

∑j−1t=i wt can be obtained in constant

time). Thus, we do not need to construct the DAG G′ explicitly.Instead, we can compute an edge weight whenever we need it inthe algorithm.

If the concave Monge property as in Lemma 3 is satisfied,Aggarwal et al. [2] gave an algorithm that can compute a k-linkshortest path from v1 to vn+1 in G′ in O(n

√k log n + n log n) time,

and Schieber [16] also gave an algorithm for it with running timeO(n ·2O(

√log k log log n)) for k = Ω(log n). Thus, we have the following

result.

Theorem 2. The Ld path partition problem is solvable in O(minn

√k log n, n2O(

√log k log log n)

) time for k = Ω(log n).

Note that if µ is an arbitrary value, the above result is stillapplicable.

4. The web proxies placement problem

The web proxies placement problem is solved in a very similarway to that for the Ld path partition problem, i.e., based on a similarproblem modeling. We briefly discuss it below.

Given the vertex-weighted path graphG = (V , E), we constructthe DAG G′

= (V ′, E ′) the same as in Section 3. The only differenceis that in this problem for each directed edge (vi, vj) ∈ E ′, itsweightw(i, j) is defined as

∑j−1t=i wt ·d(vi, vt) (note that d(vi, vi) =

0). We have the following observation.

Lemma 4. A k-link shortest path from v1 to vn+1 in G′ corresponds toan optimal solution for the web proxies placement problem on G.

Proof. Consider an arbitrary k-link path P (not necessarily short-est) from v1 to vn+1 in G′. The path P corresponds to a feasiblesolution for the web proxies placement problem in the follow-ing way. For each directed edge (vi, vj) ∈ P , we place a webproxy at the vertex vi (if i = 1, we do not need to do so). Then,all vertices vi, vi+1, . . . , vj−1 will access data from vi. Thus, the la-tency of all above vertices is

∑j−1t=i wid(vi, vt), which is exactly the

weight w(i, j) of the edge (vi, vj) of P . Therefore, if P is a k-linkshortest path from v1 to vn+1 in G′, the corresponding solution forthe web proxies placement problem is optimal. The lemma thusfollows.

It is shown in [17] that the following concave Monge propertyholds.

Lemma 5 ([17]). The inequality w(i, j)+w(i+1, j+1) ≤ w(i, j+1) + w(i + 1, j) holds for all 1 < i + 1 < j < n + 1.

Page 4: Improved algorithms for path partition and related problems

440 D.Z. Chen, H. Wang / Operations Research Letters 39 (2011) 437–440

In addition, it is also shown in [17] that with O(n) timepreprocessing each edgeweightw(i, j) can be obtained in constanttime. Thus, we do not need to construct the graph G′ explicitly.Consequently, by using the k-link shortest path algorithms [2,16],we have the following result.

Theorem 3. An optimal solution for the web proxies placementproblem can be found in O(minn

√k log n, n2O(

√log k log log n)

) timefor k = Ω(log n).

Acknowledgments

The research was supported in part by NSF Grant CCF-0916606.The authors would like to thank an anonymous referee for usefulsuggestions that helped to improve the presentation of the paper.

References

[1] A. Aggarwal, M. Klawe, S. Moran, P. Shor, R. Wilbur, Geometric applications ofa matrix-searching algorithm, Algorithmica 2 (1987) 195–208.

[2] A. Aggarwal, B. Schieber, T. Tokuyama, Finding a minimum weight k-linkpath in graphs with concave monge property and applications, Discrete &Computational Geometry 12 (1994) 263–280.

[3] R.I. Becker, I. Lari,M. Lucertini, B. Simeone,Max-minpartitioning of grid graphsinto connected components, Networks 32 (2) (1998) 115–125.

[4] R.I. Becker, Y. Perl, The shifting algorithm technique for the partitioning oftrees, Discrete Applied Mathematics 62 (1995) 15–34.

[5] R.I. Becker, Y. Perl, S. Schach, A shifting algorithm for min–max treepartitioning, Journal of the ACM 29 (1982) 58–67.

[6] D.Z. Chen, H. Wang, New algorithms for 1-D facility location and pathequipartition problems, in: Proc. of the Algorithms and Data StructuresSymposium (WADS), in: Lecture Notes in Computer Science, vol. 6844,Springer-Verlag, 2011, pp. 207–218.

[7] G.N. Frederickson, Optimal algorithms for tree partitioning. in: Proc. of the2nd Annual ACM-SIAM Symposium of Discrete Algorithms, SODA, 1991,pp. 168–177.

[8] R. Hassin, A. Tamir, Improved complexity bounds for location problems on thereal line, Operations Research Letters 10 (1991) 395–402.

[9] P.-H. Ho, A. Tamir, B.Y. Wu, Minimum Lk path partitioning – An illustration ofthe Monge property, Operations Research Letters 36 (1) (2008) 43–45.

[10] B. Li, X. Deng,M. Golin, K. Sohraby, On the optimal placement ofweb proxies inthe internet: the linear topology, in: Proc. of the IFIP TC-6 Eigth InternationalConference on High Performance Networking, 1998, pp. 485–495.

[11] B. Li, M.J. Golin, G.F. Italiano, X. Deng, K. Sohraby, On the optimal placementof web proxies in the internet, in: Proc. of IEEE INFOCOM’99, 1999,pp. 1282–1290.

[12] M. Liverani, A. Morgana, B. Simeone, G. Storchi, Path equipartition in theChebyshev norm, European Journal of Operational Research 123 (2) (2000)428–435.

[13] M. Lucertini, Y. Perl, B. Simeone, Image enhancement by path partitioning,in: Recent Issues in Pattern Analysis and Recognition, in: Lecture Notes inComputer Science, vol. 399, Springer-Verlag, 1989, pp. 12–22.

[14] M. Lucertini, Y. Perl, B. Simeone, Most uniform path partitioning and its use inimage processing, Discrete Applied Mathematics 42 (2–3) (1993) 227–256.

[15] M.Maravalle, S. Bruno, N. Rosella, Clustering on trees, Computational Statistics& Data Analysis. 24 (1997) 217–234.

[16] B. Schieber, Computing a minimum weight k-link path in graphs with theconcave monge property, Journal of Algorithms 29 (2) (1998) 204–222.

[17] G.J. Woeginger, Monge strikes again: optimal placement of web proxies in theinternet, Operations Research Letters 27 (3) (2000) 93–96.