The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.

An approximation algorithm for the continuous k-medians problem in a convex polygon John Gunnar Carlsson, anF Jia, and Ying Li ebruaryF 3, 2012 Abstract

Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by , 2017-05-19 04:10:03

An approximation algorithm for the continuous -medians ...

An approximation algorithm for the continuous k-medians problem in a convex polygon John Gunnar Carlsson, anF Jia, and Ying Li ebruaryF 3, 2012 Abstract

kAn approximation algorithm for the continuous -medians problem in a

convex polygon

John Gunnar Carlsson, Fan Jia, and Ying Li
February 3, 2012

Abstract

We give a fast and simple factor 2.74 approximation algorithm for the problem of choosing the k medians of the

continuum of demand points dened by a convex polygon C. Our algorithm rst surrounds the input region with a

bounding box, then subdivides the bounding box into subregions with equal area. Simulation results on the convex

hulls of the 50 states in the USA show that the practical performance of our algorithm is within 10% of the optimal

solution in the vast majority of cases.

1 Introduction

The k-medians problem, also called the multi-source Weber problem [3], is a well-studied geometry problem where the

objective is to select a set of k landmark points so as to minimize the total distance between the landmark points and

some other set of client points. The most natural setting for this problem is to let the clients be a discrete set of points

in a the plane, which was proved to be NP-hard in [8]. The papers [2] and [7] both describe PTASes for this case. In a

general metric space, [4] describes a factor 6 2 approximation algorithm.
3

Another setting is the case where client points form a continuum. This is a natural problem in facility location; in many

such scenarios the number of clients is large (say over 1000), which makes the corresponding discrete k-medians problem

intractable. Moreover, it may be more sensible, from the standpoint of modelling, to think of clients as being continuously

distributed. The rst exact algorithmic study for this problem was performed in [5], which describes polynomial-time

algorithms for various versions of the 1-median (Fermat-Weber) problem under the L1 norm. The authors also consider

the multiple-center version of the L1 k-median problem, which they prove is NP-hard for large k. It is also possible to

obtain a PTAS to this problem by discretizing the region in question into grid cells and then applying one of the previously

mentioned PTASes; however, the running time of such a discretization depends on the fatness of the input shape, because

a long and skinny input region will require more grid cells to obtain a suciently rened grid approximation. In addition,

as of this writing, we are unaware of any implementations of the PTASes for the discrete case of our problem, likely due

to their fairly sophisticated nature (and possibly poor practical running time).

In this paper, we give a very simple constant-factor approximation algorithm for the continuous k-medians problem
in a convex polygon C with n vertices under the L2 norm. A worst-case theoretical analysis shows that our algorithm
always produces solutions within a factor of 2.74 of optimality. In addition, simulation results applied to the convex hulls
of the 50 states of the USA show that our algorithm generally performs within 10% of optimality in practice.

Preliminaries The notational conventions of this paper are as follows: we dene

¨

FW (C) = min x − p dA
p C¨

FW (C, k) = min min x − pi dA
P :|P |=k C i

to be the Fermat-Weber objective functions that we seek to minimize, where · denotes the Euclidean norm. Let C

denote the minimum-area bounding box of C (which can be computed in linear running time [10]), and let width (C) and

height (C) denote the dimensions of C. Let AR (C) denote the aspect ratio of C, max width(C ) , height(C ) .
height(C) width(C )

1

(a) (b) (c)

(d) (e)

Figure 1: The input and output of Algorithm 2. We begin in (1a) with a convex polygon C , whose minimum-area bounding
rectangle C is computed in (1b). The bounding box is then partitioned into equal-area pieces in (1c) using Algorithm

1. Some of the centers of these pieces are then relocated in (1d), and (1e) shows the output and Voronoi partition.

2 The algorithm

The input to our algorithm is a convex polygon C with n vertices and an integer k. We assume without loss of generality

that C is aligned so that the long side of C is aligned with the coordinate x-axis. Note that by construction, it must
be the case that Area( C)/2 ≤ Area(C) ≤ Area( C). Then, we let k1 = k/2 and k2 = k/2 and divide C into two
· Area ( C) = · Area ( C) =
pieces of areas k1 k1 · wh and k2 k2 · wh respectively, using a vertical line. This is performed
k k k k

recursively (with the option to split using a horizontal line, if the height of an intermediate rectangle exceeds its width)

until all regions have area Area ( C ) /k. This is given in Algorithms 1 and 2 and Figure 1.

The following lemma is a simplied restatement of a result from [1]:

Lemma 1. Suppose that R˜ ⊆ C is an intermediate rectangle obtained throughout Algorithm 1, which is further subdivided

into R˜ and R˜ . Then:

1. If AR(R˜) > 3, then AR(R˜ ), AR(R˜ ) ≤ AR(R˜) .

2. If AR(R˜) ≤ 3, then AR(R˜ ), AR(R˜ ) ≤ 3 .

Pheriogohft.(RC˜)la, ismo 1thiasttrhieviigahl.t(TR˜o )pr=ovheeicglahitm(R˜2).wSeianscseuRm˜ eisthalawt aAysRd(Ri˜v)id≤ed3.inAtosspurmopeowrtitiohnosutaslocslsoosef generality that width(R˜) ≥
as 1/2 as possible, we have

