This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

An efficient approximation for point-set diameter
in higher dimensions

Mahdi Imanparast111Department of Mathematics and Computer Science, Amirkabir University of Technology, Tehran, Iran,  Seyed Naser Hashemi11footnotemark: 1,  Ali Mohades11footnotemark: 1 222Laboratory of Algorithms and Computational Geometry, Amirkabir University of Technology, Tehran, Iran
Abstract

In this paper, we study the problem of computing the diameter of a set of nn points in dd-dimensional Euclidean space for a fixed dimension dd, and propose a new (1+ε)(1+\varepsilon)-approximation algorithm with O(n+1/εd1)O(n+1/\varepsilon^{d-1}) time and O(n)O(n) space, where 0<ε10<\varepsilon\leqslant 1. We also show that the proposed algorithm can be modified to a (1+O(ε))(1+O(\varepsilon))-approximation algorithm with O(n+1/ε2d313)O(n+1/\varepsilon^{\frac{2d}{3}-\frac{1}{3}}) running time. These results provide some improvements in comparison with existing algorithms in terms of simplicity and data structure.

1 Introduction

Given a finite set 𝒮\mathcal{S} of nn points, the diameter of 𝒮\mathcal{S}, denoted by D(𝒮)D(\mathcal{S}) is the maximum distance between two points of 𝒮\mathcal{S}. Namely, we want to find a diametrical pair pp and qq such that D(𝒮)=maxp,q𝒮(pq)D(\mathcal{S})=\max_{\forall{p,q\in\mathcal{S}}}(||p-q||). Computing the diameter of a set of points has a large history, and it may be required in various fields such as database, data mining, and vision. A trivial brute-force algorithm for this problem is as follows: compute the distance between each pair of points and then choose the maximum distance. Since computing the distance takes constant time, this algorithm takes O(n2)O(n^{2}) time, but this is too slow for large-scale datasets that occur in the fields. Hence, we need a faster algorithm which may be exact or is an approximation.

By reducting from the set disjointness problem, it can be shown that computing the diameter of nn points in d\mathbb{R}^{d} requires Ω(nlogn)\Omega(n\log n) operations in the algebraic computation-tree model [1]. It is shown by Yao that it is possible to compute the diameter in sub-quadratic time in each dimension [2]. There are well-known solutions in two and three dimensions. In the plane, this problem can be computed in optimal time O(nlogn)O(n\log n), but in three dimensions, it is more difficult. Clarkson and Shor [3] present an O(nlogn)O(n\log n)-time randomized algorithm. Their algorithm needs to compute the intersection of nn balls (with the same radius) in 3\mathbb{R}^{3}. It may be slower than the brute-force algorithm for the most practical datasets. Moreover, it is not an efficient method for higher dimensions because the intersection of nn balls with the same radius has a large size. Some deterministic algorithms with running time O(nlog3n)O(n\log^{3}n) [4, 5] and O(nlog2n)O(n\log^{2}n) [6, 7] are found for solving this problem. Finally, Ramos [8, 9] introduced an optimal deterministic O(nlogn)O(n\log n)-time algorithm in 3\mathbb{R}^{3}. Cheong et al. [10] present an O(nlog2n)O(n\log^{2}n) randomized algorithm that computes the all-pairs farthest neighbors for nn points on the convex position in 3\mathbb{R}^{3}.
   In the absence of fast algorithms, many attempts have been done to approximate the diameter in low and high dimensions. A 2-approximation algorithm with O(dn)O(dn) time in dd dimensions can be found easily by selecting a point xx of 𝒮\mathcal{S} and then finding the farthest point yy from it by brute-force manner. The first non-trivial approximation algorithm for the diameter is presented by Egecioglu and Kalantari [11] that approximates the diameter with factor 3\sqrt{3} and operations cost O(dn)O(dn) in dd dimensions. They also present an iterative algorithm with tnt\leq n iterations and the cost O(dn)O(dn) for each iteration that has approximation factor 523\sqrt{5-2\sqrt{3}}. Agarwal et al. [12] present a (1+ε)(1+\varepsilon)-approximation algorithm in d\mathbb{R}^{d} with O(n/ε(d1)/2)O(n/\varepsilon^{(d-1)/2}) running time by projection to directions. Barequet and Har Peled [13] present a d\sqrt{d}-approximate diameter method with O(dn)O(dn) time. They also describe a (1+ε)(1+\varepsilon)-approximate approach for computing the diameter with O(n+1/ε2d)O(n+1/\varepsilon^{2d}) time in d\mathbb{R}^{d}. They show that the running time can be improved to O(n+1/ε2(d1))O(n+1/\varepsilon^{2(d-1)}). Similarly, Har Peled [14] presents an approach which for the most inputs is able to compute very fast the exact diameter, or an approximation. Although, in the worst case, the algorithm running time is still quadratic, and it is sensitive to the hardness of the input. His algorithm is able to return a pair of points pp and qq such that pq(1ε)D||p-q||\geq(1-\varepsilon)D, for each value ε>0\varepsilon>0 in each dimension with O((n+1/ε2d)log1/ε)O((n+1/\varepsilon^{2d})\log 1/\varepsilon) running time. He shows that with a complicated analysis, this running time can be reduced to O((n+1/ε3(d1)/2)log1/ε)O((n+1/\varepsilon^{3(d-1)/2})\log 1/\varepsilon). Simultaneously, Maladain and Boissonnat [15] present an exact algorithm for the diameter by computing the double normals in each dimension, but their algorithm is not worst-case optimal. They also show that with having double normals, a 3\sqrt{3}-approximation of the diameter in each dimension is provided. Moreover, Finocchiaro and Pellegrini [16] describe an algorithm that finds in O(dnlogn+n2)O(dn\log n+n^{2}) time with high probability a (1+ε)(1+\varepsilon)-approximation for the diameter of a set of nn points in dd-dimensional Euclidean space. Chan [17] observes that a combination of two approaches in [12] and [13] yields a (1+ε)(1+\varepsilon)-approximation algorithm with O(n+1/ε3(d1)/2)O(n+1/\varepsilon^{3(d-1)/2}) time and a (1+O(ε))(1+O(\varepsilon))-approximation algorithm with O(n+1/εd12)O(n+1/\varepsilon^{d-\frac{1}{2}}) time. He also introduces a core-set theorem, and shows that using this theorem, a (1+O(ε))(1+O(\varepsilon))-approximation for the diameter in O(n+1/εd32)O(n+1/\varepsilon^{d-\frac{3}{2}}) time can be found [18]. Recently, Chan [19] has proposed an approximation algorithm with O((n/ε+1/εd2+1)(log1ε)O(1))O((n/\sqrt{\varepsilon}+1/\varepsilon^{\frac{d}{2}+1})(\log\frac{1}{\varepsilon})^{O(1)}) time by applying the Chebyshev polynomials for the diameter in low constant dimensions, and Arya et al. [20] show that by applying an efficient decomposition of a convex body using a hierarchy of Macbeath regions, it is possible to compute an approximation for the diameter of a point set in O(nlog1ε+1/ε(d1)2+α)O(n\log\frac{1}{\varepsilon}+1/\varepsilon^{\frac{(d-1)}{2}+\alpha}) time, where α\alpha is an arbitrarily small positive constant. Table 1 provides a summary on some non-constant approximation algorithm for the point-set diameter.

