移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

51
移移移移移移移移移移移移移移移移移移 移移 移移E-mail [email protected]

Upload: nam

Post on 23-Feb-2016

123 views

Category:

Documents


0 download

DESCRIPTION

移动查询点最近邻与反向最近邻连续监控 (欧氏空间). 李 艳 红 E-mail : [email protected]. 主要内容. 最近邻查询问题描述、分类及解决方案 欧式空间 路网空间 无线广播环境 反向最近邻问题描述、分类及现有的解决方案 欧式空间 路网空间 无线广播环境. 最近邻查询问题描述. 最近邻 (NN) 和反向最近邻 (RNN) 查询技术是空间数据库领域中一个重要的研究课题。 由于定位装置的广泛应用和定位服务的增加,对空间网络数据库中静态 k-NN 查询、移动数据的连续 kNN 监视技术的研究已经成为空间数据库领域的热点课题。. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

移动查询点最近邻与反向最近邻连续监控(欧氏空间)李 艳 红

E-mail : [email protected]

Page 2: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

主要内容• 最近邻查询问题描述、分类及解决方案

– 欧式空间– 路网空间– 无线广播环境

• 反向最近邻问题描述、分类及现有的解决方案– 欧式空间– 路网空间– 无线广播环境

Page 3: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

最近邻查询问题描述• 最近邻 (NN) 和反向最近邻 (RNN) 查询技术是空间数据库领域中一个重要的研究课题。• 由于定位装置的广泛应用和定位服务的增加,对空间网络数据库中静态 k-NN 查询、移动数据的连续 kNN 监视技术的研究已经成为空间数据库领域的热点课题。

Page 4: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• 空间数据库 (Spatial Databases , SDB) 是 GlS的重要组成部分,空间数据的查询是空间数据库的基本操作• 其中一种最重要的查询类型就是最近邻查询 .• 最近邻查询问题是由 Knuth 在 1973 年提出来的,即邮局问题 [1] 。• 可以简单描述为 : 给定 N 维空间内的 n 个点所组成的集合 S ,将这 n 个点存储在一种数据结构中,使得对于空间内的任何查询点 q ,都可以有效地找到它的最近邻,即在 S 中找到一个点 p ,使其到 q 的距离最近。• 最近邻的数目可以是一个,也可以是多个即

kNN 。• 例如,某一用户可能在屏幕上点击一个特定的位置或者一个目标,要求系统查找并返回数据库中

5 个距离它最近的对象 .

Page 5: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

空间数据库• 空间数据库中的大部分研究仅考虑了欧氏空间。与之相应,以距离为基础的查询如 k一 NN 查询,采用对象之间的欧氏距离来度量 .• 欧氏空间,在数学中是对欧几里德所研究的 2 维和 3 维空间的一般化。这个一般化把欧几里德对于距离、以及相关的概念如长度和角度,转换成任意数维的坐标系。

Page 6: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

空间数据库的 kNN 查询• 空间数据库的 kNN 查询问题通常定义为 :给定移动查询点和对象 ( 兴趣点 ) 集合,以及方向和范围约束集合,检索距离查询点的 k 个最近的对象 ( 邻居 ) 。 kNN 查询通常可以分为以下几种形式。

Page 7: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

KNN 查询的几种形式• (1) 点的 k 个最近邻查询 ( 或简单的 k-NN 查询 ) 给定一组空间对象和一个查询点,检索 k 个距离查询点最近的对象。空间对象通常是静态的点。例如,车辆中

GPS 装置所提交的查询 : 检索距离车辆最近的 5 家餐馆。• (2) 连续的 KNN(Continuous k Nearest Neighbors,

CkNN) 查询 : 给定一组空间对象集,一个查询点和一条预定义的路径,检索位于路径上任何点处 ( 查询点 )的 k 个最近的对象。例如,沿着一条路径运动的车辆中的 GPS 装置所提交的查询 : 检索 5 家最近的餐馆。