width(R˜)/3 ≤ width(R˜ ) ≤ 2 width(R˜)/3

and, dividing by height(R˜), we nd that

width(R˜)/(3 height(R˜)) ≤ width(R˜ )/ height(R˜ ) = width(R˜ )/ height(R˜) ≤ 2 width(R˜)/(3 height(R˜)) ≤ 2

ssointcheawt iwdtidht(hR˜()R˜≥)/hehiegihgth(tR(˜R)˜, )≤ 2. Taking the reciprocal of this expression and observing that 3 ≥ 3 height(R˜)/ width(R˜)

we have

3 ≥ 3 height(R˜)/ width(R˜) ≥ height(R˜ )/ width(R˜ ) = height(R˜)/ width(R˜ ) ≥ 3 height(R˜)/(2 width(R˜))

so that 3 ≥ height(R˜ )/ width(R˜ ). This same argument clearly applies to R˜ as well, which completes claim 2.

2

Input: An axis-aligned rectangle R and an integer k.
Output: A partition of R into k rectangles, each having area Area (R) /k.
if k = 1 then
return R;
else
Set k1 = k/2 and k2 = k/2 ;

Let w denote the width of R and h the height;
if w ≥ h then
· Area (R) on the
With a vertical line, divide R into two pieces R1 and R2 with area k1 right and
k
k2 · Area (R)
k on the left;

else · Area (R)

With a horizontal line, divide R into two pieces R1 and R2 with area k1 on the top and
k
k2 · Area (R)
k on the bottom;

end
return RectanglePartition (R1, k1) ∪ RectanglePartition (R2, k2);

end

Algorithm 1: Algorithm RectanglePartition (R, k) takes as input an axis-aligned rectangle R and a positive integer

k.

Input: A convex polygon C and an integer k.
Output: The locations of k points pi in C that approximately minimize FW (C, k) within a factor of 2.74.

Let C denote a minimal-area bounding box of C ;

Rotate C so that C is aligned with the coordinate axes;
Let R1, . . . , Rk = RectanglePartition ( C, k);

for i ∈ {1, . . . , k} do

Let ci denote the center of Ri;
if then
ci ∈ C
pi = ci;
Set

else
if Ri ∩ C is nonempty then

Let Ri be the minimum axis-aligned bounding box of Ri ∩ C and let ci denote its center;
Set pi = ci;

else

Place pi anywhere in C ;

end

end

end
return p1, . . . , pk;

Algorithm 2: Algorithm ApproxFW (R, k) takes as input a convex polygon C and an integer k.

3

Figure 2: The optimal regions C ∗ in a given box B, for increasing values of A.

3 Upper and lower bounds

In this section we establish some upper and lower bounds for the Fermat-Weber value of any convex region C . We begin

with some simple lemmas:

Lemma 2. For a disk D with radius r, FW (D) = 2πr3 .
3
Proof. Trivial.

Remark .3 It is well-known that, for a xed area, the disk is the region with minimal Fermat-Weber value FW (C ). This

gives us an easy lower bound: 2
3√π
FW (C) ≥ A3/2

where A is the area of C .

Denition 4. A region C is said to be star convex at the point p if the line segment from p to any point x ∈ C is itself

star convex hullcontained in C. Similarly, the of a region S at the point p is the smallest star-convex region at the point

p that contains S (i.e. the union of all segments between points x ∈ S and p).

Lemma 5. Let B be a box of dimensions w × h centered at the origin. The region C∗ that solves the innite-dimensional

optimization problem

maximize FW (C) s.t. (1)

C

C ⊆B

Area (C) = A

C (0, 0)

C is star convex at (0, 0)

is the star convex hull of B\D, where D is an appropriately chosen disk centered at the origin, as indicated in Figure 2.
Furthermore for xed w and h, the function Φ (A) = FW (C∗) (i.e. the maximal value of (1)) is monotonically increasing
and concave.

Proof sketch. This follows from a standard argument where we consider the integer (or linear) program obtained by

discretizing problem (1) using polar coordinates. See Figure 3. Concavity of Φ (A) follows by observing that we build our

optimal solution by adding sectors containing points that are strictly closer than the points in the sector that preceded
them.

Denition 6. Let x = (x, y) be a point in the plane. We dene the and norms by

x = max {|x| , |y|} + √2 − 1 min {|x| , |y|}

x = max |x| , |y| , √12 (|x| + |y|) .

4

Figure 3: In the discretization above, our variables are set up in such a way that the star convexity constraint is equivalent

to setting zi(j+1) ≤ zij for all j. By the nature of the constraints it is clear that we may assume that zi∗(j+1) = zi∗j at
optimality since the distance from cell ij to the origin increases with j. The diagram above suggests a linear programming

formulation, where the lighter regions indicate fractional solutions.

Remark .7 The following identities are easy to verify:

x ≤ x2 ≤ x
ψx
≤ x2 ≤ x
x
1
≤ x2 ≤ ψ x

where ψ = cos (π/8) ≈ 0.9239. Both norms have a natural interpretation: x is the distance from (0, 0) to x if we