‎ ‎ ‎

Table 1: A summary on the complexity of some utilizable non-constant approximation algorithm for the diameter of a point set in dd-dimensional Euclidean space. Our results are denoted by +.

Reference   Approximation Factor   Running Time ‎  [12] 1+ε1+\varepsilon O(nε(d1)/2)O(\dfrac{n}{\varepsilon^{(d-1)/2}}) [13] 1+ε1+\varepsilon O(n+1/ε2(d1))O(n+1/\varepsilon^{2(d-1)}) ‎  [14] 1+ε1+\varepsilon O((n+1/ε2d)log1ε)O((n+1/\varepsilon^{2d})\log\frac{1}{\varepsilon}) [17] 1+ε1+\varepsilon O(n+1/ε3(d1)2)O(n+1/\varepsilon^{\frac{3(d-1)}{2}}) ‎   + 1+ε1+\varepsilon O(n+1/εd1)O(n+1/\varepsilon^{d-1}) [17] 1+O(ε)1+O(\varepsilon) O(n+1/εd12)O(n+1/\varepsilon^{d-\frac{1}{2}}) ‎  [18] 1+O(ε)1+O(\varepsilon) O(n+1/εd32)O(n+1/\varepsilon^{d-\frac{3}{2}}) ‎  [19] 1+O(ε)1+O(\varepsilon) O(n/ε(log1ε)O(1)+1/εd2+1(log1ε)O(1))O(n/\sqrt{\varepsilon}(\log\frac{1}{\varepsilon})^{O(1)}+1/\varepsilon^{\frac{d}{2}+1}(\log\frac{1}{\varepsilon})^{O(1)}) ‎  [20] 1+O(ε)1+O(\varepsilon) O(nlog1ε+1/ε(d1)2+α)O(n\log\frac{1}{\varepsilon}+1/\varepsilon^{\frac{(d-1)}{2}+\alpha}) ‎   + 1+O(ε)1+O(\varepsilon) O(n+1/ε2d313)O(n+1/\varepsilon^{\frac{2d}{3}-\frac{1}{3}})


1.1 Our results

In this paper, we propose a new (1+ε)(1+\varepsilon)-approximation algorithm for computing the diameter of a set 𝒮\mathcal{S} of nn points in d\mathbb{R}^{d} with O(n+1/εd1)O(n+1/\varepsilon^{d-1}) time and O(n)O(n) space, where 0<ε10<\varepsilon\leqslant 1. Moreover, we show that the proposed algorithm can be modified to a (1+O(ε))(1+O(\varepsilon))-approximation algorithm with O(n+1/ε2d313)O(n+1/\varepsilon^{\frac{2d}{3}-\frac{1}{3}}) time and O(n)O(n) space. As stated above, two new results have been recently presented for the diameter problem in [19] and [20]. It should be noted that our algorithms are completely different in terms of computational technique. The polynomial technique provided by Chan [19] is based on using Chebyshev polynomials and discrete upper envelope subroutine [18], and the method presented by Arya et al. [20] requires the use of complex data structures to approximately answer queries for polytope membership, directional width, and nearest-neighbor. While our algorithms in comparison with these algorithms are simpler in terms of understanding and data structure. The remainder of this paper is organized as follows: in section 2, we describe our proposed algorithm. Subsection 2.1 includes our analysis over the algorithm. Subsection 2.2 presents a modified version of the proposed algorithm. In section 3, we draw our conclusion.

2 The proposed algorithm

In this section, we describe our new approximation algorithm to compute the diameter of a set 𝒮\mathcal{S} of nn points in d\mathbb{R}^{d}. In order to follow our algorithm, we first find extreme points in each coordinate and compute the axis-parallel bounding box of 𝒮\mathcal{S}, which is denoted by B(𝒮)B(\mathcal{S}). We use the largest length side \ell of B(𝒮)B(\mathcal{S}) to impose grids on the point set. In fact, we first decompose B(𝒮)B(\mathcal{S}) to a grid of regular hypercubes with side length ξ\xi, where ξ=ε/2d\xi=\varepsilon\ell/2\sqrt{d}. We call each hypercube a cell. Then, each point of 𝒮\mathcal{S} is rounded to its corresponding central cell-point. Figure 1 shows an example of the rounding process for a point set in 2\mathbb{R}^{2}.

Refer to captionRefer to caption
Figure 1: (a) A set of points in 2\mathbb{R}^{2} and an ξ\xi-gird. Initial points are shown by blue points and their corresponding central cell-points are shown by circle points. (b) Rounded point set 𝒮^\hat{\mathcal{S}}.

In the following, we impose again a ξ1\xi_{1}-grid to B(𝒮)B(\mathcal{S}) for ξ1=ε/2d\xi_{1}=\sqrt{\varepsilon}\ell/2\sqrt{d}. Then, we round each point of the rounded point set 𝒮^\hat{\mathcal{S}} to its nearest grid-point in this new grid that results in a point set 𝒮1^\hat{\mathcal{S}_{1}}. Let, δ(p)\mathcal{B}_{\delta}(p) be a hypercube with side length δ\delta and central-point pp. We restrict our search for finding diametrical pairs of the first rounded point set 𝒮^\hat{\mathcal{S}} into two hypercubes 2ξ1(p^1)\mathcal{B}_{2\xi_{1}}(\hat{p}_{1}) and 2ξ1(q^1)\mathcal{B}_{2\xi_{1}}(\hat{q}_{1}) corresponding to two diametrical pair p^1\hat{p}_{1} and q^1\hat{q}_{1} in the point set 𝒮1^\hat{\mathcal{S}_{1}}. Let us use two point sets 1\mathcal{B}_{1} and 2\mathcal{B}_{2} for maintaining points of the rounded point set 𝒮^\hat{\mathcal{S}}, which are inside two hypercubes 2ξ1(p^1)\mathcal{B}_{2\xi_{1}}(\hat{p}_{1}) and 2ξ1(q^1)\mathcal{B}_{2\xi_{1}}(\hat{q}_{1}), respectively. See Figure 2. Then, it is sufficient to find a diameter between points of 𝒮^\hat{\mathcal{S}}, which are inside two point sets 1\mathcal{B}_{1} and 2\mathcal{B}_{2}. We use notation Diam(1,2)Diam(\mathcal{B}_{1},\mathcal{B}_{2}) for the process of computing the diameter of point set 12\mathcal{B}_{1}\cup\mathcal{B}_{2}. Altogether, we can present the following algorithm.

 


Algorithm 1‎: APPROXIMATE DIAMETER (𝒮,ε)(\mathcal{S},\varepsilon)

 


‎ ‎ ‎Input‎: a set 𝒮\mathcal{S} of nn points in d\mathbb{R}^{d} and an error parameter ε\varepsilon.

‎Output‎: approximate diameter D~\tilde{D}.

1:   Compute the axis-parallel bounding box B(𝒮)B(\mathcal{S}) for a point set 𝒮\mathcal{S}.

2:   \ell\leftarrow Find the length of the largest side in B(𝒮)B(\mathcal{S}).

3:   Set ξε/2d\xi\leftarrow\varepsilon\ell/2\sqrt{d} and ξ1ε/2d\xi_{1}\leftarrow\sqrt{\varepsilon}\ell/2\sqrt{d}.