Page 8: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• (3) 群组 kNN (Group k Neaerst Neighbors , GKNN) 查询 : 给定一组空间对象和一组查询点,检索 k 个空间对象使之距离查询点的距离之和最小。例如 : 两个或更多的人计划去一家餐馆,使他们的行程时间之和最小化。

• (4) 约束 -kNN (Constrained k Nearest Neighbors ,CokNN) 查询给定一组空间对象,一个查询点和一组方向或范围约束,检索查询点的 k 个最近邻。例如,检索车辆东南方向且距离车辆不超过 5 公里的 5家最近的餐馆。

Page 9: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• (5) 反向 kNN(Reveres k Nearest Neighbors, RKNN) 查询 : 给定一组空间对象和一个查询点,检索把查询点作为它们 k个最近邻之一的对象。一个查询点的RKNN 可以与 kNN 有所不同,因为 kNN 查询不是对称函数 .

Page 10: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

欧式空间的 RNN 查询. p2 is the query point and k=2.. RNN(p2)={ p1, p3, p4}. p4 is an R2NN of p2 although it is far from the query point p2. . p5 and p7 are not answers of the R2NN query of p2

although they are close to p2.

Page 11: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• The nearest neighbor to Taxi A is Customer C, but that does not necessarily mean Taxi A is the most likely to get to Customer C because Taxi B is even closer to Customer C.

• On the contrary, Taxi A should head for Customer D because Taxi A is the nearest neighbor in relation to Customer D. That is, the RNN for Taxi A is Customer D, and Taxi A may get to Customer D faster than all other taxis.

Fig. Another RNN example

Page 12: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

欧式空间的 RNN 查询 • RNN/RKNN 可大概分为:基于预计算的方法和动态方法。• 基于预计算的方法预先为每个 P 进行 KNN 查询,确定 P到给定 k 值的 KNN-p’ 的距离 dist(p,p’) ,对每个 p ,画一个以 p 为圆心, dist(p,p’) 为半径的圆,若查询点 q 落在

cir(p,p’) 内,则 p 是 q 的 RKNN. 为了查找数据结果点,所有的邻近圆用一个 R-树的变种, RNN树来索引。而R-树的另一变种, RDNN树 [2] 不是物理的保存各邻近圆,而是保存各个数据对象及其邻近圆的半径。 RDNN树可同时支持 NN 和 RNN 查询。

• 但是这种方法只适合于 K 值固定的 RKNN 查询,且索引构建和维护的代价很高。• 为了支持可变 K 值, Achtect等人和 xia等人提出,在运行时刻估计 KNN 的距离,而不是维持真正的 KNN 距离。

Page 13: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)
Page 14: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)
Page 15: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

Rdnn-tree

Page 16: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• RNN 查询的难度还在于一个对象的进入和离开除了会影响到自身作为查询结果的改变,还会影响到其他对象。

Page 17: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

动态 RNN/RKNN 查询算法• 为了消除预计算,出现了快照 RNN 。• 快照类 RNN 的主要目的是利用一些措施来削减查询空间 ( 称为过滤步 ) ,然后对得到的候选对象进行精炼,以确定他们是否是查询的

RNN 。有两种过滤的方法,称为六分空间削减和 TPL削减

Page 18: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• 六分空间削减 [3] 由 Stanoi等人提出,他们利用获取 RNN 时的一些性质来消除预计算。• 他们将以查询点 q 为中心的查询空间分成 6 个大小相等的扇区 s1-s6 ,令 p 为区域 si(i=1..6) 内 q 的

NN ,可以证明: 1 )要么 p RNN(q). 2)∈ 要么在si区 q 无 RNN 。

• 该方法分为两个阶段:过滤阶段,在每个扇区进行一个受限的 NN 查询以找扇区内的 NN;在精炼阶段,所有候选者用 NN 查询来评估,那些有超过NN 的候选者被去掉,剩下的构成 q 的 RNN/RkNN集。

