After updating the results, we may have to remove from the influence lists of cells whose is greater than current . Consider the running example of Fig. where after the update of results, both the shaded and striped cells contain in their influence lists whereas only the shaded cells can actually influence the query. So we need to remove from the influence lists of all striped cells.
A straightforward approach to update influence lists is to first identify a square that contains all the shaded and striped cells. Then, we could check of all the cells in the square and could delete the cells for which . However, this approach requires computing of many cells which can be avoided. We use CircularTrip to efficiently update the influence lists as follows: First we call CircularTrip with radius and mark all the returned cells as shown shaded in Fig. . Then, we identify a square that contains all the shaded and striped cells. The side length of the square can be at most . Now we remove from the cells contained in the square that lie outside the marked circle. To do this, for each row of the square, we start processing the cells from the left most cell towards the right end cell of the square. For each cell , we delete from the influence list. We stop if a cell is marked or if it resides outside of the square. If the cell is marked, we continue deleting from the influence lists from the cells in the same row from right end to left end unless some marked cell is found. The update of influence lists completes when all rows are processed in the way described above. Note that this approach requires computing of only the shaded cells of Fig. .s
Muhammad Aamir Cheema 2007-10-11