4:   𝒮^\hat{\mathcal{S}}\leftarrow Round each point of 𝒮\mathcal{S} to its central-cell point in a ξ\xi-grid.

5:   𝒮1^\hat{\mathcal{S}_{1}}\leftarrow Round each point of 𝒮^\hat{\mathcal{S}} to its nearest grid-point in a ξ1\xi_{1}-grid.

6:   D^1\hat{D}_{1}\leftarrow Compute the diameter of the point set 𝒮1^\hat{\mathcal{S}_{1}} by brute-force manner, and
        simultaneously, a list of the diametrical pair (p^1,q^1)(\hat{p}_{1},\hat{q}_{1}), such that D^1=p^1q^1\hat{D}_{1}=||\hat{p}_{1}-\hat{q}_{1}||.

7:   Find points of 𝒮^\hat{\mathcal{S}} which are in two hypercubes 1=2ξ1(p^1)\mathcal{B}_{1}=\mathcal{B}_{2\xi_{1}}(\hat{p}_{1}) and 2=2ξ1(q^1)\mathcal{B}_{2}=\mathcal{B}_{2\xi_{1}}(\hat{q}_{1})
      for each diametrical pair (p^1,q^1)(\hat{p}_{1},\hat{q}_{1}).

8:   D^\hat{D}\leftarrow Compute Diam(1,2)Diam(\mathcal{B}_{1},\mathcal{B}_{2}), corresponding to each diametrical pair (p^1,q^1)(\hat{p}_{1},\hat{q}_{1})
       by brute-force manner and return the maximum value between them.

9:   D~D^+ε/2\tilde{D}\leftarrow\hat{D}+\varepsilon\ell/2.

10: Output D~\tilde{D}. ‎

 

‎ ‎

Note that we only need O(dn)O(dn) time to round points to their central-cell points. We need O(d)O(d) time for computing the central cell-point for each point. Thus, we can round all point of a set of nn points to their central-cell points in O(dn)O(dn) time. Similarly, rounding nn points to their nearest grid-point can be done in O(dn)O(dn) time.

Refer to caption
Figure 2: Points of the set 𝒮^\hat{\mathcal{S}} are shown by circle points and their corresponding nearest grid-points in set 𝒮1^\hat{\mathcal{S}_{1}} are shown by blue square points. The searching domain for finding the diameter of the point set 𝒮^\hat{\mathcal{S}} is reduced into two point sets 1\mathcal{B}_{1} and 2\mathcal{B}_{2}.

2.1 Analysis

In this subsection, we analyze the proposed algorithm.

Theorem 1.

Algorithm 1 computes an approximate diameter for a set 𝒮\mathcal{S} of nn points in d\mathbb{R}^{d} in O(n+1/εd1)O(n+1/\varepsilon^{d-1}) time and O(n)O(n) space, where 0<ε10<\varepsilon\leqslant 1.

Proof.

Finding the extreme points in all coordinates and finding the largest side of B(𝒮)B(\mathcal{S}) can be done in O(dn)O(dn) time. The rounding step takes O(d)O(d) time for each point, and for all of them takes O(dn)O(dn) time, but for computing the diameter over the rounded point set 𝒮1^\hat{\mathcal{S}_{1}} we need to know the number of points in the set 𝒮1^\hat{\mathcal{S}_{1}}. We know that the largest side of the bounding box B(𝒮)B(\mathcal{S}) has length \ell and the side length of each cell in ξ1\xi_{1}-grid is ξ1=ε/2d\xi_{1}=\sqrt{\varepsilon}\ell/2\sqrt{d}. On the other hand, the volume of a hypercube of side length LL in dd-dimensional space is LdL^{d}. Since, corresponding to each point in the point set 𝒮1^\hat{\mathcal{S}_{1}}, we can take a hypercube of side length ξ1\xi_{1}. Therefore, the number of grid-points in an imposed ξ1\xi_{1}-grid to the bounding box B(𝒮)B(\mathcal{S}) is at most

(+ξ1)d(ξ1)d=(ε/2d+1)d=(2dε+1)d=O((2d)dεd2).\dfrac{(\ell+\xi_{1})^{d}}{(\xi_{1})^{d}}=\left(\dfrac{\ell}{\sqrt{\varepsilon}\ell/2\sqrt{d}}+1\right)^{d}=\left(\dfrac{2\sqrt{d}}{\sqrt{\varepsilon}}+1\right)^{d}=O\left(\dfrac{(2\sqrt{d})^{d}}{\varepsilon^{\frac{d}{2}}}\right). (1)

So, the number of points in 𝒮1^\hat{\mathcal{S}_{1}} is at most O((2d)d/εd2)O((2\sqrt{d})^{d}/\varepsilon^{\frac{d}{2}}). Hence, by the brute-force quadratic algorithm, we need O((2d)d/εd2)2)=O((2d)2d/εd)O((2\sqrt{d})^{d}/\varepsilon^{\frac{d}{2}})^{2})=O((2\sqrt{d})^{2d}/\varepsilon^{d}) time for computing all distances between grid-points of the set 𝒮1^\hat{\mathcal{S}_{1}}, and its diametrical pair list. Then, for a diametrical pair (p^1,q^1)(\hat{p}_{1},\hat{q}_{1}) in point set 𝒮1^\hat{\mathcal{S}_{1}}, we compute two sets 1\mathcal{B}_{1} and 2\mathcal{B}_{2}. They include points of 𝒮^\hat{\mathcal{S}} which are inside two hypercubes 2ξ1(p^1)\mathcal{B}_{2\xi_{1}}(\hat{p}_{1}) and 2ξ1(q^1)\mathcal{B}_{2\xi_{1}}(\hat{q}_{1}), respectively. This work takes O(dn)O(dn) time. In addition, for computing the diameter of point set 12\mathcal{B}_{1}\cup\mathcal{B}_{2}, we need to know number of points in each of them. On the other hand, the number of points in two sets 1\mathcal{B}_{1} or 2\mathcal{B}_{2} is at most

Vol(2ξ1)Vol(ξ)=(2ε/2d)d(ε/2d)d=(2ε)dεd=(2)dεd2.\dfrac{Vol(\mathcal{B}_{2\xi_{1}})}{Vol(\mathcal{B}_{\xi})}=\dfrac{(2\sqrt{\varepsilon}\ell/2\sqrt{d})^{d}}{(\varepsilon\ell/2\sqrt{d})^{d}}=\dfrac{(2\sqrt{\varepsilon})^{d}}{\varepsilon^{d}}=\dfrac{(2)^{d}}{\varepsilon^{\frac{d}{2}}}. (2)

Hence, for computing Diam(1,2)Diam(\mathcal{B}_{1},\mathcal{B}_{2}), we need O(((2)d/εd2)2)=O((2)2d/εd)O(((2)^{d}/\varepsilon^{\frac{d}{2}})^{2})=O((2)^{2d}/\varepsilon^{d}) time by brute-force manner, but we might have more than one diametrical pair (1,2)(\mathcal{B}_{1},\mathcal{B}_{2}). Since the point set 𝒮^1\hat{\mathcal{S}}_{1} is a set of grid-points, so we could have in the worst-case O(2d)O(2^{d}) different diametrical pairs (1,2)(\mathcal{B}_{1},\mathcal{B}_{2}) in point set 𝒮^1\hat{\mathcal{S}}_{1}. This means that this step takes at most O(2d(2)2d/εd)=O((22)2d/εd)O(2^{d}\cdot(2)^{2d}/\varepsilon^{d})=O((2\sqrt{2})^{2d}/\varepsilon^{d}) time.

