The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem:...

12
The directional p-median problem: Definition, complexity, and algorithms Laura E. Jackson * , George N. Rouskas, Matthias F.M. Stallmann North Carolina State University, Department of Computer Science, Raleigh NC 27695 – 7534, United States Received 15 December 2003; accepted 15 June 2005 Available online 7 July 2006 Abstract An instance of a p-median problem gives n demand points. The objective is to locate p supply points in order to min- imize the total distance of the demand points to their nearest supply point. p-Median is polynomially solvable in one dimension but NP-hard in two or more dimensions, when either the Euclidean or the rectilinear distance measure is used. In this paper, we treat the p-median problem under a new distance measure, the directional rectilinear distance, which requires the assigned supply point for a given demand point to lie above and to the right of it. In a previous work, we showed that the directional p-median problem is polynomially solvable in one dimension; we give here an improved solu- tion through reformulating the problem as a special case of the constrained shortest path problem. We have previously proven that the problem is NP-complete in two or more dimensions; we present here an efficient heuristic to solve it. Com- pared to the robust Teitz and Bart heuristic, our heuristic enjoys substantial speedup while sacrificing little in terms of solu- tion quality, making it an ideal choice for real-world applications with thousands of demand points. Ó 2006 Elsevier B.V. All rights reserved. Keywords: Directional p-median problem; Traffic quantization; Vector quantization 1. Introduction The traditional p-median problem asks us to find, for a given set of n demand points, the set of p sup- ply points that minimizes the total distance of each demand point to its nearest supply point. Hassin and Tamir [6] give a O(np) algorithm to solve the p-median problem on the real line, and Megiddo and Supowit [9] prove that rectilinear and Euclidean versions of the p-median problem in the plane are NP-complete. The choice of distance measure impacts the complexity of the problem as well as the approach needed to find a solution. In this paper, we explore the p-median problem under a new distance measure, the directional recti- linear distance. On the real line, this restriction requires that the assigned supply point for a given demand point be located to the right of it, while in the plane, the assigned supply point for a given demand point must lie above and to the right of it. In general, the rectilinear l-directional, k-dimen- sional p-median problem forces a supply point to achieve or exceed the values of the first l coordinates of its assigned demand points. This variant of the 0377-2217/$ - see front matter Ó 2006 Elsevier B.V. All rights reserved. doi:10.1016/j.ejor.2005.06.080 * Corresponding author. E-mail address: [email protected] (L.E. Jackson). European Journal of Operational Research 179 (2007) 1097–1108 www.elsevier.com/locate/ejor

Transcript of The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem:...

Page 1: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

The directional p-median problem: Definition, complexity,and algorithms

Laura E. Jackson *, George N. Rouskas, Matthias F.M. Stallmann

North Carolina State University, Department of Computer Science, Raleigh NC 27695 – 7534, United States

Received 15 December 2003; accepted 15 June 2005Available online 7 July 2006

Abstract

An instance of a p-median problem gives n demand points. The objective is to locate p supply points in order to min-imize the total distance of the demand points to their nearest supply point. p-Median is polynomially solvable in onedimension but NP-hard in two or more dimensions, when either the Euclidean or the rectilinear distance measure is used.In this paper, we treat the p-median problem under a new distance measure, the directional rectilinear distance, whichrequires the assigned supply point for a given demand point to lie above and to the right of it. In a previous work, weshowed that the directional p-median problem is polynomially solvable in one dimension; we give here an improved solu-tion through reformulating the problem as a special case of the constrained shortest path problem. We have previouslyproven that the problem is NP-complete in two or more dimensions; we present here an e!cient heuristic to solve it. Com-pared to the robust Teitz and Bart heuristic, our heuristic enjoys substantial speedup while sacrificing little in terms of solu-tion quality, making it an ideal choice for real-world applications with thousands of demand points.! 2006 Elsevier B.V. All rights reserved.

Keywords: Directional p-median problem; Tra!c quantization; Vector quantization

1. Introduction

The traditional p-median problem asks us to find,for a given set of n demand points, the set of p sup-ply points that minimizes the total distance of eachdemand point to its nearest supply point. Hassinand Tamir [6] give a O(np) algorithm to solve thep-median problem on the real line, and Megiddoand Supowit [9] prove that rectilinear and Euclideanversions of the p-median problem in the plane

are NP-complete. The choice of distance measureimpacts the complexity of the problem as well asthe approach needed to find a solution.

In this paper, we explore the p-median problemunder a new distance measure, the directional recti-linear distance. On the real line, this restrictionrequires that the assigned supply point for a givendemand point be located to the right of it, whilein the plane, the assigned supply point for a givendemand point must lie above and to the right ofit. In general, the rectilinear l-directional, k-dimen-sional p-median problem forces a supply point toachieve or exceed the values of the first l coordinatesof its assigned demand points. This variant of the

0377-2217/$ - see front matter ! 2006 Elsevier B.V. All rights reserved.doi:10.1016/j.ejor.2005.06.080

* Corresponding author.E-mail address: [email protected] (L.E. Jackson).

European Journal of Operational Research 179 (2007) 1097–1108