are only permitted to move horizontally, vertically, or diagonally (the cardinal and ordinal directions) and x is the

maximum distance from (0, 0) to x in the horizontal, vertical, or diagonal direction.

Lemma 8. Let C be a convex region, contained in a box B of dimensions w × h, that contains the center (0, 0) of B. If

A = Area (C), then we have

 √√ √ w2 −h2 (wh − A) + √
 2−1 2−1 wh2 3 1 w2 1 h3 h
 3 Ah − 12 − √ 3 h − 12 if A ≤ wh√− 2 w2 − h2
√ if − h2 < A
FW (C )  32√Aw + 2−1 Ah 1 A2 1 w2h 2−1 wh2 h wh − h2/2
≤  3 − 3 · h√ − 12 − 12 √ wh − 2 w2 ≤ .
√ 7−3 2
+ + 7−4 2 w2h + √ 2−1 A2 otherwise
2 2−2 1 12 2− 2 h3 3 h 12 wh2
3 Aw 3 Ah 12 − · −

Proof. We consider the relaxation of the innite-dimensional optimization problem

maximize FW (C) s.t.

C

C ⊆B

Area (C) = A

C (0, 0)

C is convex ,

5

wh − h √ w2 − h2.
2
Figure 4: The area of the shaded region is

obtained by replacing the convexity constraint with star convexity about the origin. The problem is now equivalent to

problem (1).

h √Following lemma 5 we see that the optimal star-convex region C ∗ takes the form shown in Figure 2. If A ≥ wh −
2 w2 − h2, then the optimal solution consists of two components (rather than 4) as shown in Figure 4.
We evaluate the

Fermat-Weber objective value under the norm and we nd that

4 ´ h/2 ´ w/2 x+ √2 − 1 y dx dy wh − h √ w2 − h2 ≤ A ≤ wh − h2
4 ´0h/2 ´yy/m √2 −1 x + y dx 2
FW (C∗) = ´ w/2 √2 − 1 if
0 y/m
+ y x + y dx dy if A > wh − h2