Now, we can present the complexity of our algorithm as follows:

Td(n)=O(dn)+O(dn)+O((2d)2dεd)+O(2ddn)+O((22)2dεd),T_{d}(n)=O(dn)+O(dn)+O\left(\dfrac{(2\sqrt{d})^{2d}}{\varepsilon^{d}}\right)+O(2^{d}dn)+O\left(\dfrac{(2\sqrt{2})^{2d}}{\varepsilon^{d}}\right),
O(2ddn)+O((2d)2dεd),\hskip 14.79555pt\leqslant O(2^{d}dn)+O\left(\dfrac{(2\sqrt{d})^{2d}}{\varepsilon^{d}}\right),
=O(2ddn+(2d)2dεd).=O\left(2^{d}dn+\dfrac{(2\sqrt{d})^{2d}}{\varepsilon^{d}}\right). (3)

Since dd is fixed, we have:

Td(n)=O(n+1εd).T_{d}(n)=O(n+\dfrac{1}{\varepsilon^{d}}). (4)

We can also reduce the running time of the Algorithm 1 by discarding some internal points which do not have any potential to be the diametrical pairs in rounded point set 𝒮1^\hat{\mathcal{S}_{1}}, and similarly, in two point sets 1\mathcal{B}_{1} and 2\mathcal{B}_{2}. This can be done by considering all the points which are same in their (d1)(d-1) coordinates and keep only highest and lowest. Then, the number of points in point set 𝒮1^\hat{\mathcal{S}_{1}}, and two point sets 1\mathcal{B}_{1} and 2\mathcal{B}_{2} can be reduced to O(1/εd212)O(1/\varepsilon^{\frac{d}{2}-\frac{1}{2}}). So, using the brute-force quadratic algorithm, we need O((1/εd212)2)O((1/\varepsilon^{\frac{d}{2}-\frac{1}{2}})^{2}) time to find the diametrical pairs. Hence, this gives us the total running time O(n+1/εd1)O(n+1/\varepsilon^{d-1}). About the required space, we only need O(n)O(n) space for storing required points sets. So, this completes the proof. ∎

Now, we explain the details of the approximation.

Theorem 2.

Algorithm 1 computes an approximate diameter D~\tilde{D} such that: DD~(1+ε)DD\leqslant\tilde{D}\leqslant(1+\varepsilon)D, where 0<ε10<\varepsilon\leqslant 1.

Proof.

In line 7 of the Algorithm 1, we compute two point sets 1\mathcal{B}_{1} and 2\mathcal{B}_{2}, for each diametrical pair (p^1,q^1)(\hat{p}_{1},\hat{q}_{1}) in the point set 𝒮1^\hat{\mathcal{S}_{1}}. We know that a grid-point p^1\hat{p}_{1} in point set 𝒮1^\hat{\mathcal{S}_{1}} is formed from points of the set 𝒮^\hat{\mathcal{S}} which are inside hypercube Bξ1(p^1)B_{\xi_{1}}(\hat{p}_{1}). We use a hypercube 1\mathcal{B}_{1} of side length 2ξ12\xi_{1} to make sure that we do not lost any candidate diametrical pair of the first rounded point set 𝒮^\hat{\mathcal{S}} around a diametrical point p^1\hat{p}_{1}, (see Figure 2). In the next step, we should find the diametrical pair (p^,q^)𝒮^(\hat{p},\hat{q})\in\hat{\mathcal{S}} for points which are inside two point sets 1\mathcal{B}_{1} and 2\mathcal{B}_{2}. Hence, it is remained to show that the diameter, which is computed by two points p^\hat{p} and q^\hat{q}, is a (1+ε)(1+\varepsilon)-approximation of the true diameter. Let p^\hat{p} and q^\hat{q} be two central-cell points of the rounded point set 𝒮^\hat{\mathcal{S}} which are used in line 8 of the Algorithm 1 for computing the approximate diameter D^\hat{D}. Then, we have two cases, either two true points pp and qq are in farthest distance from each other in their corresponding cells (Figure 3 (a)), or they are in nearest distance from each other (Figure 3 (b)). It is obvious that the other cases are between these two cases.

Refer to captionRefer to caption
Figure 3: Two cases in proof of the Theorem 2. Two central-cell points p^\hat{p} and q^\hat{q} are used for computing the approximate diameter D^\hat{D}. Their corresponding true points are pp and qq.

For first case (Figure 3 (a)), we can rotate line p^q^\hat{p}\hat{q} such that two points p^\hat{p} and q^\hat{q} are projected on line pqpq. Let these two projected points be p^\hat{p}^{\prime} and q^\hat{q}^{\prime}, and we set d1=pp^d_{1}=||p-\hat{p}^{\prime}|| and d2=qq^d_{2}=||q-\hat{q}^{\prime}||. We know that the side length of each cell in a grid which is used for point set 𝒮^\hat{\mathcal{S}} is ξ\xi. So, the hypercube (cell) diagonal is ξd\xi\sqrt{d}. From Figure 3 (a) it can be found that d1<ξd/2d_{1}<\xi\sqrt{d}/2 and d2<ξd/2d_{2}<\xi\sqrt{d}/2. Therefore, we have

D=D^+d1+d2,D=\hat{D}+d_{1}+d_{2},
DD^+ξd/2+ξd/2,D\leqslant\hat{D}+\xi\sqrt{d}/2+\xi\sqrt{d}/2,
DD^+ξd,D\leqslant\hat{D}+\xi\sqrt{d},
DξdD^.D-\xi\sqrt{d}\leqslant\hat{D}. (5)

Similarly, for the second case (Figure 3 (b)), we can project two points pp and qq on line p^q^\hat{p}\hat{q}. Let these two projected points be pp^{\prime} and qq^{\prime}. We know that c1=p^p<ξd/2c_{1}=||\hat{p}-p^{\prime}||<\xi\sqrt{d}/2 and c2=q^q<ξd/2c_{2}=||\hat{q}-q^{\prime}||<\xi\sqrt{d}/2. Therefore, we have

D^=D+c1+c2,\hat{D}=D+c_{1}+c_{2},
D^D+ξd/2+ξd/2,\hat{D}\leqslant D+\xi\sqrt{d}/2+\xi\sqrt{d}/2,
D^D+ξd.\hat{D}\leqslant D+\xi\sqrt{d}. (6)

Then, from (5) and (6) we can result:

DξdD^D+ξd.D-\xi\sqrt{d}\leqslant\hat{D}\leqslant D+\xi\sqrt{d}. (7)

Since we know that ξ=ε/2d\xi=\varepsilon\ell/2\sqrt{d}, we have:

Dε/2D^D+ε/2.D-\varepsilon\ell/2\leqslant\hat{D}\leqslant D+\varepsilon\ell/2. (8)

Now, we can simplify (8) as following:

DD^+ε/2D+ε.D\leqslant\hat{D}+\varepsilon\ell/2\leqslant D+\varepsilon\ell. (9)

We know that D\ell\leqslant D. For this reason we can result:

DD^+ε/2(1+ε)D.D\leqslant\hat{D}+\varepsilon\ell/2\leqslant(1+\varepsilon)D. (10)

Finally, if we assume that D~=D^+ε/2\tilde{D}=\hat{D}+\varepsilon\ell/2, we have:

DD~(1+ε)D.D\leqslant\tilde{D}\leqslant(1+\varepsilon)D. (11)

Therefore, the theorem is proven. ∎

2.2 The modified algorithm

In this subsection, we present a modified version of our proposed algorithm by combining it with a recursive approach due to Chan [17]. Hence, we first explain Chan’s recursive approach and then use it in a phase of our proposed algorithm. As mentioned before, Agarwal et al. [12] proposed a (1+ε)(1+\varepsilon)-approximation algorithm for computing the diameter of a set of nn points in d\mathbb{R}^{d} with O(n/ε(d1)/2)O(n/\varepsilon^{(d-1)/2}) running time by projecting on directions. In fact, they found a small set of directions which can approximate well all directions. This can be done by forming unit vectors which start from origin to grid-points of a uniform grid on a unit sphere [12], or to grid-points on the boundary of a box [18]. These sets of directions have cardinality O(1/ε(d1)/2)O(1/\varepsilon^{(d-1)/2}). The following observation explains how we can find these directions on the boundary of a box.

Observation 3.

([18]) Consider a box BB which includes origin oo such that the boundary of this box (B\partial B) be in distance at least 1 from origin. For a ε/2\sqrt{\varepsilon/2}-grid on B\partial B and for each vector x\vec{x}, there is a grid point a\vec{a} on B\partial B such that the angle between two vectors a\vec{a} and x\vec{x} is at most arccos(1ε/8)εarccos(1-\varepsilon/8)\leqslant\sqrt{\varepsilon}.

Proof.

By scaling, we may assume that xBx\in\partial B. Since, in a ε/2\sqrt{\varepsilon/2}-grid the diagonal of each cell is ε\sqrt{\varepsilon}, so there is a grid point aa such that: axε/2||a-x||\leqslant\sqrt{\varepsilon}/2. Then, we have:

2axa2+x2(ε)2/4,\qquad\quad 2a\cdot x\geqslant||a||^{2}+||x||^{2}-(\sqrt{\varepsilon})^{2}/4,
2axε/4,\qquad\geqslant 2||a||||x||-\varepsilon/4,
2ax(1ε/8).\qquad\quad\geqslant 2||a||||x||(1-\varepsilon/8). (12)

This results the observation, because: cos(a,x)=ax/axcos\angle(a,x)=a\cdot x/||a||||x||. ∎

This observation explains that grid-points on the boundary of a box (B\partial B) form a set VdV_{d} of O(1/ε(d1)/2)O(1/\varepsilon^{(d-1)/2}) numbers of unit vectors in d\mathbb{R}^{d} such that for each xdx\in\mathbb{R}^{d}, there is a vector aVda\in V_{d} from origin oo to a grid-point aa on B\partial B, where the angle between two vectors xx and aa is at most ε\sqrt{\varepsilon}. On the other hand, according to observation 3, there is a vector aVda\in V_{d} such that if α\alpha be the angle between two vectors xx and aa, then αarccos(1ε/8)\alpha\leqslant arccos(1-\varepsilon/8), and so cosα(1ε/8)cos\alpha\geqslant(1-\varepsilon/8). If xx^{\prime} be the projection of the vector xx on the vector aa, then:

x=xcosα||x||=\frac{||x^{\prime}||}{cos\alpha}
x1(1ε8)\qquad\qquad\quad\leqslant||x^{\prime}||\frac{1}{(1-\frac{\varepsilon}{8})}
x(1+ε8+ε282+ε383+)\qquad\qquad\qquad\qquad\qquad\qquad\leqslant||x^{\prime}||(1+\frac{\varepsilon}{8}+\frac{\varepsilon^{2}}{8^{2}}+\frac{\varepsilon^{3}}{8^{3}}+\cdots)
x(1+ε).\qquad\qquad\quad\leqslant||x^{\prime}||(1+\varepsilon). (13)

So, we have:

xx(1+ε)x.||x^{\prime}||\leqslant||x||\leqslant(1+\varepsilon)||x^{\prime}||. (14)

This means that if pair (p,q)(p,q) be the diametrical pair of a point set, then there is a vector aVda\in V_{d} such that the angle between two vectors pqpq and aa is at most ε\sqrt{\varepsilon}. See Figure 4. Then, pair (p,q)(p^{\prime},q^{\prime}) which is the projection of pair (p,q)(p,q) on the vector aa, is a (1+ε)(1+\varepsilon)-approximation of the true diametrical pair (p,q)(p,q), and we have:

pqpq(1+ε)pq.||p^{\prime}-q^{\prime}||\leqslant||p-q||\leqslant(1+\varepsilon)||p^{\prime}-q^{\prime}||. (15)
Refer to caption
Figure 4: Projecting a point set on a direction aa. True diametrical pair (p,q)(p,q) and its projected diametrical pair (p,q)(p^{\prime},q^{\prime}).

In other words, we can project point set 𝒮\mathcal{S} on O(1/ε(d1)/2)O(1/\varepsilon^{(d-1)/2}) directions for all aVda\in V_{d}, and compute a (1+ε)(1+\varepsilon)-approximate of the diameter by finding maximum diameter between all directions. We project nn points on |Vd|=O(1/ε(d1)/2)|V_{d}|=O(1/\varepsilon^{(d-1)/2}) directions. In addition, computing the extreme points on each direction aVda\in V_{d} takes O(n)O(n) time. Consequently, Agarwal et al. [12] algorithm computes a (1+ε)(1+\varepsilon)-approximate of the diameter in O(n/ε(d1)/2)O(n/\varepsilon^{(d-1)/2}) time. Chan [17] proposes that if we reduce number of points from nn to O(1/εd1)O(1/\varepsilon^{d-1}) by rounding to a grid and then apply Agarwal et al. [12] method on this rounded point set, we need O((1/εd1)/ε(d1)/2)=O(1/ε3(d1)/2)O((1/\varepsilon^{d-1})/\varepsilon^{(d-1)/2})=O(1/\varepsilon^{3(d-1)/2}) time to compute the maximum diameter over all O(1/ε(d1)/2)O(1/\varepsilon^{(d-1)/2}) directions. Taking into account O(n)O(n) time for rounding to a grid, this new approach takes O(n+1/ε3(d1)/2)O(n+1/\varepsilon^{3(d-1)/2}) time for computing a (1+ε)(1+\varepsilon)-approximation for the diameter of a set of nn points. Moreover, Chan [17] observed that the bottleneck of this approach is the large number of projection operations. Hence, he proposes that we can project points on a set of O(1/ε)O(1/\sqrt{\varepsilon}) 2-dimensional unit vectors instead of O(1/ε(d1)/2)O(1/\varepsilon^{(d-1)/2}) dd-dimensional unit vectors to reduce the problem to O(1/ε)O(1/\sqrt{\varepsilon}) numbers of (d1)(d-1)-dimensional subproblems which can be solved recursively. Then, according to relation (14), for a vector x2x\in\mathbb{R}^{2}, there is a vector aa such that:

xx(1+ε)x,x2.||x^{\prime}||\leqslant||x||\leqslant(1+\varepsilon)||x^{\prime}||,\hskip 8.5359ptx\in\mathbb{R}^{2}. (16)

Since aa is a unit vector (a=1||a||=1), therefore, x=(ax)/a=ax||x^{\prime}||=(a\cdot x)/||a||=a\cdot x. Hence, we can rewrite the previous relation as following:

(ax)2x2(1+ε)2(ax)2,x2,aV2,(a\cdot x)^{2}\leqslant||x||^{2}\leqslant(1+\varepsilon)^{2}(a\cdot x)^{2},\hskip 2.84544pt\quad x\in\mathbb{R}^{2},\quad a\in V_{2}, (17)

or

(a1x1+a2x2)2(x12+x22)(1+ε)2(a1x1+a2x2)2,aV2.(a_{1}x_{1}+a_{2}x_{2})^{2}\leqslant(x_{1}^{2}+x_{2}^{2})\leqslant(1+\varepsilon)^{2}(a_{1}x_{1}+a_{2}x_{2})^{2},\hskip 8.5359pta\in V_{2}. (18)

when xix_{i} is the iith coordinate for a point xdx\in\mathbb{R}^{d}. We can expand (18) to:

(a1x1+a2x2)2++xd2(x12+x22++xd2)(1+ε)2((a1x1+a2x2)2++xd2).(a_{1}x_{1}+a_{2}x_{2})^{2}+\cdots+x_{d}^{2}\leqslant(x_{1}^{2}+x_{2}^{2}+\cdots+x_{d}^{2})\leqslant(1+\varepsilon)^{2}((a_{1}x_{1}+a_{2}x_{2})^{2}+\cdots+x_{d}^{2}). (19)

Now, define the projection πa:dd1:πa(x)=(a1x1+a2x2,x3,,xd)d1\pi_{a}:\mathbb{R}^{d}\rightarrow\mathbb{R}^{d-1}:\pi_{a}(x)=(a_{1}x_{1}+a_{2}x_{2},x_{3},\cdots,x_{d})\in\mathbb{R}^{d-1}. Then, we can rewrite relation (19) for each vector xdx\in\mathbb{R}^{d} as following:

πa(x)2x2(1+ε)2πa(x)2,aV2.||\pi_{a}(x)||^{2}\leqslant||x||^{2}\leqslant(1+\varepsilon)^{2}||\pi_{a}(x)||^{2},\hskip 5.69046pta\in V_{2}. (20)

So, since πa(pq)=πa(p)πa(q)||\pi_{a}(p-q)||=||\pi_{a}(p)||-||\pi_{a}(q)|| we have for diametrical pair (p,q)(p,q):

πa(pq)pq(1+ε)πa(pq),aV2.||\pi_{a}(p-q)||\leqslant||p-q||\leqslant(1+\varepsilon)||\pi_{a}(p-q)||,\hskip 5.69046pta\in V_{2}. (21)

Therefore, for finding a (1+O(ε))(1+O(\varepsilon))-approximation for the diameter of point set PdP\subseteq\mathbb{R}^{d}, it is sufficient that we approximate recursively the diameter of a projected point set πa(P)d1\pi_{a}(P)\subset\mathbb{R}^{d-1} over each of the vectors aV2a\in V_{2}. Then, the maximum diametrical pair computed in the recursive calls is a (1+O(ε))(1+O(\varepsilon))–approximation to the diametrical pair. Now, let us reduce the number of points from nn to O(1/εd1)O(1/\varepsilon^{d-1}) by rounding to a grid. Let we denote the required time for computing the diameter of mm points in dd-dimensional space with td(m)t_{d}(m), then for a rounded point set on a grid with m=O(1/εd1)m=O(1/\varepsilon^{d-1}) points, this approach breaks the problem into O(1/ε)O(1/\sqrt{\varepsilon}) subproblems in a (d1)(d-1) dimension. Hence, we have a recurrence td(m)=O(m+1/εtd1(O(1/εd1)))t_{d}(m)=O(m+1/\sqrt{\varepsilon}t_{d-1}(O(1/\varepsilon^{d-1}))). By assuming E=1/εE=1/\varepsilon, we can rewrite the recurrence as:

td(m)=O(m+E12td1(O(Ed1))).t_{d}(m)=O(m+E^{\frac{1}{2}}t_{d-1}(O(E^{d-1}))). (22)

This can be solved to: td(m)=O(m+Ed12)t_{d}(m)=O(m+E^{d-\frac{1}{2}}). In this case, m=O(1/εd1)m=O(1/\varepsilon^{d-1}), so, this recursive takes O(1/εd12)O(1/\varepsilon^{d-\frac{1}{2}}) time. Taking into account O(n)O(n) time, we spent for rounding to a grid at the first, Chan’s recursive approach computes a (1+O(ε))(1+O(\varepsilon))-approximation for the diameter of a set of nn points in O(n+1/εd12)O(n+1/\varepsilon^{d-\frac{1}{2}}) time [17].

In the following, we use Chan’s recursive approach in a phase of our proposed algorithm and present a modified version of it with running time O(n+1/ε2d313)O(n+1/\varepsilon^{\frac{2d}{3}-\frac{1}{3}}).

 


Algorithm 2‎: APPROXIMATE DIAMETER 2 (𝒮,ε)(\mathcal{S},\varepsilon)

 


‎ ‎ ‎Input‎: a set 𝒮\mathcal{S} of nn points in d\mathbb{R}^{d} and an error parameter ε\varepsilon.

‎Output‎: approximate diameter D~\tilde{D}.

1:   Compute the axis-parallel bounding box B(𝒮)B(\mathcal{S}) for a point set 𝒮\mathcal{S}.

2:   \ell\leftarrow Find the length of the largest side in B(𝒮)B(\mathcal{S}).

3:   Set ξε/2d\xi\leftarrow\varepsilon\ell/2\sqrt{d} and ξ2ε13/2d\xi_{2}\leftarrow\varepsilon^{\frac{1}{3}}\ell/2\sqrt{d}.

4:   𝒮^\hat{\mathcal{S}}\leftarrow Round each point of 𝒮\mathcal{S} to its central-cell point in a ξ\xi-grid.

5:   𝒮1^\hat{\mathcal{S}_{1}}\leftarrow Round each point of 𝒮^\hat{\mathcal{S}} to its nearest grid-point in a ξ2\xi_{2}-grid.

6:   D^1\hat{D}_{1}\leftarrow Compute the diameter of the point set 𝒮1^\hat{\mathcal{S}_{1}} by brute-force, and simultaneously,
        a list of the diametrical pair (p^1,q^1)(\hat{p}_{1},\hat{q}_{1}), such that D^1=p^1q^1\hat{D}_{1}=||\hat{p}_{1}-\hat{q}_{1}||.

7:   Find points of 𝒮^\hat{\mathcal{S}} which are in two hypercubes 1=2ξ2(p^1)\mathcal{B}_{1}=\mathcal{B}_{2\xi_{2}}(\hat{p}_{1}) and 2=2ξ2(q^1)\mathcal{B}_{2}=\mathcal{B}_{2\xi_{2}}(\hat{q}_{1})
    for each diametrical pair (p^1,q^1)(\hat{p}_{1},\hat{q}_{1}).