• Stanoi 算法的效率来自于候选者的数量较少, 2D空间的双数据集 RNN总共至多有 6 个候选对象。但随着维数的增加,候选者的数目会呈指数级增加。

六 分 空 间 削 减 法 Stanoi

Page 19: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

证明:假设存在 p2 ,使得 p2s1 ,使得RNN(q)=p2 ,则 NN(p2)=q, qp2 < p1p2,则 ∠ qp1p2 < p1qp2∠又 , p1qp2 < 60°, ∠ 则 ∠ qp2p1 > 60°有 ∠ qp2p1 > qp1p2, ∠ 则 qp1>qp2, 也即 p1 不是 q 的 NN, 这与已知条件矛盾,所以 s1 内不存在q 的其他 RNN.

Page 20: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• Singh等人提出算法以减轻维数增加所带来的负面影响,该算法首先获得查询点的KNN 数据点作为候选者, K (大于 RkNN查询中的 k )是随机选择的。但是,算法的精确性和执行效果高度依赖于 K 。 K越大,结果越完备,但执行代价高; K越小,效率高,但可能导致真正的答案被错误的删除。

Page 21: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

TPL by Tao• Tao[4]等人提出 TPL 算法,它利用空间的半平面特性以定位候选者。• 每次,查询点 q 的一个尚未访问过的 NN (假设为 p )被找到时,由 p 与 q 的垂直平分线构建半平面。已知,任何落于含 p 的半平面的数据对象 p’ ,必定有

dist(p,p’)<dist(q,p’) 。所以,若一个数据点被 k 或多于 k个半平面所覆盖,则它必定不是 RkNN 的结果数据对象,因此,它能被安全地去掉,而不需作详细的检查。当有效的区间内不再有 q 的 NN 存在时,过滤阶段结束,此时,所有的候选者已被找到,而无关者已被去除。• [4] 的试验显示:正常情况下, TPL剪切后的候选者的数目是 2*k 到 3*k 个。在精炼阶段,对每个候选者进行 NN查询以去掉错误的候选者。这种方法能保证结果的完备性。

Page 22: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

SINGLE RNN PROCESSING

• 图 1(a), 查询 q 和 数据点 p 间的垂直平分线将空间划分为两个半平面 : PLq(p,q)(含 q) 和 PLp(p,q) (含p) 。则 PLp(p,q) 中任意点 ( 如 p‘) 不能成为 q 的 RNN ,因为它较 p比 q 近。类似地 , 一个完全落入PLp(p,q) 的节点 MBR ( 如 , N1) ,也不可能包含候选对象。

• 图 1(b),虽然 N2 不是完全落入 PLp1(p1,q) 或 PLp2(p2,q), 它仍然被剪切,因为它完全落入这两个半平面的合集中。

Fig 1: Illustration of half-plane pruning

Fig 2: Computing the residual region

• 如图 2 所示,我们可依次用各个对象对空间 N 进行消减,从而得到剩余区域。但这种方式求 Nres 有两个问题。• 首先,在最坏情况下,每条平分线会使

Nres新增一个顶点。因此,第 i 条平分线的消减需时 O(i)(0<i<=nc). 因此,总的处理时间为 O(nc2) 。

• 其二, 这种方法对高维空间不具有可扩展性。

Page 23: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• NresM初始化为 N ,然后用各平分线依次对其进行消减。• 图 a 所示,用⊥ (p1,q) 进行消减。这里没有保留 Nres 的准确形状,而是计算 NresM (即阴影部分)。 • 图 b,c 分别是在由⊥ (p2,q),

(⊥ p3,q)消减后剩余的 MBRs 。• 注意,最终的 NresM 并不一定是最终 Nres 的 MBR 。

