An efficient k nearest neighbors searching algorithm for a query line

  • Authors:
  • Subhas C. Nandy;Sandip Das;Partha P. Goswami

  • Affiliations:
  • Advanced Computing and Microelectronics Unit, Indian Statistical Institute, 203 B.T. Road, Kolkata 700 108, India;Advanced Computing and Microelectronics Unit, Indian Statistical Institute, 203 B.T. Road, Kolkata 700 108, India;Computer Center, Calcutta University, Kolkata 700 009, India

  • Venue:
  • Theoretical Computer Science
  • Year:
  • 2003

Quantified Score

Hi-index 5.23

Visualization

Abstract

We present an algorithm for finding k nearest neighbors of a given query line among a set of n points distributed arbitrarily on a two-dimensional plane. Our algorithm requires O(n2) time and O(n2/log n) space to preprocess the given set of points, and it answers the query for a given line in O(k + log n) time, where k may also be an input at the query time. Almost a similar technique works for finding k farthest neighbors of a query line, keeping the time and space complexities invariant. We also show that if k is known at the time of preprocessing, the time and space complexities for the preprocessing can be reduced keeping the query times unchanged.