Trip Planning Queries - Florida State University
Download
Report
Transcript Trip Planning Queries - Florida State University
Reverse Furthest
Neighbors in Spatial
Databases
Bin Yao, Feifei Li, Piyush Kumar
Florida State University, USA
A Novel Query Type
Reverse Furthest Neighbors (RFN)
Given a point q and a data set P, find the set of
points in P that take q as their furthest neighbor
Two
versions:
Monochromatic
Reverse Furthest Neighbors (MRFN)
Bichromatic Reverse Furthest Neighbors (BRFN)
Motivation and Related works
Motivation: inspired by RNN
Reverse Nearest Neighbor
Set
of points taking query point as their NN.
Monochromatic & Bichromatic RNN
Many applications that are behind the
studies of the RNN have the
corresponding “furthest” versions.
MRFN Application
P: a set of sites of interest in a region
For any site, it could find the sites that take itself
as their furthest neighbors
This has an implication that visitors to the RFN of
a site are unlikely to visit this site because of the
long distance.
Ideally, it should put more efforts in advertising
itself in those sites.
BRFN Application
P: a set of customers
Q: a set of business competitors offering similar
products
A distance measure reflecting the rating of
customer(p) to competitor(q)’s product.
A larger distance indicates a lower preference.
For any competitor in Q, an interesting query is
to discover the customers that dislike his product
the most among all competing products in the
market.
BRFN Example
p7
p2
q
p3 3
p6
q1
p1
p5
q2
p4
p8
RFN of q1 : p3 , p5 , p6 , p7 , p8
RFN of q3 : p1 , p2 , p4 RFN of q2 :
: customer
: product
MRFN and BRFN
MRFN for q and P:
MRFN(q, P) p p P fn(p, P {q}) q
BRFN for a point q in Q and P are:
BRFN(q, Q, P) p p P fn(p, Q) q
Outline
MRFN
Progressive
Furthest Cell Algorithm
Convex Hull Furthest Cell Algorithm
Dynamically updating to dataset
BRFN
MRFN: Progressive Furthest Cell
Algorithm (first algorithm)
Lemma: Any point from the furthest Voronoi cell(fvc) of p
takes p as its furthest neighbor among all points in P.
p1
p2
p4
fvc( p1 )
p5
p3
Progressive Furthest Cell Algorithm (PFC)
PFC(Query q; R-tree T)
Initialize two empty vectors VC and VP; priority queue L with T’s root
p4
node; fvc(q)=S;
While L is not empty do
p1
Pop the head entry e of L
If e is a point then, update the fvc(q)
If fvc(q) is empty, return;
p2
p3
If e is in fvc(q), then Push e intoV ;
C
else
fvcfvc
( p1()p
1)
If e fvc(q) is empty then push e to V ;
P
Else for every child u of node e
If u fvc(q) is empty, insert u into VP;
Else insert u into L ;
Update fvc(q) using points contained by entries in VP ;
Filter points in VC using fvc(q);
Outline
MRFN
Progressive
Furthest Cell Algorithm
Convex Hull Furthest Cell Algorithm
Dynamically updating to dataset
BRFN
MRFN: Convex Hull Furthest Cell
Algorithm(second algorithm)
Lemma: the furthest point for p from P is always a vertex of
the convex hull of P. (i.e., only vertices of CH have RFN.)
CHFC(Query q; R-tree T (on P))
Find the convex hull C P of P; // compute only once
if q C P, then return empty;
else
Compute C P* using CP {q} ;
Set fvc(q,P*) equal to fvc(q, C P* );
Execute a range query using fvc(q,P*) on T;
Outline
MRFN
Progressive
Furthest Cell Algorithm
Convex Hull Furthest Cell Algorithm
Dynamically updating to dataset
BRFN
Dynamically updating to dataset
PFC: update R-tree
CHFC:
update R-tree& re-compute CH (expensive)
Qhull algorithm
Dynamically Maintaining CH: insertion
CP{ p7 } CCP { p7 }
p7
p5
p6
p1
p4
p2
p3
Dynamically Maintaining CH: deletion
p2
p7
p8
p9
p6
p1
p3
p5
p4
The qhull algorithm
Dynamically Maintaining CH
p1
e2
p2
maxVdist
e3
minVdist
e1
p3
Adapt qhull to R-tree
Outline
MRFN
Progressive
Furthest Cell Algorithm
Convex Hull Furthest Cell Algorithm
Dynamically updating to dataset
BRFN
BRFN
After resolving all the difficulties for the
MRFN problem, solving the BRFN
problem becomes almost immediate.
Observations:
all
points in P that are contained by fvc(q,Q) will have
q as their furthest neighbor.
Only the vertexes of the convex hull have fvc.
BRFN algorithm
BRFN(Query q, Q; R-tree T)
Compute the convex hull CQ of Q;
If q CQ then return empty;
Else
Compute
fvc(q, CQ );
Execute a range query using fvc(q,CQ ) on T;
BRFN: Disk-Resident Query Group
Limitation: query group size may not fit in
memory
Solution: Approximate convex hull of Q
(Dudley’s approximation)
Experiment Setup
Dataset:
Real dataset (Map: USA, CA, SF)
Synthetic dataset (UN, CB, R-Cluster)
Measurement
Computation
time
Number of IOs
Average of 1000 queries
MRFN algorithm
CPU computation
Number of IOs
BRFN algorithms
CPU: vary A, Q=1000
IOs: vary A, Q=1000
Scalability of various algorithms
MRFN number of IOs
BRFN number of IOs
Conclusion
Introduced a novel query (RFN) for spatial
databases.
Presented R-tree based algorithms for
both versions of RFN that feature excellent
pruning capability.
Conducted a comprehensive experimental
evaluation.
Thank you!
Questions?
Datasets: San Francisco
Datasets: California
Datasets: North America
Datasets : uncorrelated uniform
Datasets : correlated bivariate
Datasets : random clusters