Require: The setP of n points and strips H1, H2, . . . , Hν. Ensure: An independent subset of P.
1: Compute M IS1, M IS2, . . . , M ISν for the points lying in strips H1, H2, . . . , Hν by calling Algorithm 6.2 for each strip separately.
2: if (ν = 2u)then
3: M ISodd =
u−1
S
i=0
M IS2i+1 and M ISeven=
u
S
i=1
M IS2i
4: else
5: if (ν= 2u+ 1) then
6: M ISodd=
u
S
i=0
M IS2i+1 and M ISeven =
u
S
i=1
M IS2i
7: end if
8: end if
9: if |M ISodd| ≥ |M ISeven| then
10: return M ISodd
11: else
12: return M ISeven
13: end if
Theorem 6.1.8. Given a set P of n points correspond to a given UDG, a subset of at least 12|OP T|mutually independent points can be computed inO(n2logn)time and using O(n2)space using Algorithm 6.3, where|OP T|is the cardinality of a largest independent set for the point set P.
Proof. Let χ be the solution obtained by Algorithm 6.3. We have to prove that |χ| >
1
2|OP T|, where OP T is a GMIS ofP. Since M ISodd and M ISeven are union of solutions in odd and even strips respectively, we have,
|M ISodd|+|M ISeven| ≥ |OP T| (6.1)
|χ|+|χ| ≥ |M ISodd|+|M ISeven| (6.2) From inequalities 6.1 and 6.2, |χ| ≥ 12|OP T|.
The time and space complexities follow as we execute Algorithm 6.3 for every strip independently. Thus the theorem follows.
6.2 Geometric Maximum Weighted Independent Set
weight among the points in the subset. The left subtree is defined recursively for the points in the subset with weight at mostµw, and the right subtree is defined analogously for the remaining points of the subset. The recursion stops when the subset has only 1 point.
Notice that the tree has dlgne+ 1 levels, and exactly n points at each level. The total storage is therefore
S0(n) =
dlgne+1
X
`=0
2`Sn 2`
≤
dlgne+1
X
`=0
S(n) = O(S(n) logn),
where the first inequality uses thatS(n) = Ω(n). The preprocessing time is calculated the same way.
To answer a maximum query, we verify at the root node whether the query range is empty. If not, we verify if the query range is empty for the right subtree. If it is empty, we recurse on the left subtree. Otherwise, we recurse on the right subtree. The procedure ends when we reach a leaf. The leaf reached is the point of maximum weight inside the query range, which we return. The bound on the query time follows from the fact that we performed O(logn) emptiness queries, one per level.
Many techniques yield efficient data structures for anti-disk emptiness searching. For example, one can use a farthest point Voronoi diagram, point location, lifting (inversion), duality, etc. [11].
Lemma 6.2.2. Given a set ofn points, there exists a data structure that answers anti- disk emptiness queries in O(logn) time with O(n) storage and O(nlogn) preprocessing time.
Combining Lemmas 6.2.1 and 6.2.2, we have:
Lemma 6.2.3. Given a set of n weighted points, there exists a data structure that answers anti-disk maximum queries in O(log2n) time with O(nlogn) and O(nlog2n) storage and preprocessing time, respectively.
Sometimes, the reduction from Lemma 6.2.1 is an overkill, and a logarithmic factor can be avoided by a simpler approach.
Lemma 6.2.4. Given a set of n points with integer weights in {1, . . . , n}, there exists a data structure that answers anti-disk maximum queries in O((wmax−wret) logn)time withO(n)storage andO(nlogn)preprocessing time, wherewmax is the maximum weight among the points in the data structure and wret is the weight of the point returned by the query, or 0 if the query is empty.
Proof. We keep an array of n data structures D1, . . . , Dn from Lemma 6.2.2 where Di stores the points of weight i. To answer a query, we start from the maximum i that corresponds to a non-emptyDi, decrementing iuntil the query returns non-empty.
Analysis follows from the summation of individual complexities.
Definition 6.2.5. A search problem is called decomposable if for any setS and S0 ⊆S, the answer to a query q(S) can be calculated in constant time from the results of q(S0) and q(S\S0).
Lemma 6.2.6 ([10, 79]). A static data structure for a decomposable problem storing n elements with preprocessing time B(n), query time Q(n), and storage S(n) yields a semi-dynamic data structure supporting insertions for the same problem with insertion time O(B(n) logn n), query time O(Q(n) logn), and storage O(S(n) + logn).
Combining Lemma 6.2.6 with Lemmas 6.2.3 and 6.2.4 we have the following lemmas.
Lemma 6.2.7. Given a set of n weighted points, there exists a semi-dynamic data structure that answers anti-disk maximum queries in O(log3n) time with O(nlogn) storage and O(log3n) insertion time.
Lemma 6.2.8. Given a set of n points with integer weights in {1, . . . , n}, there exists a semi-dynamic data structure that answers anti-disk maximum queries in O((wmax− wret) log2n) time with O(n) storage and O(log2n) insertion time, where wmax is the maximum weight among the points in the data structure and wret is the weight of the point returned by the query, or 0 if the query is empty.
Let Q = {p1, p2, . . . , pm} be the set of points lying in a strip H with p1, p2, . . . , pm in increasing order of their x-coordinates. Given 1 ≤ i ≤ m, we define the set Si ⊆ Q is as follows: (i) Si is an independent set, (ii) pi is the rightmost point of Si, and (iii) Si is a maximum weight set satisfying the previous two properties. Let Wi denote the sum of the weights of the points in Si. For simplicity, the sets Si can be viewed as x-monotone polygonal chains formed by connecting the points of Si from left to right (see Figure 6.3). The objective of the proposed algorithm is to extend these chains as long as possible. A chain containing maximum number of points is reported.
H
√3/2
Figure 6.3: Pictorial representation of the sets Si in the form of chains, with the maxi- mum independent set marked.
The proposed algorithm uses dynamic programming to computeSi for i= 1, . . . , m as follows. We calculate Si using Sj for j < i iteratively as Si = Sj ∪ {pi}, where j is the index j < i that satisfies d(pj, pi) > 1 and maximizes Wj. In case there is no point pj, satisfying d(pj, pi) >1 and j < i, the algorithm sets Si ={pi}. To efficiently determine the indexj, we use the data structure from Lemma 6.2.7 (weighted) or 6.2.8 (unweighted). The pseudo-code is presented in Algorithm 6.4.
Theorem 6.3.5. Algorithm 6.4 correctly computes an MWIS for the setQ={p1, p2, . . . , pm} inside a strip of width
√3
2 inO(mlog3m)time usingO(mlogm)space. In the unweighted version, the complexities decrease to O(mlog2m) time and O(m) space.
Proof. To see thatSiis calculated correctly by the procedure, notice that by Lemma 6.3.2, d(pi, pj)>1 for j < iimplies that a point pk to the left of pj withd(pj, pk)>1 satisfies d(pi, pk) > 1. Note that by construction, Si contains pi and its weight is maximum.