www.elsevier.com/locate/ejor

Page 2: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

p-median problem arises naturally in certain quanti-zation applications, which we discuss shortly.

In a previous work [7] we showed that the direc-tional p-median problem is polynomially solvable inone dimension; we give here an improved solutionthrough reformulating the problem as a special caseof the constrained shortest path problem. We havepreviously proven that the problem is NP-completein two or more dimensions [8]; we present here ane!cient heuristic to solve it. Compared to therobust Teitz and Bart heuristic, our heuristic enjoyssubstantial speedup while sacrificing little in termsof solution quality, making it an ideal choice forour target applications which may have thousandsof demand points.

The rest of the paper is organized as follows. Sec-tion 2 summarizes previous results, defines the direc-tional rectilinear distance metric, and describesapplications of directional p-median. Section 3 con-siders the one-dimensional problem, directional p-median on the real line, and gives the constrainedshortest path formulation. Section 4 presents a fastheuristic algorithm for solving the directional p-median in multiple dimensions, and Section 5 con-cludes the paper.

2. Problem definition

2.1. The traditional p-median problem

In k-dimensional space, k P 1, the continuous p-median problem allows supply points to be locatedanywhere in k-space. The discrete problem providesa list of candidate points from which supply pointsmay be chosen. In two-dimensional space, letd((xi,yi),(zj, tj)) be the distance from point (xi,yi) topoint (zj,0j) according to some distance metric.The decision version of the continuous p-medianproblem in the plane may be formally stated as:

Problem 2.1 (Continuous-PM2). Given a set X ={(x1,y1), (x2,y2), . . . , (xn,yn)} of demand points inthe plane, an integer p, and a bound B, does thereexist a set

S ! f"z1; t1#; "z2; t2#; . . . ; "zp; tp#gof p supply points such thatXn

i!1

min16j6p

fd""xi; yi#; "zj; tj##g 6 B?

Continuous-PM2 is NP-complete under eitherthe Euclidean (de) or the rectilinear (dr) distancemeasure [9], where de and dr are defined as:

de""xi; yi#; "zj; tj## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"xi $ zj#2 % "yi $ tj#2

q

dr""xi; yi#; "zj; tj## ! jxi $ zjj% jyi $ tjj

Under the rectilinear distance measure, it is wellknown that only demand points and intersectionpoints need be considered as candidates for supplypoints. Intersection points are found by crossingthe set {x1,x2, . . . ,xn} with the set {y1,y2, . . . ,yn},and subtracting the demand points, yielding at mostn2 $ n new points. Thus the continuous p-medianproblem under the rectilinear distance measurereduces to a discrete p-median problem. For a com-plete treatment of discrete location problems, thereader is referred to [4].

The discrete p-median problem in the plane canbe formulated as the following integer program.

Problem 2.2 (Discrete-PM2)

MinimizeX

i2X

X

j2Cdijrij

s:t:X

j2Crij ! 1 8i2X ; rij 6 sj 8i2X ; j2C;

X

j2Csj ! p; rij;sj 2f0;1g 8i2X ; j2C;

where i 2 X is the the set of demand points, j 2 C isthe the set of candidate points, dij is the distancefrom point, i to point j, p is the number of supplypoints to be chosen,

rij !1 if point i is assigned to candidate j;

0 otherwise;

"

sj !1 if candidate j is chosen;

0 otherwise:

"

The distance matrix [dij] holds distances betweendemand and candidate points. Section 4.1 discussesdistance matrix properties that a"ect the di!culty offinding a good quality solution [13].

2.2. The directional p-median problem

We now define the directional rectilinear distancemeasure. In general, an l-directional, k-dimensionalrectilinear metric (with l 6 k) defines distance frompoint (r1, . . . , rk) to (q1, . . . ,qk) to be 1 if ri > qi forat least one i 2 {1, . . . , l} and

P16i6kjqi $ rij other-

wise. Thus, in a directional p-median problem, asupply point must achieve or exceed the values ofthe first l coordinates of all its demand points. Onthe real line, this restriction requires that the nearest

1098 L.E. Jackson et al. / European Journal of Operational Research 179 (2007) 1097–1108

Page 3: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

supply point for a given demand point be located tothe right of it, while in the plane, the nearest supplypoint for a given demand point must lie above andto the right of it. In the plane, the 2-directional rec-tilinear distance is:

ddr""xi; yi#; "xj; yj##

!xj $ xi % yj $ yi if xj P xi and yj P yi;

1; otherwise:

"

We define directional intersection points to be thesubset of intersection points that lie above (at least)one demand point as well as to the right of (at least)one demand point, as illustrated in Fig. 1. Specifi-cally, the point (xj,yj) is a directional intersectionpoint if:

1. (xj,yj) 62 X, that is, (xj,yj) is not itself a demandpoint, and

2. there exist points (xi,yi) 2 X and (xk,yk) 2 X forwhich xj = xi and yj = yk and xj > xk and yj > yi.

