Finding All Nearest Neighbors with a Single Graph Traversal

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10827)


Finding the nearest neighbor is a key operation in data analysis and mining. An important variant of nearest neighbor query is the all nearest neighbor (ANN) query, which reports all nearest neighbors for a given set of query objects. Existing studies on ANN queries have focused on Euclidean space. Given the widespread occurrence of spatial networks in urban environments, we study the ANN query in spatial network settings. An example of an ANN query on spatial networks is finding the nearest car parks for all cars currently on the road. We propose VIVET, an index-based algorithm to efficiently process ANN queries. VIVET performs a single traversal on a spatial network to precompute the nearest data object for every vertex in the network, which enables us to answer an ANN query through a simple lookup on the precomputed nearest neighbors. We analyze the cost of the proposed algorithm both theoretically and empirically. Our results show that the algorithm is highly efficient and scalable. It outperforms adapted state-of-the-art nearest neighbor algorithms in both precomputation and query processing costs by more than one order of magnitude.



This work is supported in part by Australian Research Council (ARC) Discovery Project DP180103332.


  1. 1.
    Safar, M., Ibrahimi, D., Taniar, D.: Voronoi-based reverse nearest neighbor query processing on spatial networks. Multimed. Syst. 15(5), 295–308 (2009)CrossRefGoogle Scholar
  2. 2.
    Mouratidis, K., Yiu, M.L., Papadias, D., Mamoulis, N.: Continuous nearest neighbor monitoring in road networks. In: VLDB, pp. 43–54 (2006)Google Scholar
  3. 3.
    Böhm, C., Krebs, F.: The k-nearest neighbour join: turbo charging the KDD process. Knowl. Inf. Syst. 6(6), 728–749 (2004)CrossRefGoogle Scholar
  4. 4.
  5. 5.
    Weinberger, R.R., Karlin-Resnick, J.: Parking in mixed-use US districts: oversupplied no matter how you slice the pie. Transp. Res. Rec.: J. Transp. Res. Board (2537), 177–184 (2015)Google Scholar
  6. 6.
    Chen, Y., Patel, J.M.: Efficient evaluation of all-nearest-neighbor queries. In: ICDE, pp. 1056–1065 (2007)Google Scholar
  7. 7.
    Xia, C., Lu, H., Ooi, B.C., Hu, J.: GORDER: an efficient method for KNN join processing. In: VLDB, pp. 756–767 (2004)Google Scholar
  8. 8.
    Zhang, J., Mamoulis, N., Papadias, D., Tao, Y.: All-nearest-neighbors queries in spatial databases. In: SSDBM, pp. 297–306 (2004)Google Scholar
  9. 9.
    Yu, C., Cui, B., Wang, S., Su, J.: Efficient index-based KNN join processing for high-dimensional data. Inf. Softw. Technol. 49(4), 332–344 (2007)CrossRefGoogle Scholar
  10. 10.
    Emrich, T., Graf, F., Kriegel, H.-P., Schubert, M., Thoma, M.: Optimizing all-nearest-neighbor queries with trigonometric pruning. In: Gertz, M., Ludäscher, B. (eds.) SSDBM 2010. LNCS, vol. 6187, pp. 501–518. Springer, Heidelberg (2010). Scholar
  11. 11.
    Chen, H.L., Chang, Y.I.: All-nearest-neighbors finding based on the Hilbert curve. Expert Syst. Appl. 38(6), 7462–7475 (2011)CrossRefGoogle Scholar
  12. 12.
    Guttman, A.: R-trees: a dynamic index structure for spatial searching. In: SIGMOD, pp. 47–57 (1984)Google Scholar
  13. 13.
    Zhong, R., Li, G., Tan, K.L., Zhou, L.: G-tree: an efficient index for KNN search on road networks. In: CIKM, pp. 39–48 (2013)Google Scholar
  14. 14.
    Akiba, T., Iwata, Y., Kawarabayashi, K.I., Kawata, Y.: Fast shortest-path distance queries on road networks by pruned highway labeling. In: ALENEX, pp. 147–154 (2014)Google Scholar
  15. 15.
    Dijkstra, E.W.: A note on two problems in connexion with graphs. Numer. Math. 1(1), 269–271 (1959)MathSciNetCrossRefGoogle Scholar
  16. 16.
    Eklund, P.W., Kirkby, S., Pollitt, S.: A dynamic multi-source Dijkstra’s algorithm for vehicle routing. In: ANZIIS, pp. 329–333 (1996)Google Scholar
  17. 17.
    Duckham, M., Kulik, L.: A formal model of obfuscation and negotiation for location privacy. In: Gellersen, H.-W., Want, R., Schmidt, A. (eds.) Pervasive 2005. LNCS, vol. 3468, pp. 152–170. Springer, Heidelberg (2005). Scholar
  18. 18.
    Abeywickrama, T., Cheema, M.A., Taniar, D.: K-nearest neighbors on road networks: a journey in experimentation and in-memory implementation. PVLDB 9(6), 492–503 (2016)Google Scholar
  19. 19.
    Papadias, D., Zhang, J., Mamoulis, N., Tao, Y.: Query processing in spatial network databases. In: VLDB, pp. 802–813 (2003)CrossRefGoogle Scholar
  20. 20.
  21. 21.
  22. 22.
    Kolahdouzan, M., Shahabi, C.: Voronoi-based k nearest neighbor search for spatial network databases. In: VLDB, pp. 840–851 (2004)Google Scholar
  23. 23.
    Samet, H., Sankaranarayanan, J., Alborzi, H.: Scalable network distance browsing in spatial databases. In: SIGMOD, pp. 43–54. ACM (2008)Google Scholar
  24. 24.
    Lee, K.C., Lee, W.C., Zheng, B., Tian, Y.: ROAD: a new spatial object search framework for road networks. TKDE 24(3), 547–560 (2012)Google Scholar
  25. 25.
    Clarkson, K.L.: Fast algorithms for the all nearest neighbors problem. In: FOCS, pp. 226–232 (1983)Google Scholar
  26. 26.
    Vaidya, P.M.: An O(n log n) algorithm for the all-nearest-neighbors problem. Discret. Comput. Geom. 4(1), 101–115 (1989)CrossRefGoogle Scholar
  27. 27.
    Sankaranarayanan, J., Samet, H., Varshney, A.: A fast all nearest neighbor algorithm for applications involving large point-clouds. Comput. Graph. 31(2), 157–174 (2007)CrossRefGoogle Scholar
  28. 28.
    Yu, C., Ooi, B.C., Tan, K.L., Jagadish, H.: Indexing the distance: an efficient method to KNN processing. In: VLDB, vol. 1, pp. 421–430 (2001)Google Scholar

Copyright information

© Springer International Publishing AG, part of Springer Nature 2018

Authors and Affiliations

  1. 1.School of Computing and Information SystemsThe University of MelbourneMelbourneAustralia

Personalised recommendations