Performance of Nearest Neighbor Queries in R-trees

 
Performance of Nearest
Neighbor Queries in R-trees
 
Apostolos Papadopoulos and Yannis
Manolopoulos
 
Presenter: Uma Kannan
 
Contents
 
1.
Introduction
1.
Spatial data Management Research
2.
Spatial Access Methods Research
2.
Statement of The Problem
3.
Solution to the Problem
4.
Background
1.
The Packed R-Tree
2.
Branch and Bound Algorithm
5.
Metrics for NN Search
6.
Pruning the Search in the R-tree
7.
The NN Branch-And-Bound Search Algorithm
8.
Experimental Results
1.
Preliminaries
2.
Experimentation
3.
Result Interpretation
9.
Conclusions
10.
Future Work
 
2
 
Introduction: Spatial data
Management Research
 
Spatial data management research focused
mainly on:
the design of robust and efficient spatial data
structures
the invention of new spatial data models
the construction of effective query languages
the query processing and optimization of spatial
queries
A very important research direction is the
estimation
 
of the performance
, and the
selectivity
 
of a query
.
 
3
 
Introduction: Spatial data
Management Research – Cont.
 
Performance:
 the response time of a query
Selectivity:
 the fraction of the objects that
fulfills the query versus the database
population.
Evidently, we want these estimates available
prior to query processing, in order for the
query optimizer to determine an efficient
access plan.
 
4
 
Introduction: Spatial Access Methods
Research
 
Nearest Neighbor (NN) queries are very
important in Geographic Information Systems, in
Image Databases, in Multimedia Applications.
However, researchers working on spatial accesses
methods focused mainly on 
range queries 
and
spatial join queries
.
In the past the problem of NN query processing
has been addressed by examining access
methods based on 
k-d trees
 and 
quadtrees
.
Recently a 
branch-and-bound algorithm 
based on
R-trees has been developed for NN queries.
 
5
 
Statement of The Problem
 
How to estimate the performance of NN
queries in spatial data structures (particularly
in R-Trees), from the techniques inherently
used for the analysis of spatial range and join
queries?
What is efficiency of Branch-And-Bound NN
queries?
 
6
 
Solution to the Problem
 
To address the problem the authors,
Uses Branch-And-Bound Algorithm for Spatial NN queries.
Combine techniques that were inherently used for the
analysis of range and spatial join queries, in order to derive
effective measures regarding the performance of NN
queries.
Estimates the average lower and upper bounds for the
number of leaf pages retrieved during NN query
processing.
Evidently, CPU time is also important for computationally
intensive queries, but in general the I/O subsystem
overhead dominates, specifically in large spatial databases.
 
7
 
Background: The Packed R-Tree
 
The paper uses the 
packed R-tree
 of Kamel and
Faloutsos.
The packed R-tree is constructed as follows:
1.
The Hilbert value of each data object is calculated
2.
The whole dataset is sorted based on the Hilbert values.
3.
The leaf level of the tree is formulated by taking
consecutive objects (with respect to the Hilbert order)
and storing them in one data page.
4.
The same process is repeated for the upper levels of the
structure.
 
8
 
9
 
Figure: The Hilbert Curves
 
10
 
 
 
Figure: Data rectangles organized in a Hilbert R-tree
 
Figure: The file structure for the previous Hilbert R-tree
 
Background: Branch and Bound Algorithm
 
Branch-and-bound
 search is a way to combine the
space saving of depth-first search with heuristic
information.
The branch-and-bound search maintains the lowest-
cost and path to a goal found so far.
It is particularly applicable when
many paths to a goal exist and we want an optimal path.
Many goals are available and we want nearest goal.
Branch-and-bound search generates a sequence of
ever-improving solutions. Once it has found a solution,
it can keep improving it.
 
11
 
Branch and Bound Algorithm: A Simple Example
 
Our aim is to find the goal (G1 or G2) from A
 
12
 
13
 
14
 
15
 
Metrics for NN Search
 