where m= h2 ; the formulas are thus found by analytic integration. We nd the upper bound for the √case A ≤
√ 2(wh−A) taking a w2 − h2
) is concave in A, then
wh − h w2 − h2 simply by using the fact that FW (C∗ tangent line at A = wh− h
2 2

and extrapolating.

For the remainder of this paper we dene ρ = 4.34818 and γ = 0.11719.

Lemma 9. Let C be a convex region with area A, contained in a box B of dimensions w ×h, where w/h ≥ ρ. If A ≥ wh/2,

then  (γ163+/13224+√(2√√)2γ+2(γ/1−)621−)+1√/21h23 8+6√2−(28+20√2)γ √ (2√2−2)γ+1
 24(√2+1)2
FW (C ) ≥ + Ah + 2146(+√121+12)2 A2/h if A≤ √ h2 .
 2−1

h3 − (γ/2) Ah + (1/4) A2/h otherwise

Proof. Refer to Figure 5 for this proof. The shape C∗ that minimizes FW (C) in B is the intersection of a disk with a slab

of height h. Let R1 denote the largest rectangle contained in C ∗ and let R2 denote the smallest rectangle containing C ∗.
Clearly, for xed h, the two rectangles become the same as Area (C∗) increases. In particular, if Area (C∗) ≥ wh/2 ≥ ρh2/2,
then we can verify numerically that the gap g between the two (as indicated in Figure 5b) is at most γh. Therefore, the
hexagon with vertices (±A/2h, 0) and (± (A/2h − γh) , ±h/2) is contained entirely in C∗ whenever Area (C∗) ≥ ρh2/2.

To obtain the desired result, we bound the Fermat-Weber value on this hexagon under the norm:

 ´ h/2 ´ y/m1 y dx + √1 ´ y/m2 x + y dx + ´ −2γy+A/2h x dx dy A ≤ (2√2−2)γ +1 h2
4 ´0y/m1 y dx + 2 ´yy//mm13 x + y dx + ´y−/2mγ2y+A/2h x dx dy
FW (C ∗ ) ≥ ´0h/2 if √
0 √1 y/m1 y/m3 2−1
0 2
4 otherwise

where m1 = √2 + 1, m2 = h2 h2 , and m3 = √2 − 1, which gives the desired bounds.
A−2γ

In summary, we have the following upper and lower bounds for FW (C ) when C is a convex region of area A contained
in a box of dimensions w × h:

6

(a)
(b)

(c)

Figure 5: The region C ∗ of minimal Fermat-Weber objective value, the rectangles R1 and R2, and the hexagon that gives

our lower bound.

 √√ 2−1 √ w2 −h2 (wh − A) + √
2−1 12 wh2 3 1 w2 1 h3 h
 3 Ah − − √ 3 h − 12 if√A ≤ wh − 2 w2 − h2
 √ Ah
FW (C) 23√Aw + A2 h2/2
≤ 2−1 − 1 · h√ − 1 w2 h − 2−1 wh2 if wh − h w2 − h2 < A ≤ wh − (2)
3 3 12 12 √ 2
√ √ A2
 2 2−2 + 1 + 7−4 2 w2h + 2− 2 h3 2−1 h 7−3 2 wh2 otherwise
 3 Aw 3 Ah 12 12 − 3 · − 12

FW (C) ≥ 3√2 π A3/2 (3)

 (γ163+/13224+√(2√√)2γ+2(γ/1−)621−)+1√/21h23 + 8+6√2−(28+20√2)γ Ah + √ A2/h A ≤ (2√2−2)γ +1 h2
 24(√2+1)2
FW (C) ≥ 2146(+√121+12)2 if √ if w/h ≥ ρ .(4)
 2−1

h3 − (γ/2) Ah + (1/4) A2/h otherwise

Notice that both of our lower bounds are convex in A.

4 Proof of approximation

In this section, we show that Algorithm 2 has a constant-factor approximation. After performing our algorithm, we have

a collection of k rectangles with area wh/k; if k ≥ w/ρh, then these rectangles have an aspect ratio not exceeding ρ. If
k < w/ρh, then all rectangles are identical and have dimensions (w/k) × h. Since our lower bounds are convex in A and
the function Φ (A) is concave, we immediately know that the worst possible ratio between the upper and lower bounds
for FW (C, k) is attained when all rectangles contain area A/k of C . Therefore, to nd the approximation bounds for this
algorithm, it will suce to consider a single such rectangle with height 1 and width z ≥ 1, containing area α = A/k of
C . The approximation bounds are determined by the value of A and the relationship between k and w/ρh. Our general

approach is to reduce the approximation ratio to a function of a single variable, whose upper bound can be easily be
veried using standard methods from calculus. We omit these steps for brevity.

7

4.1 The case k ≤ w/ρh

If k ≤ w/ρh, then our algorithm will divide C into k identical rectangles of dimensions (w/k) × h. Thus we set
zha=vew(/2k√√2≥−2−2ρ)1γa+n1dh2as<suwmhe h = 1. We will use lower bound (4). Note that we may either
without l−oshs2oof rge(n2√er√2a−2l−i2t)1yγ that
√ √
− h w2 +1 h2 ≥ wh − h w2 − h2, depending on the dimensions of C, and
2 2

therefore we have to consider these cases separately. In total, there are ve cases that we have to consider:

A ≤ wh − h √ w2 − h2 and A ≤ (2√2−2)γ+1 h2.
2
1. √
2−1

(2√2−2)γ +1 h2 < A ≤ wh − h √ w2 − h2.
2
2. √
2−1

wh − h √ w2 − h2 < A ≤ (2√2−2)γ+1 h2.
2
3. √
2−1

A > wh − h √ w2 − h2, A> (2√2−2)γ+1 h2, A ≤ wh − h2/2.
2
4. √ and
2−1

5. A > wh − h2/2.

We consider each case separately below.

Case 1 α≤z− 1 √ z2 − 1 α≤ (2√2−2)γ+1
2
By assumption we have and √ and the approximation ratio is given by
2−1

√ √√
(16+1224√(2√2)3−2γ+1(γ1α−)2−1)+√1222−+1 z 8−+6√2z2432−(−√(1228(++z12−)02√α2))γ+α 1 2 1
3 z − 12
.
+ √
2146(+√121+12)2
α2

We notice that the denominator is quadratic in α and the numerator is linear in α, wane dhaitveisαth≤ere(2fo√r√2e−2−n2)o1γt+h1a, ridt to show
must be
that the ratio is maximized when α is as small as possible, i.e. that α = z/2. Since

the case that z ≤ (4√2−4)γ+2 < 5.30. The approximation ratio is therefore


2−1

√√√
2−1 +122−81+z6−√428−(√z(62228−++112z)02√+2)31γzz2 1
(16+12√2)γ 6 z − − 12
+
√ √
(γ−1)+ 2
24(√2+1)2 9166(+√121+12)2 z2

which is bounded above by 2.74 for z ∈ [ρ, 5.30].

Case 2 (2√2−2)γ+1 < α ≤ z − 1 √ z2 − 1
2
By assumption we have √ and the approximation ratio is given by
2−1

√ √√ z 2 −1 (z − α) +
γ23−3/13α+−√212/2−61−z 3 (γ /2) α + 1 z2 1
− 3 − 12 .

1/12 − (1/4) α2

We again observe that the denominator is quadratic in α and the numerator is linear in α, and it is therefore not hard to
(2√2−2)γ+1
show that the ratio is maximized when α is as small as possible, i.e. that α = max , z/2 . The approximation

2−1

ratio is given by

√ 2−1 max (2√2−2)γ+1 /2 √√ z 2 −1 z − max (2√2−2)γ+1 z/2 +
3 2−1 3 1 2 1
√ , z − 12 z − √ , 3 z − 12
2−1 2−1

γ3/3 + √2/6 − 1/12 − (γ/2) max (2√2−2)γ+1 (2√2−2)γ+1 2

√ , z /2 + (1/4) max √ , z/2
2−1 2−1

which is bounded above by 2.74 for z ≥ ρ.

8

Case 3 By assumption we have z− 1 √ − 1 < α ≤ (2√2−2)γ+1 and the approximation ratio is given by
2 z2

2−1

√√
(16+1224√(2√)2γ23+(γα1−)z21+)+√223−+1 α8+−6√312α−2(2−8+12120z√22)−γ 2−1
24(√2+1)2 12 z .


+ 2146(+√121+12)2
α α2

We notice that the numerator is increasing in z, a(n2√d2t−h2e)rγe+f1ore we assume that z is as large as possible so that α =
√ √ −1 < that z < 5.2002. The approximation
z− 1 z2 − 1. z − 1 z2 √
2 Furthermore, since 2 2−1 , it must be the case

ratio is given by

(1632+12z√−2)γ21(√γ−z12)−+√12 +8+√6√23−2−1 (2z8+−2021√√2)zγ2 1 1 1 √ 1 2 1 z2 √ 2−1
24(√2+1)2 24(√2+1)2 − 3 2 z2 12 12
z − − z − − − − z
+ z
1 √ − 1 √ z − 1 √ z2 − 1 2
2 z2 2
+ 2146(+√121+12)2

which is bounded above by 2.74 for z ∈ [ρ, 5.2002].

Case 4 α > z− 1 √ − 1, α > (2√2−2)γ+1 α ≤ z − 1/2
By assumption we have 2 z2 √ , and and the approximation ratio is
given by 2−1

√√
γ332/α3 z++√2/23−6 1−α1−/1312α2−−(γ11/22z)2α−+ 2−1
12 z .

(1/4) α2

We notice that√the numerator is increasing in z in this domain, and therefore we assume that z is as large as possible so
− 1. The approximation ratio is therefore
that α = z − 1 z2
2

2 1 √ −1 z + √ 1 √ 1− 1 1 √ 1 2 −12 √11z22z2−−1 √ 2−1
3 2 √2/6 − 2−1 2 √ 3 2 z2 12
z − z2 3 z − z2 − z − − z
− 1
γ3/3 + 1/12 − (γ/2) z 1 z2 − + (1/4) z − 2
2

which is bounded above by 2.74 for z ≥ ρ.

Case 5 By assumption we have α > z − 1/2 and the approximation ratio is given by

√ αz + √ √√ √
2 2−2 γ3/3 13+α√+2/76−14−2 2z2 + 2− 2 2−1 α2 7−3 2z
3 1/12 12 − 3 − 12
.
− (γ/2) α + (1/4) α2

We notice that the numerator is increasing in z, and therefore we assume that z is as large as possible so that α = z − 1/2.

The approximation ratio is therefore

√ √ √√ (z 1/2)2 √
2 2−2 (z 1/2) z++√132/(z6 1/2) + 7−4 2 z2 + 2− 2 2−1 (z 1/2)2 7−3 2z
3 − γ3/3 − 12 12 − 3 − − 12
− + −
1/12 − (γ/2) (z − 1/2) (1/4)

which is bounded above by 1.4 for z ≥ ρ.

4.2 The case k > w/ρh

If k > w/ρh, then our algorithm will divide C into k rectangles with aspect ratio at most ρ. Thus we assume that we
have k rectangles with height 1 and width z ∈ [1, ρ]. We will use lower bound (3). In total, there are three cases that we

have to consider:

A ≤ wh − h √ w2 − h2.
2
6.

wh − h √ w2 − h2 < A ≤ wh − h2/2.
2
7.

8. A > wh − h2/2.

9

Case 6 α ≤ z − 1 √ z2 − 1
2
By assumption we have and the approximation ratio is given by

√ √√ z 2 −1 (z − α) +
2−1 2−1 3 1 z2 1
3 α − 12 z − 3 − 12 .

√2 α3/2


It is not hard to verify that the above ratio is decreasing in α, and therefore we assume that α is as small as possible, i.e.
that α = z/2. The approximation ratio is therefore

√√√ z 2 −1 +
2−1 2−1 6 1 z2 1
6 z − 12 z − z 3 − 12

√2 (z/2)3/2


which is bounded above by 2.74 for z ∈ [1, ρ].

Case 7 By z − 1 √ z2 −1 < α ≤ z − 1/2
2
assumption we have and the approximation ratio is given by

+ √√ 2−1
2 2−1 1 α2 1 2 12
3 αz 3 α − 3 − 12 z − z
.
√2 α3/2


We notice that the numerator is increasing in z in this domain and therefore we assume that α = z − 1 √ − 1. The
2 z2

approximation ratio is therefore

2 1 √ 1 z+ √ 2−1 1 √ −21 √1z2−−311 1 √ 1 2− 1 z2 √2−1
3 2 3 2 z2 2 z2 12 12
z − z2 − z − z− − − z
z−
√2 3/2


which is bounded above by 2.71 for z ∈ [1, ρ].

Case 8 By assumption we have α > z − 1/2 and the approximation ratio is given by

√ √ √√ √
2 2−2 + 1 + 7−4 2 z2 + 2− 2 2−1 α2 7−3 2z
3 αz 3 α 12 12 − 3 − 12
.
√2 α3/2


We notice that the numerator is increasing in z, and therefore we assume that z is as large as possible so that α = z − 1/2.

The approximation ratio is therefore

√ + √ √√ (z 1/2)2 √
2 2−2 (z − 1/2) z 1 (z − 1/2) + 7−4 2 z2 + 2− 2 2−1 7−3 2z
3 3 12 12 − 3 − − 12

√2 (z − 1/2)3/2


which is bounded above by 1.8 for z ∈ [1, ρ].

4.3 Running time

This algorithm can be performed with running time O (n + k + k log n). This is because Algorithm 1 takes O (k) operations
to partition the rectangle and Algorithm 2 requires O (n) operations to nd a minimum bounding box of C . The last
step of Algorithm 2 consists of moving the center points to C when necessary, which takes O (k log n) operations using a

point-in-polygon algorithm [9].

5 Simulation results

In order to determine the practical performance of our algorithm (as opposed to the theoretical worst-case bounds),

we applied it to a dataset generated by forming the convex hulls of the 50 states of the USA. In order to improve the

practical performance of Algorithm 2, we introduce one small modication, which we describe below; we have avoided
putting this modication in the description of Algorithm 2 because it is not clear how to incorporate it into the theoretical
upper-bounding procedure.

10

Modication to Algorithm 2 In executing Algorithm 1 as a subroutine in Algorithm 2, it may be the case that a

Ri lies entirely outside C. If rtehcitsanisglteheR˜claisees, we add Ri to a list OUT. It may also bR˜e the case
(not necessarily entirely this case, rectangle to a list
nal) in we add
nal

intermediate insidethat
rectangle rectangle
an
C;

IN. We do not add any intermediate rectangles to IN if they are themselves contained in a larger intermediate rectangle

partiallythat is already contained in IN. Finally, it may be the case that a nal rectangle Ri is contained by C ; in this

case we also add Ri to list IN. See Figure 6a.

After executing Algorithm 1 as a subroutine in Algorithm 2, we now have the lists OUT and IN. The centers of the

rectangles of list OUT are clearly not helping us, and we now want to nd a reasonable way to move them into C . Let the
R˜j , let A˜j denote the area of R˜j ,
jth rectangle of list IN (which may be an intermediate rectangle) be written as and let
Nj denote the number is a nal rectangle). We then let
of points that would be assigned to R˜j (which is 1 if R˜j

N˜j := k · A˜j

|IN| A˜q
q=1

and we then place N˜j points in each rectangle R˜j . This does not aect our approximation result because N˜j ≥ Nj and
arbitrarily among the
j N˜j ≤ k. The remaining points are distributed rectangles in IN. See Figure 6b.

Results and discussion Figure 7 shows the approximation ratios for k ≤ 1000 when our algorithm is applied to the

convex hulls of the 50 states of the USA. As in the proof of the worst-case approximation ratio, we use lower bounds (3)

and (4). However, instead of using the theoretical upper bound (2), we simply evaluate the actual objective function value

¨
min x − pi dA

Ci

by rst taking a Voronoi diagram of the points pi and then integrating the distance function x − pi over each Voronoi
cell using the collapsed-square Gaussian cubature method [6] with tolerance 10−5. As an example, Figure 8 shows the
output of our algorithm for k = 100 applied to the convex hull of the state of Minnesota. The running times of our trials

are basically trivial as explained in Section 4.3 and we have therefore omitted them.

We rst observe that in nearly all of the cases (the exceptions being very low values of k), our algorithm gives a solution
that is within 10% of the theoretical lower bound; this suggests both that our algorithm generally performs well and that

lower bounds (3) and (4) are fairly tight. This also suggests that the upper bound (2) is the weak point of our worst-case

performance bounds. It is also interesting that the approximation ratios in Figure 7 seem to exhibit some periodicity;

we suspect that this is somehow related to the fact that our algorithm depends on partitioning a rectangle and therefore

some pattern persists among the various instances of C . The individual approximation ratios for each of the 50 states are

shown in the Appendix.

6 Conclusions

We have presented a fast and simple approximation algorithm for choosing the k medians of the continuum of demand
points dened by a convex polygon C . Although the theoretical worst-case approximation ratio of our algorithm is 2.74

using our current estimates of upper and lower bounds, we nd that in practice the algorithm generally nds solutions

within 10% of optimality.

7 Acknowledgments

The authors thank Joseph Mitchell, Joseph O'Rourke, Stan Wagon, and an anonymous referee for their helpful suggestions.

References

Algorithmica[1] B. Aronov, P. Carmi, and M.J. Katz. Minimum-cost load-balancing partitions. , 54(3):318336, July

2009.

11

(a) The hatched rectangles indicate the members of OUT,
where we have k = 25; since |OUT| = 5, we have 5 extra
points to distribute among the members of IN, which are all
the unhatched rectangles (note that one member of IN is not
a nal rectangle). The +1 symbols correspond to rectan-
gles for which N˜j = Nj + 1 (ties are broken arbitrarily).

(b) The output of our modied algorithm; the small arrows

indicate that points located outside C are translated towards
C accordingly.

Figure 6: The eect of our minor algorithmic modication.

12

1.18

1.16

1.14

1.12

Ratio 1.1

1.08

1.06

1.04

1.02 200 400 600 800 1000
0
k

Figure 7: The approximation ratios for k ≤ 1000 applied to the 50 states of the USA.

Figure 8: The output of our modied algorithm (and the induced Voronoi diagram) for k = 100 when applied to the

convex hull of the state of Minnesota.

13

[2] Sanjeev Arora, Prabhakar Raghavan, and Satish Rao. Approximation schemes for Euclidean k-medians and related

problems. In Proceedings of the thirtieth annual ACM symposium on Theory of computing , STOC '98, pages 106113,

New York, NY, USA, 1998. ACM.

[3] Jack Brimberg, Pierre Hansen, Nenad Mlandinovic, and Eric. D. Taillard. Improvement and comparison of heuristics

Oper. Res.for solving the uncapacitated multisource weber problem. , 48:444460, May 2000.

[4] Moses Charikar, Sudipto Guha, Éva Tardos, and David B. Shmoys. A constant-factor approximation algorithm for

the k-median problem. J. Comput. Syst. Sci., 65:129149, August 2002.

Oper. Res.[5] Sándor P. Fekete, Joseph S. B. Mitchell, and Karin Beurer. On the continuous Fermat-Weber problem. ,

53:6176, January 2005.

[6] J. N. Lyness and R. Cools. A survey of numerical cubature over triangles. In Proceedings of Symposia in Applied
Mathematics, pages 127150. American Mathematical Society, 1994.

[7] Joseph S. B. Mitchell. Guillotine subdivisions approximate polygonal subdivisions: A simple polynomial-time ap-

SIAM J. Comput.proximation scheme for geometric TSP, k-MST, and related problems. , 28:12981309, March

1999.

SIAM Journal on[8] C. H. Papadimitriou. Worst-case and probabilistic analysis of a geometric location problem.
Computing, 10:542, 1981.

[9] Franco P. Preparata and Michael I. Shamos. Computational geometry: an introduction. Springer-Verlag New York,

Inc., New York, NY, USA, 1985.

Proc IEEE Melecon[10] G. Toussaint. Solving geometric problems with the rotating calipers. , 9(May):18, 1983.

Appendix

Tables 1 through 5 show the approximation ratios for k ≤ 1000. We also show the Voronoi diagrams and point placements
for k = 25 for additional clarity.

14

Alabama Approximation ratio Alaska Approximation ratio
Arizona Arkansas
1.08 200 400 600 800 1000 1.08 200 400 600 800 1000
1.075 1.075 1000
k k 1000
1.07 1.07 1000
1.065 Approximation ratio 1.065 Approximation ratio 1000

1.06 1.06
1.055 1.055

1.05 1.05
1.045 1.045

1.04 1.04
1.035 1.035

0 0

1.09 1.09

1.08 1.08

1.07 1.07

1.06 1.06

1.05 1.05
1.04 1.04

1.03 200 400 600 800 1000 1.03 200 400 600 800
0 0
California k Colorado k
Connecticut 1.12 Delaware 1.1
1.11 Approximation ratio Georgia 1.09 Approximation ratio
Florida 1.08
1.1 200 400 600 800 1000 1.07 200 400 600 800
1.09 1.06
1.08 k 1.05 k
1.07 1.04
1.06 Approximation ratio 1.03 Approximation ratio
1.05
1.04 200 400 600 800 1000 0 200 400 600 800
1.03
k 1.075 k
0 1.07
Approximation ratio Approximation ratio
1.075 1.065
1.07 200 400 600 800 1000 1.06 200 400 600 800

1.065 k 1.055 k
1.06 1.05

1.055 1.045
1.05 1.04

1.045 1.035
1.04 1.03
0
1.035
1.03 1.075
0 1.07

1.2 1.065
1.18 1.06
1.16
1.14 1.055
1.12 1.05

1.1 1.045
1.08 1.04
1.06
1.04 1.035
1.03
0 0

Table 1: Approximation ratios and point congurations for k = 25 for Alabama through Georgia.

15

Hawaii Approximation ratio Idaho 1.11 Approximation ratio
Illinois Indiana 1.1
Iowa 1.075 200 400 600 800 1000 Kansas 200 400 600 800 1000
Kentucky 1.07 Louisiana 1.09 1000
Maine k Maryland 1.08 k 1000
1.065 1.07 1000
1.06 Approximation ratio 1.06 Approximation ratio 1000
1.05
1.055 200 400 600 800 1000 1.04 200 400 600 800
1.05 1.03
k k
1.045 0
1.04 Approximation ratio Approximation ratio
1.11
1.035 200 400 600 800 1000 1.1 200 400 600 800
1.03
0 k 1.09 k
1.08
1.18 Approximation ratio 1.07 Approximation ratio
1.16 1.06
1.14 200 400 600 800 1000 1.05 200 400 600 800
1.12 1.04
k 1.03 k
1.1
1.08 Approximation ratio 0 Approximation ratio
1.06
1.04 200 400 600 800 1000 1.09 200 400 600 800
1.02 1.08
k 1.07 k
0 1.06
1.05
1.09 1.04
1.08 1.03
1.07 1.02
1.06
1.05 0
1.04
1.03 1.075
1.07
0
1.065
1.11 1.06
1.1
1.055
1.09 1.05
1.08
1.07 1.045
1.06 1.04
1.05
1.04 1.035
1.03
0 0

1.11 1.12
1.1 1.11

1.09 1.1
1.08 1.09
1.07 1.08
1.06 1.07
1.05 1.06
1.04 1.05
1.04
0
0

Table 2: Approximation ratios and point congurations for k = 25 for Hawaii through Maryland.

16

Massachusetts Approximation ratio Michigan Approximation ratio
Minnesota Mississippi
Missouri 1.14 200 400 600 800 1000 Montana 1.11 200 400 600 800 1000
Nebraska 1.12 1.1 1000
k Nevada k 1000
New Hampshire 1.1 New Jersey 1.09 1000
1.08 Approximation ratio 1.08 Approximation ratio 1000
1.06 1.07
1.04 200 400 600 800 1000 1.06 200 400 600 800
1.02 1.05
k 1.04 k
0 1.03
Approximation ratio Approximation ratio
1.08 0
1.075 200 400 600 800 1000 200 400 600 800
1.09
1.07 k k
1.065 1.08
Approximation ratio Approximation ratio
1.06 1.07
1.055 200 400 600 800 1000 200 400 600 800
1.06
1.05 k k
1.045 1.05
Approximation ratio Approximation ratio
1.04 1.04
1.035 200 400 600 800 1000 200 400 600 800
1.03
0 k 0 k

1.09 1.09
1.08 1.08
1.07 1.07
1.06 1.06
1.05 1.05
1.04 1.04
1.03 1.03
1.02
0
0
1.1
1.09 1.18
1.08 1.16
1.07 1.14
1.06 1.12
1.05
1.04 1.1
1.03 1.08
1.06
0 1.04
1.02
1.09
1.08 0
1.07
1.06 1.13
1.05 1.12
1.04 1.11
1.03
1.1
0 1.09
1.08
1.07
1.06
1.05
1.04
1.03

0

Table 3: Approximation ratios and point congurations for k = 25 for Massachusetts through New Jersey.

17

New Mexico Approximation ratio New York Approximation ratio
North Carolina North Dakota
1.09 200 400 600 800 1000 1.16 200 400 600 800 1000
Ohio 1.08 Oklahoma 1.14 1000
Oregon 1.07 k Pennsylvania 1.12 k 1000
Rhode Island 1.06 South Carolina 1000
1.05 Approximation ratio 1.1 Approximation ratio 1000
1.04 1.08
1.03 200 400 600 800 1000 1.06 200 400 600 800
1.02 1.04
k 1.02 k
0
Approximation ratio 0 Approximation ratio
1.13
1.12 200 400 600 800 1000 1.09 200 400 600 800
1.11
k 1.08 k
1.1
1.09 Approximation ratio 1.07 Approximation ratio
1.08
1.07 200 400 600 800 1000 1.06 200 400 600 800
1.06
1.05 k 1.05 k
1.04
1.03 Approximation ratio 1.04 Approximation ratio

0 200 400 600 800 1000 1.03 200 400 600 800
0
1.09 k k
1.13
1.08 1.12
1.11
1.07
1.1
1.06 1.09
1.08
1.05 1.07
1.06
1.04 1.05
1.04
1.03 1.03
0
0
1.075
1.07 1.09
1.08
1.065 1.07
1.06 1.06
1.05
1.055 1.04
1.05 1.03
1.02
1.045
1.04 0

1.035 1.11
1.03 1.1
0
1.09
1.14 1.08
1.13 1.07
1.12 1.06
1.11 1.05
1.04
1.1 1.03
1.09
1.08 0
1.07
1.06
1.05
1.04

0

Table 4: Approximation ratios and point congurations for k = 25 for New Mexico through South Carolina.

18

South Dakota Approximation ratio Tennessee Approximation ratio
Texas Utah
1.09 200 400 600 800 1000 1.09 200 400 600 800 1000
Vermont 1.08 Virginia 1000
Washington 1.07 k West Virginia 1.08 k 1000
Wisconsin 1.06 1000
1.05 Approximation ratio Wyoming 1.07 Approximation ratio 1000
1.04
1.03 200 400 600 800 1000 1.06 200 400 600 800
1.02
k 1.05 k
0
Approximation ratio 1.04 Approximation ratio
1.09
200 400 600 800 1000 1.03 200 400 600 800
1.08 0
k k
1.07 1.075
Approximation ratio 1.07 Approximation ratio
1.06
200 400 600 800 1000 1.065 200 400 600 800
1.05 1.06
k k
1.04 1.055
Approximation ratio 1.05 Approximation ratio
1.03
0 200 400 600 800 1000 1.045 200 400 600 800
1.04
1.075 k k
1.07 1.035
1.03
1.065 0
1.06
1.16
1.055
1.05 1.14

1.045 1.12
1.04
1.1
1.035
1.03 1.08
0
1.06
1.08
1.075 1.04
0
1.07
1.065 1.075
1.07
1.06
1.055 1.065
1.06
1.05
1.045 1.055
1.05
1.04
1.035 1.045
1.04
0
1.035
1.11 1.03
1.1 0

1.09 1.1
1.08 1.09
1.07 1.08
1.06 1.07
1.05 1.06
1.04 1.05
1.03 1.04
1.03
0 1.02

0

Table 5: Approximation ratios and point congurations for k = 25 for South Dakota through Wyoming.

19


Click to View FlipBook Version