Minimizing the Average Distance of Separated Points on the Plane in the
- Author: Kim Jae-Hoon
- Organization: Kim Jae-Hoon
- Publish: Journal of information and communication convergence engineering Volume 10, Issue1, p1~4, 31 March 2012
Given separated points divided by a line, called a wall, in a plane, we aim to make a gate in the wall to connect the separated points to each other. In this setting, the problem is to find a location for the gate that minimizes the average distance between the points. The problem is a variant of the well-known facility location problem, which is extensively studied in the fields of operations research, location theory, theoretical computer science, and so on. In this paper, we consider the
-distance of the points in the plane. The points are projected onto the wall and so the problem is transformed to a proximity problem of points on a line. Then it is shown that the transformed problem is related to the weighted median problem of points on the line. Therefore, we obtain an L1 O( )-time algorithm to solve our problem. nlog n
Average distance , L1-distance , Facility location , Weighted median
Let V and W be two sets of separated points in the plane, specifically, the
blackpoints and the whitepoints, respectively. If | V| = nand | W| = m, then the average distancebetween Vand W, denoted by μ( V,W), is defined to be the average distance of pand qfor all point pairs ( p,q) ∈ V× W:
d(p,q)denotes the distance of pand qin the plane, in particular, we will only consider the L1-distance of the plane in this paper.
In this paper, we consider the case in which
Vand Ware completely separated by a wall. This is inspired by the situation where the Palestinian area and the Israeli area are separated by a wall. We cannot go through the wall from a black point to a white point. Thus we wish to make a gate in the wall in order to connect black points and white points. Then, to go from a black point to a white point, we should go from the black point to the gate and then from the gate to the white point. Therefore, for agate g, the distance d(p,q)between a black point pand a white point qin this environment is given by
In this paper, we will investigate a location problem in this environment, which is about where to make a gate in the wall. In particular, we are concerned in locating the gate to minimize the average distance between
Vand W, which means constructing the gate to make mutual visits between the two separated areas easy.
This is closely related to the well-known
facility locationproblem, in which a company wants to open up a number of facilities to serve their customers. In the problem, both the opening of a facility at a specific location and the service of a customer by a facility incurs some cost. The goal is to minimize the overall cost of opening enough facilities to serve all the customers.
There are four primary problems in facility location: the
p-median problem, the p-center problem, the uncapacitated facility locationproblem (UFLP) and the quadratic assignment problem (QAP). These problems are specific variants of the general facility location problem.
Our problem may be considered one of a number of variants of the facility location problem. It corresponds to the case in which there is no cost to open a facility, say a gate, and the service costs are the distances between the pairs of black and white points.
In this paper, we will obtain an efficient algorithm to find a gate in the wall minimizing the average distance between black points and white points.
The problem of determining the average distance is mostly concentrated on the graph. One method of computing the average distance of a graph with n nodes is simply to compute the distances between all pairs of vertices, which is performed in time
O(n2). In , the author asked whether the average distance of a graph is easier to compute than all distances between vertices of the graph. An affirmative answer is given in , which presents an algorithm that computes the average distance of an interval graph with m edges of unit weight in time O(m). The author provides an algorithm that computes the average distance of a tree with n nodes and p edges in time O(n).
Our problem is related to variants of the facility location problem in the Euclidean space: the median problem and the center problem. In the median problem, the sum of distances from the clients to their nearest facilities is minimized, whereas the maximum distance between the clients and their nearest facilities is minimized in the center problem.
For the 1-median problem, it is well-known that there is a linear time algorithm in R. But solving for the exact location of the Euclidean 1-median in two or more dimensions is difficult in general. Indeed, no polynomial-time algorithm is known, nor has the problem been shown to be non-deterministic polynomial-time hard (NP-hard) . There is a randomized algorithm with its running time linear in n and polynomial in 1/
In the case of the 1-center problem, there is a deterministic
O(n)-time algorithm in R2 . This result has been extended to R dfor any fixed din O(d(O(d))n)time by [10, 11]. The 2-center problem has been solved by a number of works [12-17]. The best recentsolution is an O( nlog2 nlog2 log n)-time algorithm given in . Agarwal and Sharir  provide a generalization of Drezner’s algorithm from R2 to R dto give an algorithm requiring O(nd+1)time.
k-center problem can be solved in linear time in R using the algorithm of  for finding the k-centers in a tree. The problem is shown to be NP-hard in R2 . There are many approximation algorithms for the Euclidean k-center problem [21-24].
The problem that we will deal with is one of various variants of the facility location problem and it is first investigated in this paper. We will propose an efficient algorithm running in linear time.
Vand Wbe the sets of black points and white points, respectively, where | V| = nand | W| = m. There is a wall located between Vand Wand dividing the black points and the white points.
We consider a gate
g, a point lying on the wall. Then the distance d(p,q)between p∈ Vand q∈ Wis given as d(p,q)= d(p,g)+ d(g,q). To compute the distance easily, we will apply the projections of points in V∪ Wonto the wall as shown in Fig. 1. Let vbe a point in V∪ W. Then the projection of vonto the wall is denoted by
Thus the distance from
vto the gate gcan be given by
Here both the point
and the gate
gare located on the wall. Also note that
is uniquely determined regardless of the location of the gate
p∈ Vand q∈ W, the distance d (p,q)is given as
Thus, for any black point
p∈ V, the sum of distances between it and all white points q∈ Wis obtained by
Thus the sum of distances of all pairs of
p∈ Vand q∈ Wis
Pand Qare fixedly determined. Therefore, the goal is transformed to minimizing the function O. That is, we derive a one-dimensional equivalent problem that finds a gate g to minimize the function Ofor ( n+ m) points given on the line. From this point on, we will solve the equivalent problem.
on the line where |V|=
nand |W|= m, we want to obtain a (gate) point gthat minimizes the objective function Ogiven by
Here, we will provide an algorithm
Ato solve the above problem. We consider the points
pi with weights wi on the line. If pi ∈ V, then
pi ∈ W, then
Then the objective
O'=∑i wi d( pi, g) is the same as
Thus the optimal solution
galso minimizes O'. We will show that the weighted median of points piminimizes the objective O'.
The weighted median of points
piis defined to be pk, one of the points satisfying
Thus we consider an algorithm
Ato find the weighted median of points pi. In A, first sort the points piin non-decreasing order. Then sum up the weights of points until we have found the median, that is, until the sum is more than or equal to
Ais run in O( nlog n) time.
Given the validity of the algorithm
A, it remains to prove that the weighted median of points minimizes the objective O' . The next theorem shows that. Theorem 1:Given points piwith weights wion a line, where ∑i wi =1, for the weighted median μ of the points, the objective function ∑ i wi d( pi , p) is minimized when p=μ. Proof:First, sort the points piin non-decreasing order. Then let the weighted median μ be the point pk. Assume to the contrary that the point pminimizing the objective function is not pk. Then we should consider two cases:
because the points
piare sorted in non-decreasing order. Then we also obtain the following inequalities:
Then we consider
L1- Land L2- L. We can show the terms are both non-negative as follows:
because from the definition of the weighted median,
Consequently, we show that
L1 ≥ Land L2 ≥ L. This completes the proof. Corollary 1:Let Vand Wbe the sets of black points and white points, respectively, divided by a wall, where |V| = nand |W| = m. There is an O(( n+ m) log( n+ m))-time algorithm to find a gate minimizing the average distance between Vand Wfor the L1-distance of the plane.
In this paper, we consider a variant of the facility problem in a plane. Given separated points divided by a wall, we find a gate locationon the wall to minimize the average distances between the points in L1-distance. An O(n log?n)-time algorithm is provided, where n is the total number of points.
For further work, we may considervarious objective functions, for example, the longest distance between points, called by the diameter. Also the problem in which the number of gates is more than one is interesting.
[Fig. 1.] The projections of points onto the wall.