JID:TCS AID:10841 /FLA
Doctopic: Algorithms, automata, complexity and games
[m3G; v1.185; Prn:26/08/2016; 11:54] P.1 (1-11)
Theoretical Computer Science ••• (••••) •••–•••
Contents lists available at ScienceDirect
Theoretical Computer Science www.elsevier.com/locate/tcs
The approximation algorithms for a class of multiple-choice problem Yin Wang a,∗ , Yinfeng Xu a,b a b
School of Management, Xi’an Jiaotong University, Xi’an, Shaanxi 710049, China The State Key Lab for Manufacturing Systems Engineering, Xi’an, Shaanxi 710049, China
a r t i c l e
i n f o
Article history: Received 31 October 2015 Received in revised form 21 June 2016 Accepted 23 June 2016 Available online xxxx Keywords: Color-spanning objects Computational geometry Approximation algorithm The smallest enclosing problem
a b s t r a c t Given a set of n points, which is a unit set of m colored sets, we study the minimum circle to cover one of each colored set at least. In this paper, we study some problems of optimizing some properties of color-spanning set. Firstly, we show a way to find a colorspanning set for each point and constitute a union of color-spanning sets without FCVD (The Farthest Color Voronoi Diagram). The approach to find each color-spanning set is based on the nearest neighbor points which have different colors. For every color-spanning set, we can find a enclosing circle to cover all points of each color-spanning set, which is a good approximate for MDCS (The Minimum Diameter Color-Spanning Set) problem. We propose an approximation algorithm for the SECSC (The Smallest Color-Spanning Circle) problem with 2-factor approximation result. For | P | = n and | Q | = m, the worst running time of our algorithm is O (n2 ). Although these results are not as good as previous results with FCVD, the performance of our algorithms in R d is much better than others. Moreover, an approximation algorithm can solve problem of minimum perimeter of the √ color-spanning set faster with time of O (n2 + nm log n) and ratio 6. This result improved the ratio with only a little cost of time complexity. At last, we give an example for the 2-center SECSC problem. A fast computation of 2-center enclosing circle is proposed with time of O (n2 ), but the ratio depends on the gap between the nearest distinct colored distance. © 2016 Published by Elsevier B.V.
1. Introduction Background. The multiple-choice problems arise from the research about minimum diameter covering problem of Arkin and Hassin [1]. Supposing a set V together with subsets S 1 , ..., S m is given, the cover is a subset of V containing at least one representative from each subset. In this paper, we consider the problem dealing with covering color classes, which is related to a class of multiple-choice problems. This kind of problems has been studied extensively due to wide applications in many areas such as facility location, statistical clustering, pattern recognition and data management in terrains and wireless networks [2–4]. The cover is always measure by different type of regions. Related works. The enclosing circle problem was originally posed by Sylvester [5]. The goal of this classic problem is to find the smallest circle which can enclose a given point set. Dobkin et al. [6] and Overmas et al. [7] treated the problems of
*
Corresponding author. E-mail address:
[email protected] (Y. Wang).
http://dx.doi.org/10.1016/j.tcs.2016.06.038 0304-3975/© 2016 Published by Elsevier B.V.
JID:TCS AID:10841 /FLA
Doctopic: Algorithms, automata, complexity and games
2
[m3G; v1.185; Prn:26/08/2016; 11:54] P.2 (1-11)
Y. Wang, Y. Xu / Theoretical Computer Science ••• (••••) •••–•••
finding minimum perimeter convex k-gons. Their O (k2 n log n + k5 n) algorithm result was improved to O (n log n + k5 n) by Aggarwal et al. [8]. However, the multiple-choice problem should cover each given subset but not all given elements. An interesting various problem is proposed by T. Graf and K. Hinrichs [9] and Abellanas et al. [4] named it as “color-spanning set”. Given a set of n points, which is a unit set of m colored sets, we study the minimum diameter of the set covering at least one of each colored set. Some papers focus on computing the smallest color-spanning regions (such as disk, rectangle, equilateral triangle, convex hull and so on) such that some properties of the color-spanning set are optimal. Abellanas et al. [4] showed an algorithm for smallest color-spanning objects of axis-parallel rectangle and the narrowest strip. In the research about FCVD (The Farthest Color Voronoi Diagram) by Abellanas et al. [10], they proposed the circle with minimum diameter can be computed with time of O (nk) when k ≤ (n/2), after the FCVD is provided using time O (n2 (k) log k). Without help of FCVD, it costs O ((k3 )n log n) to get the smallest disk to cover all colors. Under the condition of k ≤ n2 , Eppstein et al. [11] studied the smallest polygons and proposed a O (n2 log n) time algorithms using the Farthest color Voronoi diagram. If the colored points are in general position, it is proved to be NP-hard for some problems. Rudolf Fleischer and Xiaoming Xu [12,13] show that the minimum diameter color-spanning set problem is NP-hard, and proposed that the smallest color-spanning disk is a good approximation for the minimum-diameter rainbow set with ratio 2 for any d-dimensional space. Two constant factor approximation algorithms were proposed for the minimum perimeter of the convex hull by Wenqi 2 2 Ju √ et al. [14]. And their algorithms cost time of O (n + nm log m) and O(min{n(n − m) , nm (n − m)}) with the ratio of π and 2 respectively. However, as well as some other variants of these problems are based on the smallest polygons but Morton et al. [15] proved that such k-gons might not exist for k > 7. Some versions of this problem come up with changing some parameters of the problem, such as the number of colors [16], the number of members in each color set [17,18], the dimension of the graphic object [19,20]. Some others proposed versions of this problem with constraint were proposed (Kamrmakar et al. [21]) and solved by the polynomial time algorithms. Zhang et al. [22] showed a brute force algorithm with O (nk ) time for the MDCS problem (The Minimum Diameter Color-Spanning Set). Interestingly, the approach in paper of Eppstein et al. [23] for the smallest polytopes, like the group Steiner tree by Graf et al. [9] and Wenqi Ju et al. [14], is based on the nearest neighbors. In this paper, for each point, we consider the nearest neighbor point which has different color firstly. Then we can find a color-spanning set based on these nearest neighbors. Our purpose is to find the minimum diameter of these subsets. Our results. In this paper, we study some problems of optimizing some properties of color-spanning set. Firstly, we show a way to find a color-spanning set for each point and constitute a union of color-spanning sets without FCVD. Then, for every color-spanning set, we can find an enclosing circle to cover all points of each color-spanning set. Therefore, an approximation algorithm to compute the minimum diameter of the convex hull with the solution of SECSC (Smallest Enclosing Color-Spanning Circle) is proposed with the time of O (n2 ) at most. The approximation ratios of these algorithms are less than 2. Although these results are seen not better than previous results, the performance of our algorithms in R d is much better than others. Moreover, based on these works, an approximation algorithm can solve problem of minimum perimeter √ of the color-spanning set faster with time of O (n2 + nm log n) and ratio 6. This result improved the ratio with only a little cost of time complexity. At last, we give an example for the 2-center SECSC problem, which is aimed to find the solution that makes the radius of the larger one of these two enclosing circle is minimum. Based on the approximation above, a fast computation of 2-center enclosing circle is proposed with time of O (n log n), but the ratio of this approximation algorithm depends on the gap between the nearest distinct colored distance. 2. Preliminaries and definitions 2.1. The color-spanning set Here, a point set P = ( p 1 , p 2 , ..., p j , ..., pn ) of n points on a plane and a color set Q = (q1 , q2 , ..., qi , ..., qm ) of m colors are given. We assume one point has and only has one of the given m colors and the number of colors m is fixed. Therefore, two properties of each point are its position and its color. Definition 1. Let us call a region color-spanning if it contains at least one point of each color. That is to say, a point set S can be a color-spanning set iff its points belong to P and its color set equal to Q . We assume the Euclidean distance between arbitrary two points is given. Therefore, for arbitrary point, the distance to its adjoining points can been certain. Problem definition. An illustrative way to describe our basic problem is as follows: given a point set of n points with m colors, where each point has and only has one of the m colors, and a query a = (a1 , ..., ai , ..., am ), where ai is a integer for each 1 ≤ i ≤ m, the points in a color-spanning set comes from at least ai points of each color i. The minimum problem of color-spanning set aims to optimal some properties of the color-spanning region to cover at least ai (1 ≤ ai < m) points
JID:TCS AID:10841 /FLA
Doctopic: Algorithms, automata, complexity and games
[m3G; v1.185; Prn:26/08/2016; 11:54] P.3 (1-11)
Y. Wang, Y. Xu / Theoretical Computer Science ••• (••••) •••–•••
3
with each color i and all colors can be found in this region. Three goals are discussed in this paper: the SECS problem (the Smallest Enclosing Color-Spanning Circle problem), the MDCS problem (the Planar Smallest Diameter) and the PSPCHCS Problem (the Perimeter Convex Hull Color-Spanning Set problem). 2.2. Preliminaries Some geometry properties of color-spanning set, including the diameter of convex hull, the smallest enclosing circle, and the perimeter of convex hull, were discussed. The convex hull mentioned here should satisfy that all points belong to this convex hull can cover all given colors. The perimeter of a convex hull is the sum of the length of all edges on the convex hull. Theorem of Hocking–Young (1961). The diameter of a set is equal to the diameter of its convex hull. That is to say, computing its diameter is to find two points in this convex hull that are farthest apart. Barba et al. [18] show the running time of O (n2(d−1) kd) construct the k-th order Voronoi diagram in R d and solve the SECSC and MDCS problems. When the dimension is not less than 3, as the complexity of computing the k-th order Voronoi diagram arises, the complexity of their algorithm becomes larger. Our paper would like to discuss methods without FCVD. 3. Algorithms for SECSC and MDCS without FCVD As we know, the point set can be a color-spanning set iff all colors can be covered by a colored-point set. We attempt to find a subset V j of P based on each point p j in P . We present a screening rule, which selected points in each V j from the nearest neighbor point in every color class q i but the one p j belongs to. The search will stop when all color class in Q has been successfully traversed. All in all, we can deduce that the color points in each color-spanning set should satisfy two constraints: closest to initial point p j in each color set q i and cover all m colors. 3.1. An method to construct color-spanning sets Input: for each point P j , we have a interval sequence which is composed by distance between point P j and all other points; Output: a point set with m kinds of different colors for each P j . Algorithm 1 Find a color-spanning set with center on P j .
1: 2: 3: 4: 5: 6: 7: 8:
For i = 1; i <= m; i + +; For j = 1; j <= n; j + +; for all color sets qi except q j , where the center P j belongs to do for all points in qi do find the nearest point to initial point p j in color set qi if a point is the nearest one to p j in color set q x then save this point as pk and add it to point set V j . Their distance to p j save as dk , where k = 1, 2, ..., m. end if end for end for
For n points with m colors, the Algorithm 1 above can constitute a color-spanning point set for each p j . We can find some properties for the color-spanning set which is computed by Algorithm 1 above. Definition 2. By Algorithm 1, we can get the rainbow circles of this color-spanning set. The rainbow circle set of each color-spanning set V j is defined as a group of concentric circles with radius of dk . Seen in Fig. 1. Thus, we have the following result. Theorem 1. The complexity for constituting rainbow circle and a color-spanning set V j for all given points of P is O (n2 ). For every rainbow circle sorted by k, there is k colors covered by the colored circle ck , and the point pk is the only one in ck with the color of circle ck . Proof. Each point can be the initial point p j of n possible color-spanning sets. Otherwise, we need time O (n) to find the nearest point to p j in each color set. Therefore, it spends O (n2 ) to constitute all n color-spanning sets at most. The center of these circles is the initial point p j . The radius of ck is equal to dk . If the distance between any point and p j is less than the radius of ck , the color of this point is covered by ck . According to Algorithm 1, there are k points contained in circle ck on this condition. Besides, all these points have different colors as the definition of V j . We can know the cm−1 and cm−2 are the largest and second largest circle in each set of rainbow circles from Definition 2. According to Lemma 1, the circle cm−1 of each p j contains all given m colors.
JID:TCS AID:10841 /FLA
4
Doctopic: Algorithms, automata, complexity and games
[m3G; v1.185; Prn:26/08/2016; 11:54] P.4 (1-11)
Y. Wang, Y. Xu / Theoretical Computer Science ••• (••••) •••–•••
Fig. 1. The rainbow circles for each p j .
Fig. 2. Case 1.
Let the color of circle cm−1 be x. If there is any point with color x inside the rainbow circle cm−1 , the point pm−1 cannot be the nearest to p j with color x. 2 3.2. An approximation algorithm for SECSC problem without FCVD Our aim is to cover all m given colors using the smallest enclosing circle. We consider one of the n points briefly. By that analogy, the others can be computed by the same way. The approach to find each color-spanning set is based on the nearest neighbor points which have different colors. Finally, the smallest one of these n color-spanning circles is our solution. We show a 2-factor algorithm to find the smallest circle to cover them. 3.3. The upper bound and lower bound of the SECSC problem According to the conclusions above, we know each c j can contain all given m colors. In each c j , pm−1 and pm−2 is always on the boundary. Shown in the Fig. 2, we can find the position of each point in A decides the optimal circle. The location and color of each point are fixed and given in this paper. Therefore, three cases of the possible position of all point in A are existed. We do not think about the region outside the rainbow circle cm−1 for each V j . Case 1: The projection on L j of pm−2 is on the left of p j , just like the Fig. 2. Let pm−2 be the projection of pm−2 . The radius of c j , which is saved as d j , should be equal to the distance of pm−2 and its center o j . It can be show as:
JID:TCS AID:10841 /FLA
Doctopic: Algorithms, automata, complexity and games
Y. Wang, Y. Xu / Theoretical Computer Science ••• (••••) •••–•••
[m3G; v1.185; Prn:26/08/2016; 11:54] P.5 (1-11)
5
Fig. 3. Case 2.
r j = d j /2 = o j pm−2 And if the pm−2 should not be out of circle c j , then
dm−2 = p j pm−2 ≥ p j pm−2 . If and only if the equality hold up, we can get the minimum of the radius. That means,
r j = |o j pm−2 | = |o j pm−2 | Therefore, when the position of pm−2 is overlap with the point p j , we can find the worst case of the circle c j . The diameter of the smallest c j is the minimal value under the worst case. Case 2: Denote the pk as any point in A between p j and pm−1 . As dm−1 ≥ dm−2 , the minimum of this radius should not be less than dm−1 . The optimal diameter is the minimal value of dm−1 and save as dt . Seen in Fig. 3. Case 3: When not all points in A satisfy
d p m −1 p k 2 ≤ d p j p m −1 2 − d p j p k 2 and their projections is not on the right of p j but the point pm−2 . Seen in Fig. 4. The argument for case 3 is quite similar to the proof of case 1. If the diameter of circle is less than dm−1 , it is certain that the points whose projection is on the right of p j cannot be covered by this circle. Therefore, the optimal diameter in cases should be more than dt in case 2 but less than the d s . The maximum value of the four cases is the finally worst case of each color-spanning set of p j . As the result, we can prove the worst case is the situation where pm−2 , p j and pm−1 are on one line L j . 3.4. A 2-factor approximation algorithm of SECSC We propose a 2-factor approximation algorithms of the SECSC Problem. The SECSC Problem aims at finding a smallest enclosing circle to make all points in this circle contain all given colors. Definition 3. We call a circle color-spanning if all points in this circle contains at least one of each color set q i ∈ Q . The objective is to find the minimum diameter circle c s to cover a color-spanning set. Meanwhile, this circle should meet the following conditions: (1) covering all the points in color-spanning set, (2) having the minimum diameter, (3) containing m given colors. From all above, we can define this problem to find the minimum diameter of this circle as the smallest enclosing color-spanning circle (SECSC) problem. Theorem 2. The SECSC problem can be approximated within a factor of 2. Proof. According to the analysis of case 1 above, when the pm−2 and pm−2 in circle c s is overlap, r ( A ) = 1. Moreover, in case 2, if a circle with radius of
dm−1 2
is satisfied center at middle of p j and pm−1 , all points of V j can be covered. As a
JID:TCS AID:10841 /FLA
Doctopic: Algorithms, automata, complexity and games
[m3G; v1.185; Prn:26/08/2016; 11:54] P.6 (1-11)
Y. Wang, Y. Xu / Theoretical Computer Science ••• (••••) •••–•••
6
Fig. 4. Case 3.
Algorithm 2 An approximation algorithm. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
For given n point for all initial point p j do for all points in V j do save the furthest one to p j as pm−1 and define their interval as dm−1 ; end for for all points in V j except pm−1 do save the furthest one to p j as pm−2 and define their interval as dm−2 ; end for for all pm−1 and pm−2 of p j do compute d j = dm−1 + dm−2 end for end for for all d j do compute the minimal one and save as ds = min {dm−1 + dm−2 } end for
result, r ( A ) = 2. Therefore, we can know the approximation ratio is between 1 and 2 and depends on the ratio of dm−1 and dm−2 of the circle r s . We compute the approximation ratio r ( A ) as follows.
r ( A ) = sup I
A (I ) opt ( I )
As the argument of case 1 and case 2, we have the conclusion as below.
r ( A) =
min {dm−1 + dm−2 } min {dm−1 }
Because d s is the minimum value of d j , the sum of min {dm−1 } and dm−2 mindm−1 can not be more than d s . dm−2 mindm−1 means the dm−2 in the circle ct . Then,
r ( A) ≤
min {dm−1 } + dm−2 mindm−1 min {dm−1 }
=1+
dm−1 dm−1
min dm−1
As dm−2 is not always more than dm−1 in each V j , we have the conclusion:
r ( A ) ≤ 2. Algorithm 2 finds a cover of diameter at most twice the optimal one.
2
Theorem 3. The time complexity for computing the approximation solution of the minimum circle color-spanning set is O (n2).
JID:TCS AID:10841 /FLA
Doctopic: Algorithms, automata, complexity and games
[m3G; v1.185; Prn:26/08/2016; 11:54] P.7 (1-11)
Y. Wang, Y. Xu / Theoretical Computer Science ••• (••••) •••–•••
7
Proof. According to Algorithm 1, all n initial points run less than O (n2 ) time to find their point sets V j . The time of computing the sum of dm−1 and dm−2 of each V j is O(1). However, the number of initial point p j is n, such that we can get n color-spanning sets V j . As a result, traversal of all initial points still need n times. Furthermore, it spend O (n2 ) to find the smallest one. Then, we know
O (n) = T (n2 + n ∗ (1)) = O (n2 ) As the result, the time complexity of this approximation algorithm is O (n2 ).
2
3.5. An approximation algorithm for MDCS problem without FCVD The approximation algorithm for SECSC is a good and fast approximate for MDCS problem. Given n points with m colors in R d , selecting some points with m distinct colors in the neighborhood, such that the diameter of set is minimum. This is the description of MDCS. For d > 2 and ai > 1, our algorithm is much simpler and the complexity is still less than O (n2 ). Theorem 4. The time complexity for computing the approximation solution of the minimum color-spanning set is O (n2) when d = 3 and ai > 1. The ratio is less than 2 when d = 3. Proof. If the distance between arbitrary two points is Euclidean distance, the furthest distinct-colored neighborhood has no difference with dm−1 in R 2 , so does the dm−2 . The upper bound of the diameter of convex hull can’t more than their sum d s = min {dm−1 + dm−2 }. The other colored sets exist at least ai points whose distance to the initial point is less than d s . For each points, O (n) is needs to read value of distance and color. O (n) is needed to compute the furthest distinct-colored points and the one next to the furthest one. There are ai points of each color set q i . The search time does not change, so does the time to select the furthest one to initial point. m colors takes time of O (mai ), which is less than O (n). There are n points, therefore n times of steps above is needed. And find the smallest one need O (n) finally. Then, we know
O (n) = T (n2 + n ∗ (1) + n) = O (n2 ) As the result, the time complexity of this approximation algorithm is O (n2 ). The worst case for this algorithm is all points is inside or on the ball with diameter of min dm−1 . In this case, the furthest distance between arbitrary two points is min dm−1 with this two endpoints on the ball. On the other hand, if a diameter less than min dm−1 existed, there must be at least one color cannot be contain as Theorem 1 illustrated. Because of dm−2 ≤ dm−1 , the ratio is not more than 2. 2 4. An approximation algorithm for PSPCHCS problem 4.1. The PSPCHCS problem Problem description. Wenqi Ju et al. [14] study the problem of the planar smallest perimeter convex hull color-spanning set (PSPCHCS), which aims to find the minimum perimeter of the planar convex hull over the selected m distinct-colored √ points. They proved the NP-completeness of this problem and proposed two approximation algorithms with ratio π and 2 2 2 and complexity of O (n + nm log m) and O(min{n(n − m) , nm (n − m)}). Our algorithm for PSPCHCS improved respectively √ the ratio to 6 but cost the time of O (n2 + nm log n), which is much less than the complexity
O(min{n(n − m)2 , nm (n − m)}) √
of ratio 2. For the purpose of covering all colors, our algorithm for PSPCHCS is a modified version of the Bentley–Faust–Preparata’s algorithm [24], which is an exchange for simplicity and performance. A basic and simple idea of their technique is to sample some subsets of the given points and then use the convex hull of the sample as an approximation to the real convex hull. However, a basic and important aim of our PSPCHCS problem is cover all colors. As we know, some points may be ignored by the sample of their algorithm, so do some colors. The simplicity and efficiency of the described algorithm would be of little value if the result were grossly inaccurate. Therefore, it is necessary to revise the results from their technique. Let C H s∗ be the approximate hull which is based on the sample of given points. The true convex hull of given point set s can be marked as C H s . Their perimeter are noted as per s∗ and per s . Notation. Let C H s∗ be the approximate hull which is based on the sample of given points. The true convex hull of given point set s can be marked as C H s . Their perimeter are noted as per s∗ and per s . Let C replace the special point p which belongs to given color-spanning set in true convex hull but excluded by its approximation convex hull C H s∗ . The substitution points of C in approximation one C H s∗ are marked by A and B, the edge e ( A , B ) be the corresponding edge. It is easy to see the length between A and B is no less than the Euclidean distance between these two points.
JID:TCS AID:10841 /FLA
Doctopic: Algorithms, automata, complexity and games
[m3G; v1.185; Prn:26/08/2016; 11:54] P.8 (1-11)
Y. Wang, Y. Xu / Theoretical Computer Science ••• (••••) •••–•••
8
Fig. 5. Steps of algorithm for PSPCHCS.
4.2. The algorithm and its performance It is helpful to know how far outside of the approximate hull can a point of the original given point set. Theorem of Preparata–Shamos (1985). Any point p belonging to set s that is not inside the approximate convex hull is within distance (xmax − xmin )/k of the hull [24]. Replace the value of (xmax − xmin )/k with x/k. As a result, after judging whether m given colors is concluded by C H s∗ , we adjust per s∗ to a new value named as per s j . As we know the distance between arbitrary two points, so finding the nearest point noted as C with missed color qc is easy with the results of Algorithm 1. Let edge e ( A , B ) be the corresponding edge and use the sum of e ( A , C ) and e ( B , C ) replace it. Finally, the length of the new edges is our approximate result. Note them as per s j for each color-spanning set V j by Algorithm 1. For each given color-spanning set, let the line where P 0 and P m−1 belong to as x-axis and origin of coordinates is at the center of the approximation circle by Algorithm 2. The rectangular coordinate system is set up and we know the maximum of (xmax − xmin ) is (dm−1 + dm−2 ) for each V j . After preprocess of Algorithm 1 or Algorithm 2, our algorithm for PSPCHCS can be list as follows and shown in Fig. 5. Algorithm 3 An approximation algorithm for PSPCHCS.
3:
6:
9:
12:
15:
For given n point for all color-spanning set V j do for all points in V j do save the furthest one to p j as pm−1 and define their interval as dm−1 ; let xmax as d j /2 = (dm−1 + dm−2 )/2 and find xmin . Divide the vertical strip between them into k equally spaced trips T j = ( T 1 , ..., T t , ..., T k ) for all trips of T j do Find 2 points with ymax and ymin as the maximum and minimum y-values. end for save the points with extreme x-values if there are more than 2 points with extreme x-value then save both their maximum and minimum y-values. end if end for based on the s∗j with 2k + 4 points of V j , construct C H s∗ and compute per s∗ for all points in V j but s∗j do find the nearest point noted as C with neglected color qc and its nearest edge of C H s∗ with endpoints A and B, replace the length of e ( A , B ) with the sum of e ( A , C ) and e ( B , C ). Compute per s j end for end for for all per s j do compute the minimal one and save as perapp end for
√
Theorem 5. There is a 6-approximation algorithm for PSPCHCS with a running time of O (n2 + nm log n), which k is the number of divided equally spaced trips, where 2 < k < m.
JID:TCS AID:10841 /FLA
Doctopic: Algorithms, automata, complexity and games
Y. Wang, Y. Xu / Theoretical Computer Science ••• (••••) •••–•••
[m3G; v1.185; Prn:26/08/2016; 11:54] P.9 (1-11)
9
Fig. 6. Proof of algorithm for PSPCHCS.
Proof. According to Theorem 1, finding a color-spanning set for each point costs time of O (n2 ) without FCVD. For each color-spanning set V j , according to Bentley–Faust–Preparata’s algorithm, each C H s∗ can be get within time of O (n + k), where n is the number of points in V j . Meanwhile, there are m points in each V j , the time cost is not O (n + k) but O (m + k). On the other hand, we need O (m log m) to construct C H s∗ , and O (m log n) to judge whether m colors are in C H s∗ . Based on the method of nearest distinct-colored points of Algorithm 1, read and replace the length of edges only need time of O (1). The running time of finding out the other n − 1 V j is n times of O (m + k + m log m + m log n + 1). To find the minimum one of the n per s j needs time of n. Therefore, the totally running time is O (n2 + nm + nk + nm(log n + log m)). Because of k <= m < n, we can get the complexity as O (n2 + nm log n). Next, we will prove the approximation ratio. We compute the approximation ratio r ( A ) as follows, where u(c) replaces the change value of perimeter of C H s∗ when color c added to s∗ .
r ( A ) = sup r ( A) =
A (I )
I opt ( I ) perapp
peropt
min per j + r ( A ) <=
m −1 c =1
min per j
u (c )|qc
The proof is based on the Theorem of Preparata–Shamos (1985), which gives an upper bound of the distance between any point p belonging to set V j that is not inside the approximate convex hull C H s . Let C mark the special point P . The distance between a point and a convex hull is either the distance between this point and the nearest vertex of convex hull, as d = d(C , A ) of case 1, or the distance of this point to the nearest edge of convex hull, saved as d = d(C , A B ) in case 2. A and B are adjacent vertexes of C H s∗ and they are the nearest two points to C . Supposing all points in approximate hull C H s∗ is in true hull C H opt . Shown in Fig. 6. In the color-spanning set V opt of the true hull C H opt , let its approximate hull be C H app |opt . In case 1, the nearest distance of C and C H s∗ is equal to the distance between this point and the nearest vertex of convex hull, as d = d(C , B ). We find A BC is an obtuse triangle. In this case, B is replaced by C . With help of the properties of triangles, it is obvious that when the A BC = A B D = 3π /4, where D is the another adjacent vertex with B of C H s∗ , the length gap between | AC | + |C D | and | A B | + | B D | is maximum, so is the value of approximation ratio. Then, according to law of cosines, we can compute the length of e ( A , C ) or e (C , D ) as below.
|C D |2 = |C B |2 + | B D |2 −2|C B | ∗ | B D | ∗ cos A BC √ √ ≤ 2| B D |2 − 2 ∗ | B D |2 ∗ (− 2/2) = (2 + 2)| B D |. So, we can get the ratio by
r ( A ) = max
√ √ {| AC | + |C D |} ≤ 2( 2 + 2)/2 = 2 + 2 {| A B | + | B D |}
We can find A BC is not an obtuse triangle in case 2 and the region of possible positions of C is shown in Fig. 6(b). By the properties of the triangle, fixed length of edge e ( A , B ), we know when the | AC | = | A B |, the length of the sum of edge e ( A , C ) and edge e ( B , C ) is maximum. Then, according to the Pythagorean proposition, we have
JID:TCS AID:10841 /FLA
Doctopic: Algorithms, automata, complexity and games
[m3G; v1.185; Prn:26/08/2016; 11:54] P.10 (1-11)
Y. Wang, Y. Xu / Theoretical Computer Science ••• (••••) •••–•••
10
√
max (| AC | + | BC |)/| A B | ≤ 2| AC |/| A B | ≤ 2| A B |2 + 4(x/k)2 /| A B | = 6 √ √ √ All in all, the minimum value of 2 + 2 and 6 is 6. As the argument of case 1 and case 2, we have the conclusion √ of the ratio of our approximation algorithm is 6. 2 5. An example of the 2-center SECSC problem 5.1. The 2-center SECSC problem Definition 5. Given a set of n points on a plane, where each point has one of m colors, where the number of colors is fixed. The 2-center smallest enclosing color-spanning circles problem (2-center SECSC Problem) aims at finding two circles to cover one of each color i at least, such that the maximum radius of these two circle is minimized, which can be expressed in the mathematical descriptions as follows. Let r1 and r2 be the radius of the 2 circle C 1 and C 2 , where P c1 and P c2 are the point sets of different color selections, Q c1 and Q c2 are the color sets.
min max {r1 , r2 } s.t.
Q c1 ∪ Q c2 = Q P c1 ∪ P c2 ⊆ P 5.2. An example of the 2-center SECSC problem with m = 5 With assumption of uncertain position, this problem is still hard to be solved. The European distance between each two points is given, and the ratio of the European distance between any two points with different colors is less than a positive number T , T > 1. As we know, the ratio of an approximation algorithm depends on the gap between approximate solution and the optimal solution. Suppose that R ( B ) is the approximation ratio in Case 1, and R (C ) is the ratio in Case 2. Given a point set P = ( p 1 , p 2 , ..., p j , ..., pn ) of n points on a plane and a color set Q = (q1 , q2 , q3 , q4 , q5 ) of 5 colors. In general, the color classes can be divided in two parts: Q = {( Q a , qk ), ( Q b , Q c )}, where | Q a | = 4, | Q b | = 3 and | Q c | = 2. For the color distribution of Q = ( Q a , qk ), the problem can be transformed to our 1-center SECSC problem with m = 4 and can be solved by C 54 times of our algorithm. Otherwise, it is the color distribution of Q = {( Q b , Q c )} whose color selection comes from a color-spanning Triangle with 3 colors of points in C 1 and a different colored pair of points in C 2 . We mainly take this situation as an example. There are two cases for the color distribution of Q = {( Q b , Q c )} of this problem. Shown as following.
min max {r1 , r2 }
=
r1 , r2 ,
if r1 ≥ r2 if r1 < r2
Firstly, r1 ≥ r2 means the case that the enclosing circle of color-spanning triangle is not smaller than the enclosing circle of a pair with other two colors, defined as Case 1 with solution set as min max{r1 , r2 } = min{r1 }. As a results, the problem in Case 1 is transformed to be a 1-center SECSC problem with m = 3, just like the color distribution of Q = ( Q a , qk ) above. The solution in Case 1 can be given by the approximation above and save as ropt |m=3 . On the contrary, if r1 < r2 of Case 2, the enclosing circle of color-spanning triangle is smaller than the enclosing circle of a pair with other two colors. Let the solution of Case 2 be min max{r1 , r2 } = min{r2 }, save as ropt |m=2 . At last, the solution is the minimum value of the results in two cases above. Shown as ropt = min{ropt |m=3 , ropt |m=2 }, where the ropt is the optimal solution of this problem. Theorem 6. The 2-center SECSC problem with m = 5 can be solved in O (n log n) time, and its approximation ratio 2L depends on the specific value between the longest and shortest length of nearest distinct colored pair T . Proof. We suppose that the farthest distance between any two points with different colors is less than positive integer Y and the nearest one is more than positive integer y. Let the ratio T = Y / y, which is larger than 1 as Y > y. The approximate solution in Case 1 comes from the circle c 1 with 3 colors, defined by ropt |m=3 = min {U ( S )}. For each color selection S in Case 1, U ( S ) = min {d1 + d2 }, where the value of d1 and d2 is the nearest distance sequence I j of each point p j , corresponding to the furthest one and the one next to the furthest to p j in each color-spanning set V j . In the problem of 2 circles, the color selection of ropt |m=3 is not always equal to the color selection of ropt at last. If they were same, we can use the same proof of Theorem 2 as before and the ratio is 2. However, if not, we still can get a result based on the ratio T = Y / y.
JID:TCS AID:10841 /FLA
Doctopic: Algorithms, automata, complexity and games
Y. Wang, Y. Xu / Theoretical Computer Science ••• (••••) •••–•••
R ( B ) = sup I
B (I ) opt ( I )
≤
[m3G; v1.185; Prn:26/08/2016; 11:54] P.11 (1-11)
11
min {d1 + d2 } min {d1 }
As
min {d1 + d2 } < max {d1 } + max {d2 } < 2Y , where the maximum value of d1 and d2 comes from all nearest distance sequences of each color-spanning set V j , and mind1 ≥ y, we have
R ( B ) < 2Y / y = 2T . On the other hand, we compute the approximate solution in Case 2 from the circle c 2 with 2 colors, defined by ropt |m=2 = min {U ( S )}. If the color selection of ropt |m= the optimal solution, 2 was ropt = ropt |m=2 . Otherwise, the approximtaion ratio can be computed as follows. As ropt > min d j , and ropt |m=2 < max d j < Y , we have
R (C ) = sup I
C (I ) opt ( I )
≤
max d j
= Y /y = T
min d j
Therefore, the ratio of our approximation algorithm can be given. The maximum value 2T in different cases and color selections is the approximation ratio. Based on the results of the 2-approximation algorithm above, for each point, we can find the solution of the SECSC problem with time of O (nm log n). To find ra for smallest color-spanning set with m = 3 in O (n log n), and find the shortest interval with the rest two colors in time of O (log n). So, given the smallest value of rb needs time of O (n log n). It costs O (n log n) of the Case 2 to get rc . All in all, we totally need O (n log n) to solve this 2-center problem. 2 Acknowledgements The authors would like to acknowledge the financial support of Grants (No. 61221063) from NSF of China, (No. IRT1173) from PCSIRT of China and (No. 2015T81040) from Postdoctoral Science Foundation of China. References [1] Esther M. Arkin, H. Refael, Minimum-diameter covering problems, Networks 36 (3) (1997) 147–155. [2] J. Matoušek, On enclosing k points by a circle, Inform. Process. Lett. 53 (4) (1995) 217–221. [3] G.K. Das, R. Fraser, A. López-Ortiz, et al., On the Discrete Unit Disk Cover Problem [M]//WALCOM: Algorithms and Computation, Springer, Berlin, Heidelberg, 2011, pp. 146–157. [4] M. Abellanas, et al., Smallest Color-Spanning Objects, Springer, Berlin, Heidelberg, 2001, pp. 278–289. [5] J.J. Sylvester, A question in the geometry of situation, Q. J. Math. 1 (1857) 79. [6] D.P. Dobkin, R.L. Drysdale, L.J. Guibas, Finding smallest polygons, Comput. Geom. 1 (1983) 181–214. [7] M.H. Overmars, G. Rote, G. Woeginger, Finding minimum area k-gons, Utrecht University, Department of Computer Science, 1989. [8] A. Aggarwal, H. Imai, N. Katoh, et al., Finding k points with minimum spanning trees and related problems, in: Proceedings of the Fifth Annual Symposium on Computational Geometry, ACM, 1989, pp. 283–291. [9] T. Graf, K. Hinrichs, Algorithms for proximity problems on colored point sets, in: Proc. 5th Canad. Conf. Comput. Geom., Universität Münster, 1993, pp. 420–425. [10] Manuel Abellanas, et al., The farthest color Voronoi diagram and related problems, in: Abstracts European Workshop Comput.geom.cg, Freie Universität, 2001, pp. 113–116. [11] D. Eppstein, M.H. Overmas, G. Rote, G. Woeginger, Finding minimum area k-gons, Discrete Comput. Geom. 7 (1992) 45–58. [12] R. Fleischer, X. Xu, Computing minimum diameter color-spanning sets, in: Frontiers in Algorithmics, Springer, Berlin, Heidelberg, 2010, pp. 285–292. [13] Rudolf Fleischer, Xiaoming Xu, Computing minimum diameter color-spanning sets is hard, Inform. Process. Lett. 111 (21) (2011) 1054–1056. [14] W. Ju, C. Fan, J. Luo, et al., On some geometric problems of color-spanning sets, J. Comb. Optim. 26 (2) (2013) 266–283. [15] J.D. Morton, et al., Sets with no empty convex 7-gons, Canad. Math. Bull. 26 (4) (1983) 482. [16] E.M. Arkin, et al., Conflict-free Covering, 2015. [17] E. Emamjomeh-Zadeh, M. Ghodsi, H. Homapour, et al., Unit Covering in Color-Spanning Set Model [M]//WALCOM: Algorithms and Computation, Springer International Publishing, 2015, pp. 44–52. [18] Luis Barba, et al., On k-enclosing objects in a coloured point set, Altres (2013) 229–234. [19] E.M. Arkin, et al., Bichromatic 2-center of pairs of points, Comput. Geom. 48 (2) (2015) 94–107. [20] M. Jiang, H. Wang, Shortest color-spanning intervals, Theoret. Comput. Sci. 609 (2016) 561–568. [21] A. Karmakar, S. Roy, S. Das, Fast computation of smallest enclosing circle with center on a query line segment, Inform. Process. Lett. 108 (6) (2008) 343–346. [22] Dongxiang Zhang, et al., Keyword search in spatial databases: towards searching by document, in: IEEE 25th International Conference on Data Engineering, ICDE’09, 2009, pp. 688–699. [23] D. Eppstein, J. Erickson, Iterated nearest neighbors and finding minimal polytopes, Discrete Comput. Geom. 11 (1) (1994) 321–350. [24] P. Preparata Franco, M.I. Shamos, Computational Geometry: An Introduction, Texts and Monographs in Computer Science, vol. 47, 1990, p. 156.