Analogous to the case of the (non-directional) rec-tilinear p-median problem, the continuous 2-direc-tional rectilinear p-median problem also reduces toa discrete problem; specifically, we need only con-sider demand points and directional intersectionpoints as candidates for supply points. Thus the num-ber of candidate points c is at most n + (n2 $ n)/2.

2.3. Applications

The directional p-median problem arises natu-rally in problem domains where it is important toquantize a set of inputs taking values from a contin-uous set of values under the constraint that eachinput is mapped to a quantization level with an

equal or higher value. We now consider two suchapplications.

Preemptive scheduling of periodic tasks on multi-processor systems. In the slotted time model we con-sider, a periodic task (‘‘demand point’’ in p-medianterminology) is characterized by a rate xi, 0 < xi < 1.Writing xi as a fraction in lowest terms, xi ! Ci

Di, then

Ci is the computation time and Di is the period; thatis, Ci is the number of unit-length subtasks thatmust be processed every Di time slots, starting attime 0. A processor may work on at most one taskat a time, and a task may be processed by no morethan one processor at a time. A schedule is feasibleif each task i receives Ci units of processing every Di

time slots, starting at time 0. This model is nearlyidentical to the one considered in [3], which doesnot require the ratio Ci

Dito be in lowest terms.

A feasible schedule for this problem exists if andonly if

Pni!1xi 6 m [3], where m is the number of

processors, and the fastest scheduling algorithmruns in time O(m logn) at each slot [2]. Therefore,this algorithm may not be appropriate for applica-tions with a very large number n of tasks, such asa web server for a popular web site which mightreceive thousands of requests per minute, or a Gridserving very large task sets that are also highlydynamic in nature. For these applications it is essen-tial to have a scheduling algorithm with a runningtime independent of the number of requests.

In [7,8], we proposed to quantize the set of n taskrates into a small, fixed set p& n of o"ered rates(‘‘supply points’’). Specifically, the system assignsa task with requested rate xi to the next highero"ered rate zj, such that xi 6 zj. By doing so, eachtask is guaranteed to receive at least the requiredamount of computation time with each period,hence the system will meet the quality of service(QoS) requested by the user. For such a quantizedsystem we devised a new scheduling algorithm[7,8] which runs in time O(m) per slot, i.e., indepen-dent of the input size n; the new algorithm is alsosignificantly simpler than the one in [2]. While quan-tization has the disadvantage of requiring moreresources (e.g., processor time) than a continuous-rate system to accommodate a given set of tasks,the tradeo" is more than paid for by the resultinggains in speed and simplicity.

Control and management of packet-switched net-works.A transmission link in a typical backbone net-work operates at data rates of 2.5–10 Gbps, and cancarry hundreds of thousands of independent tra!cflows (users). Each flow is typically characterized

y

x

demand point

directional intersection point

Fig. 1. A downward sloping line of demand points yields themost directional intersection points, (n2 $ n)/2.

L.E. Jackson et al. / European Journal of Operational Research 179 (2007) 1097–1108 1099

Page 4: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

by a number of tra!c parameters, such as band-width and burst size, as well as QoS parameters, suchas a delay bound. Accommodating such a largenumber of flows poses significant scalability prob-lems for a number of network control and manage-ment functions. The service provider may prefer togroup (quantize) similar requests into a single servicelevel, such that any given user receives at least theamount requested of each resource. This quantiza-tion problem is equivalent to a directional p-medianproblem in multiple dimensions. The operations oftra!c engineering, packet scheduling, network man-agement, tra!c policing, and billing are greatly sim-plified in such a quantized network. Performanceanalysis is also more tractable, since systems withcontinuous rates give rise to analytical models withinfinite dimensions, and such models are usuallyapproximated by finite-dimensional ones.

3. The directional p-median problem on the real line

In [7], we considered two variants of theone-dimensional directional p-median problem. InDPM1, the input is a finite set of demand points,while in SDPM1, the input is the probability densityfunction representing the population of demandpoints. We presented optimal solutions in each case.In this work we first formally define problem DPM1and then show how to translate DPM1 into a con-strained shortest path problem, allowing a fastersolution than that given in [7].

Let X be a set of n demand points on the real line{x1, . . . ,xn}, such that x1 6 x2 6' ' '6 xn. A set ofsupply points S = {z1, . . . ,zp}, z1 < z2 <' ' '< zp,1 6 p 6 n, is a feasible solution for X if and only ifxn 6 zp. For notational convenience, we assumez0 = 0. Associated with a feasible solution is animplied mapping from X! S, where xi ! zj if andonly if zj$1 < xi 6 zj. Fig. 2 shows a sample mappingfrom a set of 13 demand points onto a solution setof 6 supply points.

Letting Xj be the set of demands mapped to sup-ply point zj and nj = jXjj, problem DPM1 is:

Problem 3.1 (DPM1). Given a set X of n demandpoints, x1 6 x2 6' ' '6 xn, find a feasible set S of psupply points, z1 < z2 <' ' '< zp, 1 6 p 6 n, whichminimizes the following objective function:

g"z1; . . . ; zp# !Xp

j!1

X

xi2X j

"zj $ xi# "1#