Figure 3: Computing the residual MBR• 提出了一种简单的替换方法,改方法只需要 O(nc) 时间。• 其思路是:用一个剩余MBR NresM 来界定 Nres 。

• 如果 If NresM 存在 , trim 算法返回 q 和 NresM

间的最小距离;否则,返回∞ .• 由于 NresM 总是包含 Nres , NresM = ∅ 必然隐含 Nres = . ∅ 这个特性保证了消减是 “安全的”。

Page 24: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

The TPL Algorithm• best-first 模式遍历 R-tree ,每个被消减项入 Srfn 集合 .• 首先访问 R树根节点,将其子项

N10, N11, N12按到 q 的最小距离递增的顺序入堆 H={N10,N11,N12} 。

• N10 出堆,其子项入 H ={N3, N11, N2, N1, N12}.

• 接下来访问 N3, 其第一个数据点p1 ( 即离 q 最近的一个 ), 有dist(p1,q)< dist(N11,q) (N11 是堆顶元素 ) , p1被加入至候选集 Scnd.

• N3 的第二个点在 PLp1(p1,q) 内 ( 即它不可能是 q 的 RNN) ,它被插入精炼集 Srfn.

• 总的来说 , 在过滤阶段检查过的任意数据点或节点,都不会被丢弃,因为它们可能会影响某些候选对象 ( 即是它们的 NN) 。如 在精炼阶段 p3会使 p1 无效,因为 dist(p1,p3) < dist(p1,q).

Figure 3: Filtering example

Page 25: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)
Page 26: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

Refine step• 过滤步得到候选对象集 Scnd 和精炼集 Srfn. • 精炼步按多轮来执行,左边给出了一轮精炼的算法。• 算法中,在不访问其他节点的情况下,尽可能的消减候选集中的元素。• 直觉上,一个点 p ∈ Scnd 可以被消减,如果 (i) 存在另一个点 p’