8:   D~\tilde{D}\leftarrow Compute Diam(1,2)Diam(\mathcal{B}_{1},\mathcal{B}_{2}), corresponding to each diametrical pair (p^1,q^1)(\hat{p}_{1},\hat{q}_{1})
        by using Chan’s [17] recursive approach and return the maximum value
        pq||p^{\prime}-q^{\prime}|| over all of them.

9: Output D~\tilde{D}. ‎

 

‎ ‎

Now we will analyze the running time and approximation factor of the Algorithm 2.

Theorem 4.

A (1+O(ε))(1+O(\varepsilon))-approximation for the diameter of a set of n points in dd-dimensional Euclidean space can be computed in O(n+1/ε2d313)O(n+1/\varepsilon^{\frac{2d}{3}-\frac{1}{3}}) time, where 0<ε10<\varepsilon\leqslant 1.

Proof.

As it can be seen, lines 1 to 5 of the Algorithm 2 are the same as the Algorithm 1. We do rounding to grids twice and reach to a point set 𝒮1^\hat{\mathcal{S}_{1}} in O(n)O(n) time. In this case, the number of points in rounded points set 𝒮1^\hat{\mathcal{S}_{1}} is at most:

(+ϵ2)d(ϵ2)d=(ε13/2d+1)d=(2dε13+1)d=O((2d)dεd3).\dfrac{(\ell+\epsilon_{2})^{d}}{(\epsilon_{2})^{d}}=\left(\dfrac{\ell}{\varepsilon^{\frac{1}{3}}\ell/2\sqrt{d}}+1\right)^{d}=\left(\dfrac{2\sqrt{d}}{\varepsilon^{\frac{1}{3}}}+1\right)^{d}=O\left(\dfrac{(2\sqrt{d})^{d}}{\varepsilon^{\frac{d}{3}}}\right). (23)

This can be reduced to O((2d)d/εd313)O((2\sqrt{d})^{d}/\varepsilon^{\frac{d}{3}-\frac{1}{3}}), by keeping only highest and lowest points which are the same in their (d1)(d-1) coordinates. So, for finding all diametrical pairs of the point set 𝒮1^\hat{\mathcal{S}_{1}}, we can use the quadratic brute-force algorithm with O((2d)d/εd313)2)=O((2d)2d/ε2d323)O((2\sqrt{d})^{d}/\varepsilon^{\frac{d}{3}-\frac{1}{3}})^{2})=O((2\sqrt{d})^{2d}/\varepsilon^{\frac{2d}{3}-\frac{2}{3}}) time. Then, for each diametrical pair (p^1,q^1)𝒮1^(\hat{p}_{1},\hat{q}_{1})\in\hat{\mathcal{S}_{1}}, we compute two sets 1\mathcal{B}_{1} and 2\mathcal{B}_{2} which include points of set 𝒮^\hat{\mathcal{S}} which are inside two hypercubes 2ξ2(p^1)\mathcal{B}_{2\xi_{2}}(\hat{p}_{1}) and 2ξ2(q^1)\mathcal{B}_{2\xi_{2}}(\hat{q}_{1}), respectively. Moreover, the number of points in two sets 1\mathcal{B}_{1} or 2\mathcal{B}_{2} is at most

Vol(2ξ2)Vol(ξ)=(2ε13/2d)d(ε/2d)d=(2ε13)dεd=(2)dε2d3.\dfrac{Vol(\mathcal{B}_{2\xi_{2}})}{Vol(\mathcal{B}_{\xi})}=\dfrac{(2\varepsilon^{\frac{1}{3}}\ell/2\sqrt{d})^{d}}{(\varepsilon\ell/2\sqrt{d})^{d}}=\dfrac{(2\varepsilon^{\frac{1}{3}})^{d}}{\varepsilon^{d}}=\dfrac{(2)^{d}}{\varepsilon^{\frac{2d}{3}}}. (24)

This can be reduced to O((2)d/ε2d313)O((2)^{d}/\varepsilon^{\frac{2d}{3}-\frac{1}{3}}), by keeping only highest and lowest points which are the same in their (d1)(d-1) coordinates. Now, for computing Diam(1,2)Diam(\mathcal{B}_{1},\mathcal{B}_{2}), we use Chan’s [17] recursive approach instead of using the quadratic brute-force algorithm on the point set 12\mathcal{B}_{1}\cup\mathcal{B}_{2}. On the other hand, computing the diameter on a set of O(1/ε2d313)O(1/\varepsilon^{\frac{2d}{3}-\frac{1}{3}}) points using Chan’s recursive approach takes the following recurrence based on relation (22): td(m)=O(m+1/εtd1(O(1/ε2d313)))t_{d}(m)=O(m+1/\sqrt{\varepsilon}t_{d-1}(O(1/\varepsilon^{\frac{2d}{3}-\frac{1}{3}}))). By assuming E=1/εE=1/\varepsilon, we can rewrite the recurrence as:

td(m)=O(m+E12td1(O(E2d313))).t_{d}(m)=O(m+E^{\frac{1}{2}}t_{d-1}(O(E^{\frac{2d}{3}-\frac{1}{3}}))). (25)

This can be solved to: td(m)=O(m+E2d312)t_{d}(m)=O(m+E^{\frac{2d}{3}-\frac{1}{2}}). In this case, m=O(E2d313)m=O(E^{\frac{2d}{3}-\frac{1}{3}}), so, this recursive takes O(E2d313+E2d312)=O(1/ε2d313)O(E^{\frac{2d}{3}-\frac{1}{3}}+E^{\frac{2d}{3}-\frac{1}{2}})=O(1/\varepsilon^{\frac{2d}{3}-\frac{1}{3}}) time. Also, if we have more than one diametrical pair (p^1,q^1)(\hat{p}_{1},\hat{q}_{1}) in point set 𝒮1^\hat{\mathcal{S}_{1}}, then this step takes at most O((2d)(2)d/ε2d313)=O(22d/ε2d313)O((2^{d})(2)^{d}/\varepsilon^{\frac{2d}{3}-\frac{1}{3}})=O(2^{2d}/\varepsilon^{\frac{2d}{3}-\frac{1}{3}}) time. Therefore, we can write the complexity time of the algorithm as following:

Td(n)=O(dn)+O(dn)+O((2d)2dε2d323)+O(2ddn)+O(22dε2d313),T_{d}(n)=O(dn)+O(dn)+O\left(\dfrac{(2\sqrt{d})^{2d}}{\varepsilon^{\frac{2d}{3}-\frac{2}{3}}}\right)+O(2^{d}dn)+O\left(\dfrac{2^{2d}}{\varepsilon^{\frac{2d}{3}-\frac{1}{3}}}\right),
O(2ddn)+O((2d)2dε2d313),\quad\hskip 5.69046pt\leqslant O(2^{d}dn)+O\left(\dfrac{(2\sqrt{d})^{2d}}{\varepsilon^{\frac{2d}{3}-\frac{1}{3}}}\right),
=O(2ddn+(2d)2dε2d313).=O\left(2^{d}dn+\dfrac{(2\sqrt{d})^{2d}}{\varepsilon^{\frac{2d}{3}-\frac{1}{3}}}\right). (26)