The objective function g(z1, . . . ,zp) is simply the sumof the distances from each demand point to its near-est (under the new directional distance measure)supply point. The minimum (optimal) value of g iscalled g*, and a feasible set S at which g* is obtainedis an optimal solution set for X.

We have the following lemma; its proof, whichcan be found in [7], is straightforward.

Lemma 3.1. Let X be a set of n demand points suchthat x1 6 x2 6' ' '6 xn. There exists an optimal solu-tion set S = {z1, . . . , zp}, z1 < z2 <' ' '< zp, of X, forwhich zj 2 X, for each j = 1, . . . , p.

3.1. Graph representation of DPM1: A fasteralgorithm

In [7] we present an O(n2p) algorithm that opti-mally solves DPM1. We can improve the solutiontime to O"n

!!!!!!!!!!!!!p log n

p# by restating DPM1 as a

constrained shortest path problem (Garey andJohnson’s problem ND30) (see also [15]). LetG = (V,E) be a weighted, complete, directed acyclicgraph (DAG), with vertex set V = {0,1, . . . ,n} andarc weights w(i, j) for arc (i, j) from vertex i to j,0 6 i < j. Solving DPM1 is equivalent to finding aminimum weight p-link path from vertex 0 to n inG. Further, we show that the arc weights in theDPM1 graph representation obey the concaveMonge property, allowing a solution in time

x x x x x x x x x x x

zzzzzz

xX :

S :

0 1

x1 2 3 4 5 6 7 98 10 11 12 13

654321

Fig. 2. Sample mapping of task densities to service levels.

1100 L.E. Jackson et al. / European Journal of Operational Research 179 (2007) 1097–1108

Page 5: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

O"n!!!!!!!!!!!!!p log n

p# [1]. These results are stated in the fol-

lowing two lemmas.

Lemma 3.2. Solving an instance of DPM1 with a setX of n demand points is equivalent to finding aminimum weight p-link path in a DAG.

Proof. Given an instance of DPM1, we construct aDAG as follows: Demand xi gives rise to node i, andwe create a dummy node 0. Arc weight w(i,k) repre-sents the cost of mapping demand points i + 1, i +2, . . . ,k, to point k:

w"i; k# !0; k ! i% 1;

"k $ i$ 1#xk $Pk$1

j!i%1xj; k > i% 1:

8><

>:

The objective is to find the minimum weight pathfrom vertex 0 to n that has exactly p arcs. A patht = (i0, i1), (i1, i2), . . . , (ir$1, ir) is a (0-n)-path if i0 = 0and ir = n. The weight of path t is:

w"t# ! w"i0; i1# % w"i1; i2# % ' ' ' % w"ir$1; ir#

Any p-link path t = (i0, i1), (i1, i2), . . . , (ip$1, ip) withi0 = 0 and ip = n is a feasible solution for DPM1,with the following interpretation: the demandpoints corresponding to nodes i1, i2, . . . , ip are desig-nated as supply points. h

As an example, Fig. 3 shows the graph for aDPM1 instance with n = 5. Suppose p = 3, and let(0, 2, 4, 5) be a 3-link path in Fig. 3. Then the cor-responding feasible solution for DPM1 is z1 = x2,z2 = x4, and z3 = x5. The sum of the arc weights

for this path equals the objective function valuefor the implied mapping for the corresponding solu-tion S = {z1,z2,z3}, namely:

w"t# ! w"0; 2# % w"2; 4# % w"4; 5#! "x2 $ x1# % "x4 $ x3# % 0

Lemma 3.3. The arc weights for the graph represen-tation of DPM1 obey the concave Monge condition.

Proof. A weighted, complete DAG G satisfies theconcave Monge condition if

w"i; j# % w"i% 1; j% 1# 6 w"i; j% 1# % w"i% 1; j#"2#

holds for all 0 < i + 1 < j < n. We evaluate the left-hand side (LHS) and right-hand side (RHS) of Eq.(2), and then show that RHS $ LHS P 0.

LHS ! w"i; j# % w"i% 1; j% 1#

! "j$ i$ 1#xj $Xj$1

m!i%1

xm

% "j$ i$ 1#xj%1 $Xj

m!i%2

xm

RHS ! w"i; j% 1# % w"i% 1; j#

! "j$ i#xj%1 $Xj

m!i%1

xm

% "j$ i$ 2#xj $Xj$1

m!i%2

xm

0 1 2 3 4 50000 0

5 4 5 3 5 2 5 1

4 3 4 2 4 1

3 2 3 1

2 1

3 2

4 3 4 2

5 4 5 3 5 2

4 3

5 4 5 3

5 4

Fig. 3. Graph representation of an instance of DPM1 with n = 5.

L.E. Jackson et al. / European Journal of Operational Research 179 (2007) 1097–1108 1101

Page 6: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

RHS$ LHS

! "j$ i$ "j$ i$ 1##xj%1

% "j$ i$ 2$ "j$ i$ 1##xj

%Xj$1

m!i%1

xm $Xj

m!i%1

xm %Xj

m!i%2

xm $Xj$1

m!i%2

xm

!

! xj%1 $ xj % $xj % xj# $