∈ Prfn ,使得 dist(p,p’) < dist(p,q), 或者 (ii) 存在一个节点 MBR N ∈ Nrfn ,使得minmaxdist(p,N)< dist(p,q) ( 即 , N 一定包含一个点 p’ ,使得dist(p,p') < dist(p,q)).

• 如图 3 中,由第一条件消减 p1 ,因为 p3 ∈ Prfn 且dist(p1,p3)< dist(p1,q).

• Lines 2-9 根据上述两条件消减false hits.

Page 27: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• 另一方面,一个数据点 p ∈ Scnd 是一个结果值如果 (i) 不存在另一点 p’ ∈ Prfn ,使得 dist(p,p’) < dist(p,q);而且 (ii) 对任意结点 N ∈ Nrfn ,有 mindist(p,N) ≥ dist(p,q). 如图 3 中 p5.

• 每一个 Scnd 中剩下的点 p ( 如 p2) 必须经历另外的 refinement rounds, 因为可能在未访问的结点 (N4) 中存在点 (p4) ,使之无效。• 这种情况下, p 需要那些插入 toVisit(p),满足mindist(p,N) < dist(p,q) 的结点 N ,也即 , toVisit(p) 是在验证 p 是一个结果值前需要访问的结点集。• 接下来就是以一种次序访问 toVisit(p) (for

p ∈ Scnd) 使得可以快速消减剩下的候选对象。

继续上例,第一轮后 Scnd = {p2} , toVisit(p2)={N4,N12}. 我们选择最先访问最低层的结点 ( 即 N4) ,因为它的消减力最大。若同层有多个结点,则访问能消减最多候选对象的结点。如果待访问的结点 N 是叶子结点,则 Prfn 只包含 N 中的数据点 , Nrfn 设为 ∅ . 否则 (N 是中间结点 ), Nrfn 则包含 N 的孩子结点 ,Prfn 设为 ∅ . 本例中,第二轮 Scnd = {p2}, Prfn = {N4 中的点 } , Nrfn = ∅ 。 在 N4 内 , 点 p4 消减 p2 ,算法结束。2-4 行 是对候选集中各对象进行相互消减。该步只需执行一次。

Page 28: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

CRNN Algorithm by Tian Xiao• Tian Xia [5]等人提出一种连续反向最近邻( CRNN )算法,它是一种增量的、可扩展的方法。• 该方法基于六分空间削减策略。• 对于一个查询点 q , cRNN 监控区由至多 6 个 π区域和 6个圆形区域构成。其中 6 个 π区域分别监控六个候选对象、 6 个圆形区域分别验证这六个候选对象是否是查询的真正 RNN 。• 对于渐增维护,只有那些落于监控区的位置更新才可能会影响 RNN 的结果。对每个受影响的查询点,对象的更新被组织到六个分区,对每个受影响的分区,只根据最接近

q 的对象而更新 π区一次。• 对于圆形区的更新方面,引入了懒惰更新和部分插入优化方法。但这种方法只能处理单色数据集,且为每个查询维持监控区域较复杂,处理较麻烦。

Page 29: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

. Before the movement of object 4, the candidates in sub-space S1 are object 1, 2, and 3 because they are the query point’s 3NNs in S1, and the object 2 is query result because its 3NN includes the query point. . After the movement of object 4, the candidates in S1 become object 1,2 and 4, and object 2 is not a result object anymore because its 3NN now does not include the query point.

Page 30: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• 定义 CRNN 的监控区域包括两个部分: pie-regions 和 circ-regions.

• pie-regions 包括 6个pie; circ-region 包含6和 circle 。

基于 6 分空间消减策略的 RNN 查询: 6 个受限的 NN 查询以获得候选对象,再进行6 个 NN 查询对各候选对象进行验证。查询空间划分成以 q 为中心的 60 度角的 6等份。分区 Si 的 pie-region 是以 q 为中心,其 Si 内受限 NN 在周边的扇形区域。分区 Si 的 circ-region 是以 Si 内候选对象为圆心,以 q 或距离该候选对象比 q 更近的元素在圆周的圆形区域。

The monitoring region of a CRNN

Page 31: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

CRNN Query Initialization

• 该算法计算初始结果集,并初始化查询点的监控区域。• 查询表 (QT) 保存每个查询点及其 6 个区域 (S0 ,… S5). 对每个区域

Si, QT保存: (1) q 的受限 NN ,其距离 d(q,candi); (2) 对象nn_candi 及其距离 d(nn_candi; candi). nn_cand 距离 cand较 q 近。

• 若 Si 不包含任何对象, candi and nn_candi 都为 null ,相应距离值为无穷大。• 算法的过滤步采用 conceptual rectangles [6] 以避免访问不必要的单元。• 上右图给出了过滤步的实例。 首先,含 q 的单元和围绕 q 的四个矩形区域被入 heap (见算法 step2 )。• 对每个分区寻找其受限 NN ,找到则标记为“ finished”

Page 32: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• Step 3,依次从 H 中出堆首项 e• 依次考察各 Si ,若该区域于 e相交,且 fini=.F., 则判断 e 的键值是否大于

d(nn_cand,candi), 若是,则设fini 为 .T.

• Step 3.3, 检查 e 的 mindist is checked 是否过期,也即该mindist 不能代表已完成的分区外的区域的最小距离 (i.e. ,实际的 mindist 增加了 ) 。 此时,计算新的 mindist ,并将 e重新入 heap.

• Step 3.4, 如果 e 中的单元 c完全包含在 finished 的分区,则 c不入堆 H 。

Page 33: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• 上图 (a) 中 ,当矩形 L1 出堆时, S2 分区已标记为 finished,(mindist(L1,q)>d(q,o1)), 单元 c2 不入堆 H 。• 上图 (b) 中,分区 S2显示为 finished状态。当矩形 出堆时, S1 标记为 finished 。 U2 所关联的

mindist (虚线所示)已过期 ,因为它不能代表分区 S0 内 U2 中尚未被消减的部分的最小距离值。此时,新的 mindist (粗实线所示)将代替旧值,且 U2 重入堆(未扩展)。

An example of the filter step of aCRNN query initialization

Page 34: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

Incremental CRNN Monitoring

• 关键是如何保存和维持 pie-regions 和 circ-regions.

• 当对象发生位置更新时,我们修改受影响的查询的 pie-regions 和 circ-regions 。• 若 q 移动了位置,处理为旧查询的删除和新查询的进入。• pie-regions 采用传统的 bookkeeping 方式存储, circ-regions 则独立保存。

Page 35: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

Handling Updates in Pie-regions

Three cases of updates in pie regions

• Pie-regions 在算法 initCRNN 的 Step 3.5初始化。

• Pie-region 内的对象移动,有三种情形:(1) 对象进入 pie-region (o4 或 o5); (2) 候选对象离开 pie-region (o2 或 o5);

(3)候选对象在同个 pie-region 内移动(o7)

算法说明:3.1 处理情况一,通过设置新候选对象而收缩 Pie-region 。3.2 处理情况二,通过一个受限的 NN 查询来重现确定 Pie-region 。3.3 处理情况三,重新计算 Pie-region 的半径。

Page 36: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

Handling Updates in Circ-regions

Fig Updates in Circ-regions

Page 37: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

IGERN by Kang

• James M. Kang [7]等提出了 IGERN (增量式、通用、连续反近邻查询方法),它利用 TPL削减策略。它提供一种统一模式以同时处理单色数据集和双色数据集的CRNN ,为每个只维持一个有界监控区和少量移动对象,所以比使用六分空间削减策略的方法要高效。

Page 38: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

反向最近邻查询分类• 反向最近邻查询有两种:单色反向最近邻查询

(monochromatic RNN , MRNN) 和双色反向最近邻查询(bichromatic RNN , BRNN)[3] 。

• 单色反向最近邻查询中,所有移动数据对象和查询对象均属于相同的类型。其定义是:对于查询对象 q ,数据对象 o而言,若不存在其他数据对象 o‘ ,使得dist(o,o’)<dist(o,q) ,则 o 是 q 的反向最近邻。

• 双色反向最近邻查询中 , 有两种不同的对象类型 A 和 B ,查询对象类型为 A 、数据对象类型为 B 。其定义是:对于查询 qA 和移动对象 oB ,若不存在其他 A 类型的查询 oA’,使得 dist(oB,oA’)<dist(oB,qA) ,则 oB 是 qA 的反向最近邻。•

Page 39: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

单色反向最近邻查询初始步:

The initial step of IGERN has three main objectives:

(1) Obtaining a bounded region r around the query object q which will be monitored.

(2) Identifying a set of objects RNNcand that need to be monitored

(3) Identifying the set of reverse nearest neighbor objects (RNN ∈ RNNcand) to q.

Initial: RNNcand = {o2, o4, o6}.

RNN = {o2, o6}

Page 40: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

渐增步:

The incremental step checks forthree different scenarios: (1) The query object q moves to

a new location (Line 2)(2) At least one of the objects

in RNNcand moves to a new location (Line 2)

(3) A new object moves into the alive cells (Line 6).

Fig(a): RNNcand={o2,o4,o6)} RNN = {o2, o6}

Fig(b): RNNcand={o2,o4,o6)} RNN = {o2}

