Proof. Due to Claims 4.1.11 and 4.1.15, we have FacLoc(P (t), F (t)) = X
pj(t)∈P (t)
charge(pj(t), F (t)) · dj
< X
pj(t)∈P (t)
(64d + 1) · charge(pj(t), X(t)) · dj
= (64d + 1) · FacLoc(P (t), X(t))
for an arbitrary set of open facilities X(t) ⊆ P (t). Thus, the approximation factor is also true for an optimal set of open facilities F∗(t), which completes the proof of the lemma.
4.2 The Kinetic Data Structure
This section addresses the design of our KDS for the mobile facility location problem. After describing how to compute an initial set of open facilities, we describe how the event queue is structured and how an update of the KDS is processed.
4.2.1 Initial Set of Open Facilities
Let pi(t0) denote the initial position of the point pi ∈ P . To compute an initial set of open facilities, we apply Algorithm 4.2.1, which is a modified version of Algorithm 2.3.1, on the point set P (t0). The modification is that, instead of considering exactly the sorted sequence of the ri(t0) values, we round each ri(t0) to one of the O(log(nR)) possible values for the special radii (i.e., compute its corresponding ˜ri(t0) value) and use the sorted sequence of the rounded values.
Algorithm 4.2.1 Modified-Mettu-Plaxton-FacLoc(P , t0)
1: calculate the radius ˜ri(t0) for each point pi(t0) ∈ P (t0)
2: for k ← dlog(rmin)e + dlog(4√
d)e to dlog(rmax)e + dlog(4√
d)e do
3: let Ik be the set of indices of all the points with radius 2k
4: for each i ∈ Ik do
5: if there is no open facility in C(pi(t0), 2 · 2k) then
6: open facility at pi(t0)
4.2.2 Event Queue
In order to maintain the invariant defined in Section 4.1.3, we have to update our KDS at certain points of time. More precisely, we perform an update at each point of time when a point pj(t) crosses a wall Wi,k(t), dlog(rmin)e + dlog(4√
d)e ≤ k ≤ dlog(rmax)e + dlog(4√ d)e, of another point pi(t).
To keep track of these events, we use the following data structure: For each dimension
`, 1 ≤ ` ≤ d, we store all n points and all O(n · log(nR)) wall faces that are orthogonal to
the `-th coordinate axis in a list sorted by the `-th coordinate. For each consecutive pair in each of the d lists, we keep up one certificate to certify the sorted order of the lists. We define the failure time of the certificate for any pair of consecutive objects to be the first future point of time when these objects change their ranks in their sorted list. The failure times of all certificates are maintained in one event queue.
In case that more than one event occurs at the same time, we handle them in an arbitrary order. Certainly, it is not the case that each event implicates that a point crosses a wall of another point (as, e.g., the change of the rank of two wall faces also causes an event), but definitely every crossing of a wall is discovered by a failure of at least one certificate. The event queue has the following complexity:
Lemma 4.2.1. The event queue has size O(n log(nR)), can be initialized in O(n log2(nR)) time, and can be updated in O(log(nR)) time. Provided that the trajectories can be described by bounded-degree polynomials, the total number of events is O(n2log2(nR)). A flight plan update involves O(log(nR)) certificates and requires O(log2(nR)) time.
Proof. Each of the d lists stores n points and O(n log(nR)) wall faces. It follows that the event queue holds O(n log(nR)) events. Thus, the upper bound on the space requirement is as claimed.
The initialization of the d lists and the event queue can be done by simple sorting operations in O(n log(nR) log(n log(nR))) ⊂ O(n log2(nR)) time. In each following update, we have to re-calculate the points of time when the two objects involved in the current event change their ranks with their two neighbors in the corresponding list. Thus, a constant number of events have to be updated in the event queue. Since the event queue contains O(n log(nR)) elements and we can use a min-heap to realize it, an update of an event requires O(log(n log(nR))) ⊂ O(log(nR)) time. Furthermore, a flight plan update of a point causes a re-calculation of the points of time when the point and all its wall faces change their ranks with the associated neighbors in all d lists. Afterwards, the involved certificates are updated in the event queue. Since a point has O(log(nR)) wall faces, the number of involved certificates is O(log(nR)). Their update in the event queue can be accomplished in O(log2(nR)) time.
In case that the trajectories can be described by bounded-degree polynomials and no flight plan update occurs, the upper bound on the total number of events is given as follows. For each pair of elements, an event occurs when the trajectories of the two elements cross each other. The number of cuts of two polynomials is bounded by the maximum degree of both polynomials. Hence, the total number of cuts of O(n log(nR)) bounded-degree polynomials is O(cn2log2(nR)), where the constant c is the maximum degree of the polynomials.
4.2.3 Handling an Update
In this section, we describe how an event E, occurring at any point of time t, is handled (confer Algorithm 4.2.2, ll. 5). As the first step, the event queue is updated as explained in Section 4.2.2. Then, we have to distinguish between the following three cases:
4.2 The Kinetic Data Structure 65
(i) Both objects involved in the considered certificate are faces of walls.
(ii) Both objects involved in the considered certificate are points.
(iii) One object involved in the considered certificate is a point and the other object is a face of a wall.
The handling of the three cases mainly depends on whether the invariant is violated or not. We say that a point pi(t) ∈ P (t) violates the invariant at a point of time t if either (a) pi(t) is closed, but there is no open facility with radius smaller than or equal to ri(t) in the cube C(pi(t), 4 · ˜ri(t)) or (b) pi(t) is open, but there is another open facility with radius smaller than or equal to ri(t) in the cube C(pi(t), 2 · ˜ri(t)). We assume that the invariant is satisfied by the time when E occurs.
In Case (i), no point crosses the wall of another point. As a result, the invariant is still satisfied, so handling E is completed.
In Case (ii), the event indicates that a point pi(t) and another point pj(t) change their ranks based on a dimension `, 1 ≤ ` ≤ d. This means that we have to update the position of pi and pj in the range trees T1 and T2. Since no point crosses a wall of another point, handling E is then completed.
In Case (iii), it might be that the invariant is violated. Let pj(t) be the first object involved in the considered certificate, and let pi(t) be the point whose wall is the second object involved in the considered certificate. In case that pj(t) does not cross a wall of pi(t), handling E is completed. Otherwise, we update the radius ˜ri(t) according to Definition 4.1.1, i.e., we set ˜ri(t) = 2˜k such that ˜k = k0 + dlog(4√
d)e and k0 is the minimum integer k, dlog(rmin)e ≤ k ≤ dlog(rmax)e, with weight(C(pi(t), 2k0)) ≥ fi · 2−k0. We will show that the new value of k0 differs from its old value (before event E occurred) by at most 1. Thus, there are three possible values for k0. Each of these values can be tested by one range query on both T1 and T2. Afterwards, we test if pi(t) violates the invariant by using a range query on T1. If this is the case, we change the status of pi(t). As an effect of changing the radius or the status of one point, the invariant may be violated by many other points (e.g., their open facility has been closed). In the following, we will show how to deal with this problem (confer Algorithm 4.2.3).
Algorithm Restore. Suppose that pi(t) is a point that triggered an event E at a point of time t and whose radius or status changed due to E. Let ˜ri(t) = 2˜k be its updated radius. First, we restore the invariant at all points with radius 2˜k−1 to ensure that no point with radius less than or equal to 2k−1˜ violates the invariant. Then, we handle all points with radius 2k˜ that violates the invariant, then the points with radius 2˜k+1, . . . , up to the biggest possible radius. Now, we describe the procedure in general for any radius 2k.
We define two cubes S1 := C(pi(t), 4 · 2k+1) and S2 := C(pi(t), 6 · 2k+1). Both cubes are divided into equally sized cubelets with radius 2k. The left hand side of Figure 4.2 illustrates this decomposition in the plane.
To guarantee that no open point with radius 2k violates the invariant, we proceed as follows with each cubelet in S1: Let m be the center point of the considered cubelet. If
Algorithm 4.2.2 KineticFL(P, t0)
1: Modified-Mettu-Plaxton-FacLoc(P, t0)
2: initialize event queue Q
3: while Q is not empty do
4: E ← dequeue(Q)
5: update Q
6: if E indicates that pi(t) and pj(t) change their ranks in any list for any i, j then
7: update position of pi and pj in T1 and T2
8: else
9: if E indicates that pj(t) crosses a wall of pi(t) for any i, j then
10: update ˜ri(t) ← 2˜k in T1 and T2
11: if pi(t) violates the invariant then
12: change status of pi(t)
13: if radius or status of pi(t) changed then
14: Restore(pi(t), ˜k) Algorithm 4.2.3 Restore(pi(t), ˜k)
1: for k ← ˜k − 1 to dlog(rmax)e + dlog(4√
d)e do
2: define cubes S1 ← C(pi(t), 4 · 2k+1) and S2 ← C(pi(t), 6 · 2k+1)
3: for each cubelet C with center mC and radius 2k in S1 do
4: if ∃ open facility with radius < 2k in C(mC, 3 · 2k) then
5: close all facilities with radius 2k in C
6: for each cubelet C with center mC and radius 2k in S2 do
7: if @ open facility with radius ≤ 2k in C(mC, 3 · 2k) then
8: open one point with radius 2k in C (if existing)
there is an open facility with radius less than 2k in C(m, 3 · 2k), then we close all facilities with radius 2k in C(m, 2k). Note that there is at most one such facility. The considered area around a cubelet is illustrated in Figure 4.2.
In order to ensure that no closed point with radius 2k violates the invariant neither, we proceed as follows with each cubelet in S2: Let m be the center point of the considered cubelet. If there does not exist an open facility with radius less than or equal to 2k in C(m, 3 · 2k), then we open a point with radius 2k in the cubelet (if there is such a point).
No matter, whether we opened a point or not, it is guaranteed that, for each closed point pj(t) with ˜rj(t) = 2k in the cubelet, there is an open facility in C(pj(t), 4 · ˜rj(t)).