! xj%1 $ xjP 0

The last step above follows from x1 6 x2 6' ' '6xn. h

Due to Lemmas 3.2 and 3.3, DPM1 can be solvedin time O"n

!!!!!!!!!!!!!p log n

p# using the algorithm in [1].

4. The directional p-median problem in two or moredimensions

Formally, we define the directional p-medianproblem in two dimensions (DPM2) to be:

Problem 4.1 (DPM2). Given a set X = {(x1,y1),(x2,y2), . . . , (xn,yn)} of points in the plane, an integerp, and a bound B, does there exist a set

S ! f"z1; t1#; "z2; t2#; . . . ; "zp; tp#g

of p points such that

g"S# !Xn

i!1

min16j6p

fddr""xi; yi#; "zj; tj##g 6 B? "3#

In [8], we prove that DPM2 is NP-complete; weomit the proof due to its length and complexity. Itfollows that the directional rectilinear p-medianproblem in three or more dimensions is also NP-complete.

We now present an e!cient heuristic algorithmfor DPM2 that produces good quality results for avariety of input distributions. The new heuristic,which we refer to as the TB restricted (TBr) heuris-tic, uses as building blocks the vertex substitutionheuristic of Teitz and Bart (TB) [14], described inSection 4.2, and the Heuristic Concentrationapproach (HC) from Rosing and ReVelle [12],described in Section 4.3. Compared to the robustTB, our heuristic enjoys substantial speedup whilesacrificing little in terms of solution quality, makingit an ideal choice for our target applications thathave thousands of demand points. In Section 4.5,we describe a simulation study that evaluates ournew heuristic under a variety of input conditions.

TBr may also be easily extended to the direc-tional rectilinear p-median problem in 3 or moredimensions.

4.1. E!ect of distance characteristics oncomputational e!ort

Recall that the n · c distance matrix [dij] holds thedistances from demand points to candidate points (cis the number of candidate points). Di"erent dis-tance metrics produce distance matrices with di"er-ent characteristics that influence the performance ofa heuristic. Two such characteristics are symmetryand the ability to satisfy the triangle inequality[13]. The lack of symmetry has a minor impact onperformance, but failure to satisfy the triangleinequality is a much graver crime, making optimalor even good quality solutions hard to find. (Non-directional) rectilinear and Euclidean distancematrices both are symmetric and obey the triangleinequality. A randomly generated distance matrixin general will neither be symmetric nor obey the tri-angle inequality. As for our directional rectilineardistance metric, the outlook is positive as regardsthe more critical attribute: the distance matrix obeysthe triangle inequality but fails to be symmetric(recall that if ddr((xi,yi), (xj,yj)) is finite and >0, thenddr((xj,yj), (xi,yi)) is infinite).

ReVelle labels certain Discrete-PM2 problems asinteger friendly, meaning that ‘‘either integer termi-nation of linear programming formulations are fre-quent, or little branch and bound is needed toresolve the problem in integers’’ [10]. The conclu-sions of [13] are that the characteristic of obeyingthe triangle inequality has greatest impact on theinteger friendliness of an instance of Discrete-PM2. The question of why this is the case remainsopen.

4.2. Teitz and Bart vertex substitution heuristic forp-median

The Teitz and Bart [14] vertex substitution heu-ristic (TB) for Discrete-PM2 is well-known andmuch studied. A study comparing TB to exact meth-ods showed that TB rarely becomes trapped in localminima [11]. Although created for the non-direc-tional p-median problem, TB works similarly forthe directional problem.

TB begins with an initial solution of p supplypoints which are numbered arbitrarily from 1 to p.Assigning each demand point to its nearest supply

1102 L.E. Jackson et al. / European Journal of Operational Research 179 (2007) 1097–1108

Page 7: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

point, the heuristic evaluates the objective functionfor this solution. The heuristic next replaces the firstsupply point with the candidate point (not alreadyin the solution) that causes the greatest decrease inthe objective function. The heuristic then repeatsthis process with each of the remaining supplypoints in turn. At each step, the heuristic seeks thebest candidate to replace the supply point beingconsidered for removal, given that all other supplypoints in the solution are fixed. The first major iter-ation ends when the heuristic has tried removingeach of the p solution points, and the final solutionbecomes the initial solution for the second majoriteration. TB terminates when a major iterationresults in no changes to the solution, usually withinonly a few (65) iterations.

Each major iteration of TB runs in timeO(np(c $ p)), where c is the number of candidatepoints in an instance of DPM2. There are p existingsupply points and c $ p alternate candidate points,for a total of p(c $ p) pairs to be considered; foreach pair we need to examine each of the n demandpoints to find its closest supply point. Recall fromSection 2.2 that the c candidate points in DPM2include all n demand points as well as all directionalintersection points, i.e., c = (n2 + n)/2 possible can-didate points in the worst case. Therefore, theworst-case running time of each major iteration ofTB is O(n3p).

The performance of TB depends on the startingsolution. A common approach is to generate a num-ber of random starting solutions as input for multi-ple TB runs, and then to choose the best solutionfrom among the local optima that are found.