Fig(c): RNNcand={o2,o6,o9)} RNN = {o2,o=}

Page 41: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

双色反向最近邻查询(a) Phase 1 (b) phase 2 (c) Incremental

The objectives of the initial step in the bichromatic IGERN algorithm are:

(1) Obtaining a bounded region r around qA to be monitored in the incremental step

(2) Identifying a set objects of type A (NNA) that need to be monitored later as their movement may trigger a change of answer

(3) Identifying the set of initial reverse nearest neighbors of type B (RNNB) to qA.

Page 42: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

(a) Phase 1 (b) phase 2 (c) Incremental

Phase I: Bounded Region.

1. By finding object oA that is nearest to qA in the alive cells (Line 3). Then, object oA is added to the list of A objects (NNA).

2. The bisector b between qA and oA is drawn, while all the grid cells between b and the space boundaries that are furthest from qA are marked as dead (Lines 4-5).

3. Such process continues until there are no more objects of type A in any of the alive cells.

4. In Figure (a), the NN search in the alive cells results in finding oA5, oA3, and oA1, and the corresponding bisectors b5, b3, and b1.Thus, NNA = {oA1, oA3, oA5}.

Phase II: Verification.1. Go through every single object oB within the alive cells

and check for its nearest A object, oA (Line 9).2. If oA is qA, then oB is a RNN to qA, and added to the set

