• No results found

4.8 Adding Visibility Requirements

4.8.2 Index Structure

First we present the construction of the auxiliary Quadtree, and then the details of the modi- fications to the MIR-tree to construct a OIR-tree.

Adding Visibility Requirements 111

4.8.2.1 Auxiliary Quadtree

The purpose of this auxiliary structure is to quickly find which part of an object or a candidate is obstructed from a user. To achieve this goal, the obstructed region OR(u) for each user u ∈ U is first constructed. The space is then partitioned using a Quadtree. For each cell c of the Quadtree, a list of users, OL(c), is maintained based on the visibility of c from those users. The idea is that the visibility of an object o w.r.t. any user can be estimated from the cells with which o.l intersects. Moreover, if an object is completely inside cells that are obstructed from a user u, that object can be safely discarded from consideration for u.

A top-down approach is used to populate the list of users OL(c) associated with each cell c of the Quadtree. Specifically, OL(c) consists of the ID of the users, such that for each user u ∈ OL(c), c is completely inside the obstructed region OR(u). Starting from the root, such users are found and added in the list OL(c) of the corresponding cell c. If a user u is included in OL(c) of a cell c, it implies that all the descendent cells of c are also contained inside OR(u). Therefore repeatedly storing u for the descendants of that cell c is not required. If an additional user u0 is found for which a cell c is completely inside OR(u0), but u0 is not included in any OL of the ancestor cells of c, only then is u0 included in OL(c). This is illustrated with the example shown in Figure 4.6 and Figure 4.7.

Example 11. Let the space be partitioned using a Quadtree into 10 cells as in Figure 4.6. The list of users OL(c) for the cells with at least one entry are shown in the table of Figure 4.7. Here, the cell c10 is completely obstructed from the users u1, u2, u3, where u3 is stored in the

user list of c9, user u2 is stored in the user list of its parent cell c5, and so on.

Separate from the Quadtree, the information of the obstructed region (the collection of polygons) for each user is also stored. Each leaf level cell of the Quadtree is associated with a pointer to the corresponding obstructed regions that intersect with the cell. These obstructed regions are later used to compute the exact visibility of the necessary objects and candidates.

Auxiliary Quadtree partitioning. The purpose of maintaining this structure is to efficiently find the visible segments of an object w.r.t. a user. As the visibility of an object o is calculated by taking the summation of the visibility of its small segments ∆o.l of length at most , this value is used to direct the partitioning process. Specifically, if a cell c intersects with or contains any object o ∈ O, then c is further partitioned until the diagonal length of the cell c is less than or equal to the threshold .

4.8.2.2 OIR-tree

The set of objects O needs to be indexed in a way that the visibility of an object w.r.t. any user can be estimated in an efficient way. We extend the MIR-tree (Section 3.3.3.1) to support the visibility and textual similarity computation of our problem, as close-by objects (objects in an MBR) are likely to have a similar visibility value from a user, and it is efficient to estimate the distance, and angle (discussed in details later) using the MBRs. We refer to this index as an OIR-tree. The OIR-tree is constructed in a similar manner to the original MIR-tree, where the MBRs of the line segments of the objects o.l in O are used to construct the underlying R-tree. In addition, the following information is maintained:

• We maintain a reference to a cell of the auxiliary Quadtree with each node E of the OIR-tree, specifically, the cell c at the lowest level such that E is completely inside c. The idea is that if a node E is completely inside a cell c of the Quadtree, that means all of the objects stored in E are completely obstructed from the users in OL(c) (and the users stored in the OL of the ancestors of c), so E cannot contain any top-k object of those users.

Example 12. In Figure 4.6, let the minimum bounding rectangle of the object o3 be a

node of the OIR-tree. This node intersects with the cells c7 and c8, but the cell c2 is the lowest level cell for which this node is completely inside. Therefore, the reference to cell c2 is associated with this node.

• The maximum and the minimum of the lengths of the objects stored in the subtree rooted at node E, denoted as len↑(E) and len↓(E), respectively, are stored.

Angle lookup table. A lookup table is maintained with the angle of each object o ∈ O w.r.t. the Cartesian X-axis, denoted as o.θ. This angle is later used to derive the angle of an object w.r.t. any user in query time.