4.3. Heuristic concentration

Rosing and ReVelle present a two-stage meta-heuristic called Heuristic Concentration (HC) [12].Although they demonstrate how HC works byapplying it to Discrete-PM2, HC can be appliedto many di"erent combinatorial problems. HCattempts to glean information from the many localminima obtained from repeated runs of a heuristic.For example, the (local minima) solutions resultingfrom separate TB runs may have di"ering objectivefunction values, as well as di"erent supply points inthe solution set. HC takes advantage of the fact thatthere is frequently a great deal of overlap in thesolution sets corresponding to these local minima.First, HC builds a concentration set (CS) by takingthe union of the several local minima solutions. The

CS has a high likelihood of containing the supplypoints that make up the optimal solution set. Thesecond stage locates the best solution from amongthe members of the CS; if the size of the CS is su!-ciently small, an integer linear program can be usedto optimally select the best solution from the CS.

4.4. A new heuristic for DPM2

The motivation for designing a new algorithm forDPM2 is to find a very fast heuristic that does notsacrifice much in solution quality yet can tackle e!-ciently large instances of the problem where thenumber n of demand points is on the order of thou-sands or even hundreds of thousands. We refer toour new algorithm as the TB restricted (TBr) heuris-tic. TBr follows the two-stage approach of heuristicconcentration. In the first stage, TBr builds the con-centration set by running the one-dimensional algo-rithm for DPM1 (from Section 3.1) twice, once onthe x-values and once on the y-values of the ndemand points, to obtain the p best xs and the p bestys (when each dimension is considered independentlyof the other). Crossing these two sets yields p2 pointsthat form the CS. In the second stage, TBr ran-domly generates a number m of initial solutionsfrom among all possible candidate points. Each ini-tial solution serves as input into a separate run ofthe TB heuristic1, which only chooses points forexchange from the CS. The final TBr solution isthe best outcome from the m TB runs. Note thatthe final TBr solution may include a point that isnot in the CS: each initial solution is drawn fromall candidate points, and then TB looks only inthe CS for possible replacement points.

The first stage of TBr builds the CS in timeO"n

!!!!!!!!!!!!!p log n

p#, the time required to solve DPM1.