Given a query point P and an Object O enclosed
in its MBR, there are two metrics for ordering the
NN search:
MINDIST: The minimum distance of object O from P.
MINMAXDIST: The minimum of the maximum possible
distances from P to a face (or vertex) of the MBR
containing O.
The MINDIST and MINMAXDIST offers a lower
and an upper bound on the actual distance of O
from P respectively.
 
16
 
MINDIST
 
17
 
P  is a point in n-d space with co-ordinates (P1 ,P2, ...,Pn)
R is a rectangle R with corners (s1, s2, ..., sn) and (t1, t2, ..., tn) bottom-left and
top-right respectively.
 
MINMAXDIST
 
18
 
Figure: MINDIST and MINMAXDIST in 2D Space
 
19
 
Figure: MINDIST and MINMAXDIST in 3D Space
 
20
 
Pruning the Search in the R-tree
 
Rule 1: 
If an MBR R has MINDIST(P, R) greater than the
MINMAXDIST(P, R’) of another MBR R’, then it is
discarded because it cannot enclose the nearest
neighbor of P.
Rule 2: 
If an actual distance d from P to a given object,
is greater than the MINMAXDIST(P, R) of P to an MBR
R, then d is replaced with MINMAXDIST(P, R) because R
contains an object which is closer to P.
Rule 3: 
If d is the current minimum distance, then all
MBRs R
j
 with MINDIST(P, R
j
 ) > d are discarded, because
they cannot enclose the nearest neighbor of P.
 
21
 
The NN Branch-And-Bound Search
Algorithm
 
Begin at the root and proceeds down the tree
Initially assume the NN distance as infinity.
During the descending phase (i.e., at every new non-leaf node)
Compute MINDEST for all its MBRs
Sorts them into an Active Branch List (ABL).
Apply pruning strategies 1 and 2 (i.e., Rule 1 and 2) to the ABL to remove
unnecessary branches.
Repeat until ABL is empty
Select the next branch in the list
Recursively visit child nodes
Perform upward pruning
At leaf level compute the distance to the actual objects
Return new value for NN
Take the new estimate of NN and apply pruning strategy 3 to remove all
branches with MINDIST (P,M) > Nearest for all MBRs M in the MBL.
 
22
 
Experimental Results: Preliminaries
 
Experiment Setup:
Branch-and-bound algorithm
Hilbert packed R-tree
C programming language under UNIX
DEC Alpha 3000 workstation
Dataset
Uniformly generated random points
Real-life points (9,552 road intersections of the Montgomery County,
Maryland. )
 
23
 
Experimental Results: Experimentation
 
The authors conducted 3 experiments.
In all three experiments the authors calculated
the following for each data set,
The average number of leaf accesses (calculated
by issuing NN query for each existing data point).
The lower and upper bounds for the average
number of leaf accesses.
 
24
 
Experimental Results: Experiment 1
 
Dataset: 1,000 to 500,000 uniformly distributed points.
Fanout (The maximum R-tree node capacity): 50
 
25
 
Experimental Results: Experiment 2
 
Dataset:  50,000 uniformly distributed points.
Maximum fanout: 10 to 200.
 
26
 
Experimental Results: Experiment 3
 
Dataset: 9000 MG points.
Maximum fanout: 10 to 200.
 
27
 
Result Interpretation
 
From the results, the authors observed the
following:
The measured number of leaf accesses is generally
closer to the lower bound than the upper bound.
When the data (and hence the query) distribution
is uniform, the bounds do not depend on the
population of the dataset.
 
28
 
Conclusions
 
This paper focused on the performance
estimation of NN queries in in R-trees.
The only known algorithm for NN queries in R-
trees is the branch-and-bound algorithm to the
best of the authors' knowledge.
Have shown that the actual distance between a
point and its NN plays a very important role for
the performance estimation of NN queries.
The performance of the branch-and-bound
algorithm is closer to the lower bound, and
therefore is very efficient.
 
29
 
Future Work
 