RNNB (Line 11).3. If oA is not qA, then oA is considered as one of the objects

to be monitored, a bisector is drawn between qA and oA, the corresponding grid cells are marked as dead, and the set NNA is cleaned to make sure that it contains the minimal required objects to be monitored (Lines 13-15).

4. In Fig(b), there are three B objects in the alive cells, oB3, oB4, and oB5. Finally, only oB3, and oB4 are RNN, while oB5 has oA4 as its nearest A object.

5. Thus, a bisector b4 is drawn between qA. Object oA4 is then removed from the monitored NNs NNA because it is closer to oA5 than qA. As a result, NNA = {oA1, oA3, oA5} and RNNB = {oB3, oB4}.

Page 43: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

Main shortcoming: The monitoring region defined in IGERN only applies to CRNN (k = 1). Also for this reason, the IGERN algorithm cannot be extended easily to handle CRKNN queries where k > 1

The incremental step of the bichromatic case checks for threedifferent scenarios: (1) The query object qA moves to a new location (Line 2) (2) At least one of the objects in NNA moves to a new location (Line 2) (3) A new object of type A moves into the alive cells (Line 6).

• If there is one or more objects of type A in the alive cells, tighten the alive cells in a similar way to the first phase in the initial step (Line 7).

• Then, the list NNA is cleaned by removing any object that is not participating in drawing the bisectors (Line 8).

• Finally, the sets NNA and RNNB are verified (Line 10). That is, NNA = {oA1, oA3, oA5} and RNNB = {oB4}.

Page 44: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• Wei wu, Feiyang [8]等人指出: CRNN/CRkNN查询可清楚的划分为连续过滤和连续精炼两部分,而通过分析可知,连续精炼在 k>1 时占据查询时间的主要部分。• 提出一个叫做 cRange-k 的连续精炼算法,它验证查询 q 的 CRkNN 的候选者 p 采用的方法是:连续地监控离 p 的距离小于 dist(o,q) 的对象数小于 k 。它不要求任何精确的信息;而且,它既以范围( Range )来界限查询范围,又以 k 值来界限查询范围,只要其中之一条件满足,就可以中止算法,故处理高效。

Page 45: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• when k increases, the cost of continuous refinement increases much faster than the cost of continuous filter.

Fig. Filter vs. refinement

Page 46: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

CRange-k Continuous Refinement

A Range-k query is specified as < o, r, k > where o is an object, r is a distance, and k is a threshold value, and the query’s result is the boolean value of the following expression: |{p : dist(p,o) < r}| < k.

The algorithm consists of two parts: a Search part and a Maintenance part. Search’s functionality is to compute the query’s result by looking for objects that are within the given range, and to index the query into proper cells.

An object’s location update triggers the Maintenance of the queries indexed in the corresponding cell (or cells when the object moves from one to another cell).

Maintenance’s main functionality is to update the query’s result upon object location changes.

Page 47: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