Each major iteration of TBr then runs in timeO(p(p2 $ p)n) or O(np3). In contrast, each majoriteration of TB runs in time O(p(c $ p)n) orO(n3p). Thus the overall complexity of TBr repre-sents a substantial improvement over TB, especiallyfor applications in which n ( p.

1 We have chosen to use TB at the second stage rather than theDensham and Rushton Global/Regional Interchange Algorithm(GRIA) [5]. On the traditional (non-directional) p-median prob-lem, GRIA improves the runtime of TB. However, GRIA is notappropriate for a directional p-median problem.

L.E. Jackson et al. / European Journal of Operational Research 179 (2007) 1097–1108 1103

Page 8: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

4.5. Evaluation of the TBr heuristic

Simulation set-up and input parameters. To inves-tigate the performance of TBr, we designed a simu-lation study using a variety of demand sets X. Togenerate points in the plane, we chose one discreteprobability density function (pdf) for the x-valuesand one for the y-values, from among the possiblepdf’s defined in Table 1: EquallyLikely (E), Bimodal(B), and Quadrimodal (Q). We selected these den-sity functions as representatives from the larger setof functions we considered in the comprehensiveexperimental study presented in [8].

An input combination is denoted by a two-lettercombination – EE, EB, BB, or QQ – in which thefirst (respectively, second) letter represents the pdfused for the x’s (respectively, y’s). Fig. 4 shows scat-

ter plots of demand sets of size n = 1000 generatedfrom the four input combinations. From each inputcombination, we generated fifty demand sets withn = 100 and another fifty with n = 200. Eachdemand set was generated starting from a uniqueseed for a Lehmer random number generator with

Table 1Probability density functions for input distributions

Distribution f(x) Domain

EquallyLikely 1/1000 [1,1000]

Bimodal 1/4000 [1,250], [351,650], [751,1000]16/4000 [251,350], [651,750]

Quadrimodal 5/24,000 [1,95], [106,145], [156,445],[456,595], [606,1000]

480/24,000 [96,105], [146,155],[446,455], [596,605]

0

200

400

600

800

1000

0 200 400 600 800 1000

y

x

0

200

400

600

800

1000

0 200 400 600 800 1000

y

x

0

200

400

600

800

1000

0 200 400 600 800 1000

y

x

0

200

400

600

800

1000

0 200 400 600 800 1000

y

x

Fig. 4. Scatter plots of n = 1000 for the four input distribution combinations.

1104 L.E. Jackson et al. / European Journal of Operational Research 179 (2007) 1097–1108

Page 9: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

modulus 231 $ 1 and multiplier 48,271. Eachdemand set then served as input to the TB andTBr heuristics. The TB result for each demand setis the best of 100 runs of the TB heuristic.

We define the normalized e!ectiveness as a mea-sure of the quality of a heuristic algorithm forDPM2:

normalized effectiveness

! 1% g"S#Pni!1xi %

Pni!1yi P 1

"4#

where g(S) is the objective function from expression(3) evaluated at the set S of supply points returnedby the algorithm. This definition is motivated by

1

1.05

1.1

1.15

1.2

1.25

1.3

1.35

1.4

5 10 15 20 25 30

Nor

mal

ized

Effe

ctiv

enes

s

p

n=200, EE input, TBr heuristicn=200, EE input, TB heuristic

n=100, EE input, TBr heuristicn=100, EE input, TB heuristic

Fig. 5. Normalized e"ectiveness vs. p, TB and TBr heuristics, instances of size n = 100 and n = 200, EE input.

1

1.05

1.1

1.15

1.2

1.25

1.3

5 10 15 20 25 30

Nor

mal

ized

Effe

ctiv

enes

s

p

n=200, EB input, TBr heuristicn=200, EB input, TB heuristic

n=100, EB input, TBr heuristicn=100, EB input, TB heuristic

Fig. 6. Normalized e"ectiveness vs. p, TB and TBr heuristics, instances of size n = 100 and n = 200, EB input.

L.E. Jackson et al. / European Journal of Operational Research 179 (2007) 1097–1108 1105

Page 10: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

the observation that if p = n, the set of supply pointsis the same as the set of demand points; in this case,the objective function g(S) = 0, and the normalizede"ectiveness is equal to 1. Whenever p < n, we haveg(S) > 0 (assuming that the n demand points are dis-tinct), and the normalized e"ectiveness is greater

than 1. Therefore, one is a legitimate lower boundon the normalized e"ectiveness. Since we cannotcompute the optimal value, we can characterizethe relative quality of the solutions produced bytwo di"erent heuristics by observing which of thenormalized e"ectiveness values is closer to one. In

1

1.05

1.1

1.15

1.2

5 10 15 20 25 30

Nor

mal

ized

Effe

ctiv

enes

s

p

n=200, BB input, TBr heuristicn=200, BB input, TB heuristic

n=100, BB input, TBr heuristicn=100, BB input, TB heuristic

Fig. 7. Normalized e"ectiveness vs. p, TB and TBr heuristics, instances of size n = 100 and n = 200, BB input.

1

1.05

1.1

1.15

1.2

1.25

1.3

1.35

5 10 15 20 25 30

Nor

mal

ized

Effe

ctiv

enes

s

p

n=200, QQ input, TBr heuristicn=200, QQ input, TB heuristic

n=100, QQ input, TBr heuristicn=100, QQ input, TB heuristic

Fig. 8. Normalized e"ectiveness vs. p, TB and TBr heuristics, instances of size n = 100 and n = 200, QQ input.

1106 L.E. Jackson et al. / European Journal of Operational Research 179 (2007) 1097–1108

Page 11: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

other words, a better algorithm produces solutionswith a lower value of the normalized e"ectiveness.We also note that the normalization allows us tocompare results among problem instances with verydi"erent sets of demand points. For problem in-stances sets of size n = 100, we calculated the nor-malized e"ectiveness for p = 5,10,15,20,25,30.For problem instances of size n = 200, we calculatedthe normalized e"ectiveness for p = 5,10,15,20,25.In addition, we calculated the normalized e"ective-ness for p = 30 for QQ instances of size n = 200.

Simulation results. The four graphs in Figs. 5–8correspond to the four input combinations, EE,EB, BB, and QQ. For a given input, the graphshows the normalized e"ectiveness plotted againstp for both the TB and the TBr heuristics, for prob-lem instances of size n = 100 and n = 200. Eachpoint is the mean of 50 problem instances, witherror bars designating a 95% confidence interval.We note that, for each input, the n = 200 curve liesabove the n = 100 curve. Holding p fixed, it is rea-sonable to expect a higher normalized e"ectivenessvalue for a demand set of size n = 200 as comparedto n = 100. We also note that the TBr curve liesslightly above the TB curve, illustrating the qualityof the TBr solution. We pay little penalty in solutionquality for using TBr instead of TB, yet we realizegreat gains in speed. Finally, we note that the rela-tive performance of the two heuristics is not a"ected

significantly as the number p of supply pointsincreases; in other words, the solutions returnedby TBr are close to those returned by TB acrossthe range of p values we considered in theseexperiments.

From the figures we observe that, for all values ofp, the curves for input EE are the highest, followedby EB, BB, and QQ. We can attribute this result tothe nature of the input. Namely, in the sample scat-ter plots for each input shown in Fig. 4, the level of‘‘order’’ increases as we move from EE to EB to BBto QQ. (Or, said another way, the level of random-ness decreases as we move from EE to EB to BB toQQ.) The EE input appears to be the worst case sce-nario, with points scattered evenly over the plane. Incontrast, the other inputs possess natural clusterswhere points fall with higher density: EB has twohorizontal strips, BB has four squares, and QQhas 16 squares. The more natural clustering thatexists in the input, the easier it is for an algorithmto select appropriate supply points.

Finally, in Fig. 9 we present results of the TBrheuristic on instances of size n = 1000. Since thenumber of candidate points is O(n2/2), then movingfrom an instance of size n = 100 to one withn = 1000 represents a 100-fold increase in problemsize. Due to the high complexity of the TB heuristic,we were not able to obtain results for n > 200 withina reasonable amount of time, (e.g., a few hours).

1

1.05

1.1

1.15

1.2

1.25

1.3

10 15 20 25 30 35 40 45 50

Nor

mal

ized

Effe

ctiv

enes

s

p

n=1000, EE input, TBr heuristicn=1000, EB input, TBr heuristicn=1000, BB input, TBr heuristicn=1000, QQ input, TBr heuristic

Fig. 9. Normalized e"ectiveness vs. p, TBr heuristic, instances of size n = 1000.

L.E. Jackson et al. / European Journal of Operational Research 179 (2007) 1097–1108 1107

Page 12: The directional p-median problem: DeÞnition, complexity ... · The directional p-median problem: DeÞnition, complexity, and algorithm s Laura E. Jackson *, George N. Rouskas, Matthias

Each point in the graphs is the mean of 25 probleminstances, and for each instance, TBr takes the bestsolution of 10 runs; error bars designate a 95% con-fidence interval. We observe that the curves corre-sponding to the four input combinations (EE, ED,BB, and QQ) exhibit the same relative behaviorwe described above. We also note that the curvefor a particular input combination lies just abovethe corresponding curve for n = 200 in Figs. 5–8,indicating that the incremental penalty as the prob-lem size increases is relatively small.

5. Concluding remarks

We have explored the p-median problem under anew distance measure: the rectilinear l-directional,k-dimensional p-median problem forces a supplypoint to achieve or exceed the values of the first lcoordinates of its assigned demand points. We haveshown that the one-dimensional directional p-med-ian problem can be solved in time O"n

!!!!!!!!!!!!!p log n

p#

through a constrained shortest path reformulation.For the NP-complete 2-dimensional problem, wepresented a new heuristic that builds upon the Teitzand Bart (TB) heuristic and the Heuristic Concen-tration metaheuristic from Rosing and ReVelle.Our heuristic is a faster alternative for applicationswith very large demand sets. Although TB consis-tently returns solutions of slightly better quality,our heuristic tracks TB’s performance closely andenjoys a significant speedup, running in timeO(np3) as compared to TB’s time of O(n3p).

References

[1] A. Aggarwal, B. Schieber, T. Tokuyama, Finding a mini-mum weight k-link path in graphs with Monge property andapplications, Discrete Computational Geometry 12 (1994)263–280.

[2] J.H. Anderson, A. Srinivasan, Mixed Pfair/ERfair schedul-ing of asynchronous periodic tasks, Journal of Computerand System Sciences 68 (1) (2004) 157–204.

[3] S.K. Baruah, N.K. Cohen, C.G. Plaxton, D.A. Varvel,Proportionate fairness: a notion of fairness in resourceallocation, Algorithmica 15 (6) (1996) 600–625.

[4] M. Daskin, Network and Discrete Location: Models, Algo-rithms, and Applications, John Wiley and Sons, New York,1995.

[5] P.J. Densham, G. Rushton, A more e!cient heuristic forsolving large p-median problems, Papers in Regional Sci-ence: The Journal of the RSAI 71 (3) (1992) 307–329.

[6] R. Hassin, A. Tamir, Improved complexity bounds forlocation problems on the real line, Operations ResearchLetters 10 (1991) 395–402.

[7] L. Jackson, G.N. Rouskas, Optimal quantization of periodictask requests on multiple identical processors, IEEE Trans-actions on Parallel and Distributed Systems 14 (7) (2003)795–806.

[8] Laura E. Jackson, The Directional p-Median problem withapplications to tra!c quantization and multiprocessorscheduling. PhD thesis, North Carolina State University,Raleigh, NC, December 2003.

[9] N. Megiddo, K.J. Supowit, On the complexity of somecommon geometric location problems, SIAM Journal onComputing 13 (1) (1984) 182–196.

[10] C.S. ReVelle, Facility siting and integer-friendly program-ming, European Journal of Operational Research 65 (2)(1993) 47–158.

[11] K.E. Rosing, E.L. Hillsman, H. Rosing-Vogelaar, A notecomparing optimal and heuristic solutions to the p-medianproblem, Geographical Analysis 11 (1979) 86–89.

[12] K.E. Rosing, C.S. ReVelle, Heuristic concentration: Twostage solution construction, European Journal of Opera-tional Research 97 (1) (1997) 75–86.

[13] D.A. Schilling, K.E. Rosing, C.S. ReVelle, Network distancecharacteristics that a"ect computational e"ort in p-medianlocation problems, European Journal of OperationalResearch 127 (3) (2000) 525–536.

[14] M.B. Teitz, P. Bart, Heuristic methods for estimating thegeneralized vertex median of a weighted graph, OperationsResearch 16 (1968) 955–961.

[15] H.C. Joksch, The shortest route problem with constraints,Journal of Mathematical Analysis and Applications 14(1966) 191–197.

1108 L.E. Jackson et al. / European Journal of Operational Research 179 (2007) 1097–1108