Since dd is fixed, we have:

Td(n)=O(n+1ε2d313).T_{d}(n)=O\left(n+\dfrac{1}{\varepsilon^{\frac{2d}{3}-\frac{1}{3}}}\right). (27)

In addition, Chan’s recursive approach in line 8 of the Algorithm 2 returns a diametrical pair (p,q)(p^{\prime},q^{\prime}) which is a (1+O(ε))(1+O(\varepsilon))-approximation for the diametrical pair (p^,q^)𝒮^(\hat{p},\hat{q})\in\hat{\mathcal{S}}. This means that:

pqp^q^(1+O(ε))pq.||p^{\prime}-q^{\prime}||\leqslant||\hat{p}-\hat{q}||\leqslant(1+O(\varepsilon))||p^{\prime}-q^{\prime}||. (28)

Moreover, the diametrical pair (p^,q^)(\hat{p},\hat{q}) is an approximation of the true diametrical pair (p,q)𝒮(p,q)\in\mathcal{S}, and according to relation (10), we have:

pqp^q^+ε/2(1+ε)pq.||p-q||\leqslant||\hat{p}-\hat{q}||+\varepsilon\ell/2\leqslant(1+\varepsilon)||p-q||. (29)

Hence, from (28) and (29) we can result:

pqp^q^+ε/2,||p-q||\leqslant||\hat{p}-\hat{q}||+\varepsilon\ell/2,
p^q^+εp^q^,\hskip 5.69046pt\qquad\qquad\quad\leqslant||\hat{p}-\hat{q}||+\varepsilon||\hat{p}-\hat{q}||,
(1+ε)p^q^,\hskip 5.69046pt\qquad\quad\leqslant(1+\varepsilon)||\hat{p}-\hat{q}||,
(1+ε)((1+O(ε))pq),\hskip 5.69046pt\qquad\qquad\qquad\qquad\quad\leqslant(1+\varepsilon)((1+O(\varepsilon))||p^{\prime}-q^{\prime}||),
(1+O(ε))pq.\qquad\qquad\qquad\leqslant(1+O(\varepsilon))||p^{\prime}-q^{\prime}||. (30)

So, Algorithm 2 finds a (1+O(ε))(1+O(\varepsilon))-approximation of the diameter of a point set 𝒮\mathcal{S} of nn points in O(n+1/ε2d313)O(n+1/\varepsilon^{\frac{2d}{3}-\frac{1}{3}}) time. Therefore, this completes the proof. ∎

3 Conclusion

We have presented a new (1+ε)(1+\varepsilon)-approximation algorithm to compute the diameter of a point set 𝒮\mathcal{S} of nn points in d\mathbb{R}^{d} for a fixed dimension dd in O(n+1/εd1)O(n+1/\varepsilon^{d-1}) time, where 0<ε10<\varepsilon\leqslant 1. Moreover, we show that the proposed algorithm can be modified to a (1+O(ε))(1+O(\varepsilon))-approximation algorithm with O(n+1/ε2d313)O(n+1/\varepsilon^{\frac{2d}{3}-\frac{1}{3}}) time. Our proposed algorithms provide some improvements in comparison with existing algorithms in terms of simplicity, understanding and data structure.

References

  • [1] Preparata, F. P., Shamos, M. I.: Computational Geometry: an Introduction. New York, Springer-Verlag, pp. 176-182, (1985)
  • [2] Yao, A. C.: On constructing minimum spanning trees in kk-dimensional spaces and related problems. SIAM Journal on Computing, 11, pp. 721-736, (1982)
  • [3] Clarkson, K. L., Shor, P. W.: Applications of random sampling in computational geometry. Discrete and Computational Geometry, 4, pp. 387-421, (1989)
  • [4] Amato, N. M., Goodrich, M. T., Ramos, E. A.: Parallel algorithms for higher dimensional convex hulls. In Proceedings of the 35th annual Symposium on Foundations of Computer Science, pp. 683-694, (1994)
  • [5] Ramos, E. A.: Intersection of unit-balls and diameter of a point set in 3\mathbb{R}^{3}. Computational Geometry: Theory and Applications, 8, pp. 57-65, (1997)
  • [6] Ramos, E. A.: Construction of 1-d lower envelopes and applications. In Proceedings of the 13th annual ACM Symposium on Computational Geometry (SoCG’97), pp. 57-66, (1997)
  • [7] Bespamyatnikh, S.: An efficient algorithm for the three-dimensional diameter problem. Discrete and Computational Geometry, 25(2), pp. 235-255, (2001)
  • [8] Ramos, E. A.: Deterministic algorithms for 3-D diameter and some 2-D lower envelopes. In Proceedings of the 16th annual Symposium on Computational Geometry (SoCG’00), (2000)
  • [9] Ramos E. A.: An optimal deterministic algorithm for computing the diameter of a three-dimensional point set. Discrete and Computational Geometry, 26, pp. 245-265, (2001)
  • [10] Cheong, O, Shin, C. S., Vigneron A.: Computing farthest neighbors on a convex polytope. In Proceedings of the 7th Annual International Computational and Combinatoric Conference, pp. 159-169, (2001)
  • [11] Egecioglu, O., Kalantari B.: Approximating the diameter of a set of points in the Euclidean space. Information Processing Letters, 32(4), pp. 205-211, (1989)
  • [12] Agarwal, P. K., Matousek, J. , Suri, S.: Farthest neighbors maximum spanning trees and related problems in higher dimensions. Computational Geometry: Theory and Applications, 1, pp. 189-201, (1992)
  • [13] Barequet, G., Har-Peled, S.: Efficiently approximating the minimum-volume bounding box of a point set in three dimensions. Journal of Algorithms, 38, pp. 91-109, (2001)
  • [14] Har-Peled, S.: A practical approach for computing the diameter of a point set. In Proceedings of the 17th annual Symposium on Computational Geometry (SoCG’01), pp. 177-186, (2001)
  • [15] Malandain, G. , Boissonnat, J. D.: Computing the diameter of a point set. International Journal of Computational Geometry and Applications, 12(6), pp. 489-509, (2002)
  • [16] Finocchiaro, D. V., Pellegrini, M.: On computing the diameter of a point set in high dimensional Euclidean space. Theoretical Computer Science, 287, pp. 501-514, (2002)
  • [17] Chan, T. M.: Approximating the diameter, width, smallest enclosing cylinder, and minimum-width annulus. International Journal of Computational Geometry and Applications, pp. 67-85, (2002)
  • [18] Chan, T. M.: Faster core-set constructions and data stream algorithms in fixed dimensions. Computational Geometry: Theory and Applications, 35, pp. 20-35, (2006)
  • [19] Chan, T. M.: Applications of Chebyshev polynomials to low-dimensional computational geometry. In Proceedings of the 33rd International Symposium on Computational Geometry (SoCG’17), pages 26:1-15, (2017)
  • [20] Arya, S., da Fonseca, G. D., Mount, D. M.: Near-optimal ε\varepsilon-kernel construction and related problems. In Proceedings of the 33rd International Symposium on Computational Geometry (SoCG’17), pages 10:1-15, (2017)