count: the number of objects o that are within the circle (circle(o, r), found in visited cells;V : set of cells checked so far;U: a FIFO queue of cells that we need to check.

Initialization:Count=0; V= ; ∅ U=cell(o).

Starting from the cell that contains object o, the cells that intersect with circle(o; r) are checked until one of the following two conditions is satisfied:

1)count k≧ , which means at least k objects are within the given range; False is returned

2) all the cells intersecting with circle(o; r)have been checked and the count is smaller than k. True is returned

During the course, the query is indexed into the visited cells.

Initial Processing

Page 48: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

Fig 5. Search’s Sample States

In the figures, gray cells are the covered cells, shaded cellsare the partially covered cells, and dotted cells are the cellsin the to-be-visited queue.

Page 49: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

Continuous Maintenance

• Case 1: If the object moved from a visited cell to a visited cell, check both its starting and ending location to see if count needs to be updated (lines 3-8).

• Case 2: If the object moved from a visited cell to an un-visited cell, only need to check its starting location to see if count needs to be decreased (lines 9-12).

• Case 3: If the object moved from an un-visited cell to a visited cell, only need to check its ending location to see if count needs to be increased (lines 13-16).

In Search, we put a reference of the Range-k query to the visited cells that intersect with circle(o; r). For example, they are the grey cells and line shaded cells in Figure 5.

Page 50: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

References

• [1] Knuth, D. E. (1973). The Art of Computer Programming, volume I: Fundamental Algorithms, chapter 2. Addison-Wesley, second edition.

• [2] C. Yang and K.L. Lin, "An index structure for efficient reverse nearest neighbor queries", Proceedings of the 17th International Conference on Data Engineering,2001,p.p. 485-492.

• [3] I. Stanoi, D. Agrawal, and A. El Abbadi, “Reverse Nearest Neighbor Queries for Dynamic Databases,” Proc. ACM SIGMOD Workshop Research Issues in Data Mining and Knowledge Discovery (DMKD), 2000.

• [4] Y. Tao, D. Papadias, and X. Lian, “Reverse kNN Search in Arbitrary Dimensionality,” Proc. 30th Int’l Conf. Very Large Data Bases (VLDB ’04), pp. 744-755, Aug.-Sept. 2004.

• [5]T. Xia and D. Zhang, “Continuous Reverse Nearest Neighbor Monitoring,” Proc. 22nd Int’l Conf. Data Eng. (ICDE ’06), p. 77, Apr. 2006

• [6] K. Mouratidis, M. Hadjieleftheriou, and D. Papadias. Conceptual Partitioning: An Efficient Method for Continuous Nearest Neighbor Monitoring. In SIGMOD, pages 634–645, 2005.

Page 51: 移动查询点最近邻与反向最近邻连续监控 (欧氏空间)

• [7]James M. Kang, Mohamed F. Mokbel, Shashi Shekhar, Tian Xia, Donghui Zhang, Continuous Evaluation of Monochromatic and Bichromatic Reverse Nearest Neighbors , In ICDE, 2007

• [8] Wei wu, Feiyang Chee-Yong Chan Kian-Lee Tan . Continuous Reverse k -Nearest-Neighbor Monitoring , The 9th International Conference on Mobile Data Management, 2008

• [9]M. L. Yiu, D. Papadias, N. Mamoulis, and Y. Tao. Reverse Nearest Neighbors in Large Graphs. TKDE, 18(4):540–553, 2006.

• [10]Maytham Safar, Ahmad Al-Saleh, “PINE based RNN queries in Road Networks”, VII Brazilian Symposium on Geoinformatics, INPE, Campos do Jordão, São Paulo, Brazil, 20-23 November 2005,, pp. 356-367

• [11] SUN Huan-liang, JIANG Chao, LIU Jun-ling, SUN Limei. Continuous Reverse Nearest Neighbor Queries on Moving Objects in Road Networks. The Ninth International Conference on Web-Age Information Management, 2008