, Volume 11, Issue 2, pp 159–193 | Cite as

Algorithms for Nearest Neighbor Search on Moving Object Trajectories

  • Elias Frentzos
  • Kostas Gratsias
  • Nikos Pelekis
  • Yannis TheodoridisEmail author


Nearest Neighbor (NN) search has been in the core of spatial and spatiotemporal database research during the last decade. The literature on NN query processing algorithms so far deals with either stationary or moving query points over static datasets or future (predicted) locations over a set of continuously moving points. With the increasing number of Mobile Location Services (MLS), the need for effective k-NN query processing over historical trajectory data has become the vehicle for data analysis, thus improving existing or even proposing new services. In this paper, we investigate mechanisms to perform NN search on R-tree-like structures storing historical information about moving object trajectories. The proposed (depth-first and best-first) algorithms vary with respect to the type of the query object (stationary or moving point) as well as the type of the query result (historical continuous or not), thus resulting in four types of NN queries. We also propose novel metrics to support our search ordering and pruning strategies. Using the implementation of the proposed algorithms on two members of the R-tree family for trajectory data (namely, the TB-tree and the 3D-R-tree), we demonstrate their scalability and efficiency through an extensive experimental study using large synthetic and real datasets.


nearest neighbor moving objects NN query processing on R-tree-like structures storing historical trajectories 



Research partially supported by the GeoPKDD (“Geographic Privacy-aware Knowledge Discovery and Delivery”) project funded by the European Community under FP6-014915 contract. Research grants by the Archimedes and Pythagoras EPEAEK II Programmes jointly funded by the European Community and the Greek Ministry of National Education and Religious Affairs are also acknowledged. We also thank the anonymous reviewers for providing valuable comments which improved the quality of the paper.


  1. 1.
    R. Benetis, C. Jensen, G. Karciauskas, and S. Saltenis. “Nearest neighbor and reverse nearest neighbor queries for moving objects,” in Proceedings of IDEAS, 2002.Google Scholar
  2. 2.
    S. Babu and J. Widom. “Continuous queries over data streams,” SIGMOD Record, Vol. 30(3):109–120, 2001 (September).CrossRefGoogle Scholar
  3. 3.
    K.L. Cheung and A.W. Fu. “Enhanced nearest neighbour search on the R-tree,” SIGMOD Record, Vol. 27(3):16–21, 1998 (September).CrossRefGoogle Scholar
  4. 4.
    A. Guttman. “Rtrees: A dynamic index structure for spatial searching,” in Proceedings of ACM SIGMOD, 1984.Google Scholar
  5. 5.
    G. Hjaltason and H. Samet. “Distance browsing in spatial databases,” ACM Transactions on Database Systems, Vol. 24(2):265–318, 1999.CrossRefGoogle Scholar
  6. 6.
    H. Hu, J. Xu, and D.L. Lee. “A generic framework for monitoring continuous spatial queries over moving objects,” in Proceedings of ACM SIGMOD, 2005.Google Scholar
  7. 7.
    G.S. Iwerks, H. Samet, and K. Smith, “Continuous K-nearest neighbor queries for continuously moving points with updates,” in Proceedings of VLDB, 2003.Google Scholar
  8. 8.
    Y. Manolopoulos, A. Nanopoulos, A.N. Papadopoulos, and Y. Theodoridis. R-trees: Theory and Applications. Springer: Berlin Heidelberg New York, 2005.Google Scholar
  9. 9.
    K. Mouratidis, M. Hadjieleftheriou, and D. Papadias. “Conceptual partitioning: An efficient method for continuous nearest neighbor monitoring,” in Proceedings of ACM SIGMOD, 2005.Google Scholar
  10. 10.
    M.F. Mokbel, X. Xiong, and W.G. Aref, “SINA: Scalable incremental processing of continuous queries in spatio-temporal databases,” in Proceedings of ACM SIGMOD, 2004.Google Scholar
  11. 11.
    D. Pfoser, C.S. Jensen, and Y. Theodoridis, “Novel approaches to the indexing of moving object trajectories,” in Proceedings of VLDB, 2000.Google Scholar
  12. 12.
    N. Roussopoulos, S. Kelley, and F. Vincent. “Nearest neighbor queries,” in Proceedings of ACM SIGMOD, 1995.Google Scholar
  13. 13.
    S. Saltenis, C.S. Jensen, S. Leutenegger, and M. Lopez. “Indexing the positions of continuously moving objects,” in Proceedings of ACM SIGMOD, 2000.Google Scholar
  14. 14.
    C. Shahabi, M. Kolahdouzan, and M. Sharifzadeh. “A road network embedding technique for K-nearest neighbor search in moving object databases,” GeoInformatika, Vol. 7(3):255–273, 2003.CrossRefGoogle Scholar
  15. 15.
    Z. Song and N. Roussopoulos. “K-nearest neighbor search for moving query point,” in Proceedings of SSTD, 2001.Google Scholar
  16. 16.
    Y. Tao and D. Papadias, “Time parameterized queries in spatio-temporal databases,” in Proceedings of ACM SIGMOD, 2002.Google Scholar
  17. 17.
    Y. Tao, D. Papadias, and Q. Shen. “Continuous nearest neighbor search,” Proceedings of VLDB, 2002.Google Scholar
  18. 18.
    Y. Theodoridis. “The R-tree portal,” URL: (accessed 13 December 2005).
  19. 19.
    Y. Theodoridis, J.R.O. Silva, and M.A. Nascimento. “On the generation of spatio-temporal datasets,” in Proceedings of SSD, 1999.Google Scholar
  20. 20.
    Y. Tao, J. Sun, and D. Papadias. “Analysis of predictive spatio-temporal queries,” ACM Transactions on Database Systems, Vol. 28(4):295–336, 2003 December.CrossRefGoogle Scholar
  21. 21.
    Y. Theodoridis, M. Vazirgiannis, and T. Sellis. “Spatio-temporal indexing for large multimedia applications.” in Proceedings of ICMCS, 1996.Google Scholar
  22. 22.
    X. Yu, K. Pu, and N. Koudas. “Monitoring k-nearest neighbor queries over moving objects,” in Proceedings of ICDE, 2005.Google Scholar
  23. 23.
    X. Xiong, M. Mokbel, and W. Aref. “SEA-CNN: Scalable processing of continuous K-nearest neighbor queries in spatio-temporal databases,” in Proceedings of ICDE, 2005.Google Scholar

Copyright information

© Springer Science+Business Media, LLC 2007

Authors and Affiliations

  • Elias Frentzos
    • 1
  • Kostas Gratsias
    • 1
    • 2
  • Nikos Pelekis
    • 1
  • Yannis Theodoridis
    • 1
    • 2
    Email author
  1. 1.Information Systems Laboratory, Department of InformaticsUniversity of PiraeusPiraeusGreece
  2. 2.Data and Knowledge Engineering Group, R. A. Computer Technology InstitutePatrasGreece

Personalised recommendations