Modification of the Formulae for lower bound and upper
bound in order to estimate the performance of arbitrary k-
NN queries.
Derivation of a formula for the exact performance
prediction of NN query processing .
The relaxation of the basic assumption.
Generalization for non-point objects.
Consideration of complex queries with several constraints
(e.g. find the NN of the point P, such that the distance is >=
d).
Consideration of the case where we request the NN for a
point P that does not belong to the data set.
Examination of the case where the R-tree is not that “good”
as the packed R-tree (e.g. Guttman's R-tree).
 
30
 
References
 
[Aref93] W. Aref: "Query Processing and Optimization in Spatial Databases", 
Technical Report
CS-TR-3097, Department of Computer Science, 
University of Maryland at College Park, MD,
1993.
[Arya93] M. Arya, W. Cody, C. Faloutsos, J. Richardson and A. Toga: "QBISM: a Prototype 3-d
Medical Image Database System", 
IEEE Data Engineering Bulletin, 
16(1), pp.38-42, March 1993.
[Beckg0] N. Beckmann, H.P. Kriegel and B. Seeger: "The R*-tree: an Efficient and Robust
Method for Points and Rectangles", 
Proceedings of the 1990 ACM SIGMOD Conference, 
pp.322-
331, Atlantic City, NJ, 1990.
[Belu95] A. Belussi and C. Faloutsos: "Estimating the Selectivity of Spatial Queries Using the
'Correlation' Fractal Dimension", 
Proceedings of the 21th VLDB Con-
~erence, 
pp.299-310,
Zurich, Switzerland, 1995.
[Brin93] T. Brinkhoff, tI.P. Kriegel and B. Seeger: "Efficient Processing of Spatial Join Using R-
trees", 
Proceedings of the 1990 ACM SIGMOD Conference, 
pp.237-246, Washington DC, 1993.
[Egen94] M. Egenhofer: '`spatial SQL: a Query and Presentation Language", 
1EEE Transactions
on Knowledge and Data Engineering, 
vol.6, no.l, pp.86-95, 1994.
[Fagi98] R. Fagin: "Combining Fuzzy Information  “On Multiple Systems”, 
Proceedings of the
15th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS '96),
pp.216-226, Montreal, Canada, 1996.
[Fa194] C. Faloutsos and I. Kameh "Beyond Uniformity and Independence, Analysis  of R-trees
Using the Concept of Fractal Dimension", 
Proceedings of the 13
th
 ACM SIGACT-SIGMOD-SIGART
Symposium on Principles of Database Systems (PODS ~4), 
pp.4-13, Minneapolis, MN, 1994.
 
31
 
References
 
[Frie77] J.H. Friedman, J.L. Bentley and R.A. Finkel: "An Algorithm for Finding the Best
Matches in Logarithmic Expected Time", 
AGM Transactions on Math. Software, 
vol.3,
pp.209-226, 1977.
[Guen89] O. Guenther: "The Design of the Cell Tree: an Object-Oriented Index Structure
for Geometric Databases", 
Proceedings of the 5th IEEE Conference on Data Engineering,
pp.598-615, Los Angeles, CA, 1989.
[Guti94] R.H. Guting: "An Introduction to Spatial Database Systems", The 
VLDB 
Journal,
vol.3, no.4, pp.357-399, 1994.
[Gutt84] A. Guttman: "R-trees: a Dynamic Index Structure for Spatial Searching",
Proceedings of the 1985 ACM SIGMOD Conference, 
pp.47-57, Boston, M.A, 1984.
[Henr89] A. Henrich, H.W. Six and P. Widmayer: ''The LSD-tree: Spatial Access to
Multidimensional Point and non-Point Objects", 
Proceedings of the 15th VLDB
Conference, 
pp.45-53, Amsterdam, Netherlands, 1989.
[Kame93] I. Kamel and C. Faloutsos: "On Packing R-trees", 
Proceedings of the 2nd
Conference on Information and Knowledge Management (CIKM), 
Washington DC, 1993.
[Kame94] I. Kamel and C. Faloutsos: "Hilbert R-tree: an Improved R-tree Using Fractals",
Proceedings of the 20th VLDB Conference, 
pp.500-509, Santiago, Chile, 1994.
[Laur92] R. Laurini and D. Thompson: 
‘”Fundamentals of Spatial Information Systems",
Academic Press, London, 1992.
[LoRa94] M.L. Lo and C.V. Ravishankar: "Spatial Joins Using Seeded Trees", Proc
eedings
of the 1995 AGM SIGMOD Conference, 
pp.209-220, Minneapolis, MN, 1994.
 
32
Slide Note
Embed
Share

Spatial data management research focuses on designing robust spatial data structures, inventing new models, constructing query languages, and optimizing query processing. This study explores the estimation of query performance and selectivity, specifically in R-trees, for efficient access planning. Nearest Neighbor (NN) queries are crucial in various applications, and this research delves into the efficiency of Branch-And-Bound algorithm for NN queries utilizing R-trees.

  • Spatial data
  • R-trees
  • Nearest Neighbor queries
  • Query optimization
  • Branch-And-Bound algorithm

Uploaded on Jul 16, 2024 | 3 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Performance of Nearest Neighbor Queries in R-trees Apostolos Papadopoulos and Yannis Manolopoulos Presenter: Uma Kannan

  2. Contents 1. Introduction 1. Spatial data Management Research 2. Spatial Access Methods Research Statement of The Problem Solution to the Problem Background 1. The Packed R-Tree 2. Branch and Bound Algorithm Metrics for NN Search Pruning the Search in the R-tree The NN Branch-And-Bound Search Algorithm Experimental Results 1. Preliminaries 2. Experimentation 3. Result Interpretation Conclusions 10. Future Work 2. 3. 4. 5. 6. 7. 8. 9. 2

  3. Introduction: Spatial data Management Research Spatial data management research focused mainly on: the design of robust and efficient spatial data structures the invention of new spatial data models the construction of effective query languages the query processing and optimization of spatial queries A very important research direction is the estimation of the performance, and the selectivity of a query. 3

  4. Introduction: Spatial data Management Research Cont. Performance: the response time of a query Selectivity: the fraction of the objects that fulfills the query versus the database population. Evidently, we want these estimates available prior to query processing, in order for the query optimizer to determine an efficient access plan. 4

  5. Introduction: Spatial Access Methods Research Nearest Neighbor (NN) queries are very important in Geographic Information Systems, in Image Databases, in Multimedia Applications. However, researchers working on spatial accesses methods focused mainly on range queries and spatial join queries. In the past the problem of NN query processing has been addressed by examining access methods based on k-d trees and quadtrees. Recently a branch-and-bound algorithm based on R-trees has been developed for NN queries. 5

  6. Statement of The Problem How to estimate the performance of NN queries in spatial data structures (particularly in R-Trees), from the techniques inherently used for the analysis of spatial range and join queries? What is efficiency of Branch-And-Bound NN queries? 6

  7. Solution to the Problem To address the problem the authors, Uses Branch-And-Bound Algorithm for Spatial NN queries. Combine techniques that were inherently used for the analysis of range and spatial join queries, in order to derive effective measures regarding the performance of NN queries. Estimates the average lower and upper bounds for the number of leaf pages retrieved during NN query processing. Evidently, CPU time is also important for computationally intensive queries, but in general the I/O subsystem overhead dominates, specifically in large spatial databases. 7

  8. Background: The Packed R-Tree The paper uses the packed R-tree of Kamel and Faloutsos. The packed R-tree is constructed as follows: 1. The Hilbert value of each data object is calculated 2. The whole dataset is sorted based on the Hilbert values. 3. The leaf level of the tree is formulated by taking consecutive objects (with respect to the Hilbert order) and storing them in one data page. 4. The same process is repeated for the upper levels of the structure. 8

  9. Figure: The Hilbert Curves 9

  10. http://upload.wikimedia.org/wikipedia/en/8/8a/Figure3_data_rects.gifhttp://upload.wikimedia.org/wikipedia/en/8/8a/Figure3_data_rects.gif Figure: Data rectangles organized in a Hilbert R-tree File:Figure4 file structure.gif Figure: The file structure for the previous Hilbert R-tree 10

  11. Background: Branch and Bound Algorithm Branch-and-bound search is a way to combine the space saving of depth-first search with heuristic information. The branch-and-bound search maintains the lowest- cost and path to a goal found so far. It is particularly applicable when many paths to a goal exist and we want an optimal path. Many goals are available and we want nearest goal. Branch-and-bound search generates a sequence of ever-improving solutions. Once it has found a solution, it can keep improving it. 11

  12. Branch and Bound Algorithm: A Simple Example Our aim is to find the goal (G1 or G2) from A 12

  13. 13

  14. 14

  15. 15

  16. Metrics for NN Search Given a query point P and an Object O enclosed in its MBR, there are two metrics for ordering the NN search: MINDIST: The minimum distance of object O from P. MINMAXDIST: The minimum of the maximum possible distances from P to a face (or vertex) of the MBR containing O. The MINDIST and MINMAXDIST offers a lower and an upper bound on the actual distance of O from P respectively. 16

  17. MINDIST P is a point in n-d space with co-ordinates (P1 ,P2, ...,Pn) R is a rectangle R with corners (s1, s2, ..., sn) and (t1, t2, ..., tn) bottom-left and top-right respectively. 17

  18. MINMAXDIST 18

  19. Figure: MINDIST and MINMAXDIST in 2D Space 19

  20. Figure: MINDIST and MINMAXDIST in 3D Space 20

  21. Pruning the Search in the R-tree Rule 1: If an MBR R has MINDIST(P, R) greater than the MINMAXDIST(P, R ) of another MBR R , then it is discarded because it cannot enclose the nearest neighbor of P. Rule 2: If an actual distance d from P to a given object, is greater than the MINMAXDIST(P, R) of P to an MBR R, then d is replaced with MINMAXDIST(P, R) because R contains an object which is closer to P. Rule 3: If d is the current minimum distance, then all MBRs Rj with MINDIST(P, Rj ) > d are discarded, because they cannot enclose the nearest neighbor of P. 21

  22. The NN Branch-And-Bound Search Algorithm Begin at the root and proceeds down the tree Initially assume the NN distance as infinity. During the descending phase (i.e., at every new non-leaf node) Compute MINDEST for all its MBRs Sorts them into an Active Branch List (ABL). Apply pruning strategies 1 and 2 (i.e., Rule 1 and 2) to the ABL to remove unnecessary branches. Repeat until ABL is empty Select the next branch in the list Recursively visit child nodes Perform upward pruning At leaf level compute the distance to the actual objects Return new value for NN Take the new estimate of NN and apply pruning strategy 3 to remove all branches with MINDIST (P,M) > Nearest for all MBRs M in the MBL. 22

  23. Experimental Results: Preliminaries Experiment Setup: Branch-and-bound algorithm Hilbert packed R-tree C programming language under UNIX DEC Alpha 3000 workstation Dataset Uniformly generated random points Real-life points (9,552 road intersections of the Montgomery County, Maryland. ) 23

  24. Experimental Results: Experimentation The authors conducted 3 experiments. In all three experiments the authors calculated the following for each data set, The average number of leaf accesses (calculated by issuing NN query for each existing data point). The lower and upper bounds for the average number of leaf accesses. 24

  25. Experimental Results: Experiment 1 Dataset: 1,000 to 500,000 uniformly distributed points. Fanout (The maximum R-tree node capacity): 50 25

  26. Experimental Results: Experiment 2 Dataset: 50,000 uniformly distributed points. Maximum fanout: 10 to 200. 26

  27. Experimental Results: Experiment 3 Dataset: 9000 MG points. Maximum fanout: 10 to 200. 27

  28. Result Interpretation From the results, the authors observed the following: The measured number of leaf accesses is generally closer to the lower bound than the upper bound. When the data (and hence the query) distribution is uniform, the bounds do not depend on the population of the dataset. 28

  29. Conclusions This paper focused on the performance estimation of NN queries in in R-trees. The only known algorithm for NN queries in R- trees is the branch-and-bound algorithm to the best of the authors' knowledge. Have shown that the actual distance between a point and its NN plays a very important role for the performance estimation of NN queries. The performance of the branch-and-bound algorithm is closer to the lower bound, and therefore is very efficient. 29

  30. Future Work Modification of the Formulae for lower bound and upper bound in order to estimate the performance of arbitrary k- NN queries. Derivation of a formula for the exact performance prediction of NN query processing . The relaxation of the basic assumption. Generalization for non-point objects. Consideration of complex queries with several constraints (e.g. find the NN of the point P, such that the distance is >= d). Consideration of the case where we request the NN for a point P that does not belong to the data set. Examination of the case where the R-tree is not that good as the packed R-tree (e.g. Guttman's R-tree). 30

  31. References [Aref93] W. Aref: "Query Processing and Optimization in Spatial Databases", Technical Report CS-TR-3097, Department of Computer Science, University of Maryland at College Park, MD, 1993. [Arya93] M. Arya, W. Cody, C. Faloutsos, J. Richardson and A. Toga: "QBISM: a Prototype 3-d Medical Image Database System", IEEE Data Engineering Bulletin, 16(1), pp.38-42, March 1993. [Beckg0] N. Beckmann, H.P. Kriegel and B. Seeger: "The R*-tree: an Efficient and Robust Method for Points and Rectangles", Proceedings of the 1990 ACM SIGMOD Conference, pp.322- 331, Atlantic City, NJ, 1990. [Belu95] A. Belussi and C. Faloutsos: "Estimating the Selectivity of Spatial Queries Using the 'Correlation' Fractal Dimension", Proceedings of the 21th VLDB Con-~erence, pp.299-310, Zurich, Switzerland, 1995. [Brin93] T. Brinkhoff, tI.P. Kriegel and B. Seeger: "Efficient Processing of Spatial Join Using R- trees", Proceedings of the 1990 ACM SIGMOD Conference, pp.237-246, Washington DC, 1993. [Egen94] M. Egenhofer: '`spatial SQL: a Query and Presentation Language", 1EEE Transactions on Knowledge and Data Engineering, vol.6, no.l, pp.86-95, 1994. [Fagi98] R. Fagin: "Combining Fuzzy Information On Multiple Systems , Proceedings of the 15th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS '96), pp.216-226, Montreal, Canada, 1996. [Fa194] C. Faloutsos and I. Kameh "Beyond Uniformity and Independence, Analysis of R-trees Using the Concept of Fractal Dimension", Proceedings of the 13th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS ~4), pp.4-13, Minneapolis, MN, 1994. 31

  32. References [Frie77] J.H. Friedman, J.L. Bentley and R.A. Finkel: "An Algorithm for Finding the Best Matches in Logarithmic Expected Time", AGM Transactions on Math. Software, vol.3, pp.209-226, 1977. [Guen89] O. Guenther: "The Design of the Cell Tree: an Object-Oriented Index Structure for Geometric Databases", Proceedings of the 5th IEEE Conference on Data Engineering, pp.598-615, Los Angeles, CA, 1989. [Guti94] R.H. Guting: "An Introduction to Spatial Database Systems", The VLDB Journal, vol.3, no.4, pp.357-399, 1994. [Gutt84] A. Guttman: "R-trees: a Dynamic Index Structure for Spatial Searching", Proceedings of the 1985 ACM SIGMOD Conference, pp.47-57, Boston, M.A, 1984. [Henr89] A. Henrich, H.W. Six and P. Widmayer: ''The LSD-tree: Spatial Access to Multidimensional Point and non-Point Objects", Proceedings of the 15th VLDB Conference, pp.45-53, Amsterdam, Netherlands, 1989. [Kame93] I. Kamel and C. Faloutsos: "On Packing R-trees", Proceedings of the 2nd Conference on Information and Knowledge Management (CIKM), Washington DC, 1993. [Kame94] I. Kamel and C. Faloutsos: "Hilbert R-tree: an Improved R-tree Using Fractals", Proceedings of the 20th VLDB Conference, pp.500-509, Santiago, Chile, 1994. [Laur92] R. Laurini and D. Thompson: Fundamentals of Spatial Information Systems", Academic Press, London, 1992. [LoRa94] M.L. Lo and C.V. Ravishankar: "Spatial Joins Using Seeded Trees", Proceedings of the 1995 AGM SIGMOD Conference, pp.209-220, Minneapolis, MN, 1994. 32

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#