data_structures.kd_tree.nearest_neighbour_search¶

Functions¶

nearest_neighbour_search(→ tuple[list[float] | None, ...)

Performs a nearest neighbor search in a KD-Tree for a given query point.

Module Contents¶

data_structures.kd_tree.nearest_neighbour_search.nearest_neighbour_search(root: data_structures.kd_tree.kd_node.KDNode | None, query_point: list[float]) → tuple[list[float] | None, float, int]¶

Performs a nearest neighbor search in a KD-Tree for a given query point.

Args:

root (KDNode | None): The root node of the KD-Tree. query_point (list[float]): The point for which the nearest neighbor

is being searched.

Returns:
tuple[list[float] | None, float, int]:
  • The nearest point found in the KD-Tree to the query point, or None if no point is found.

  • The squared distance to the nearest point.

  • The number of nodes visited during the search.

thealgorithms-python

Navigation

index.md

  • Contributing guidelines
  • Getting Started
  • Community Channels
  • List of Algorithms
  • MIT License
  • API Reference
    • maths
    • other
    • sorts
    • graphs
    • hashes
    • matrix
    • ciphers
    • geodesy
    • physics
    • quantum
    • strings
    • fractals
    • geometry
    • graphics
    • knapsack
    • searches
    • financial
    • blockchain
    • scheduling
    • conversions
    • electronics
    • fuzzy_logic
    • backtracking
    • audio_filters
    • file_transfer
    • project_euler
    • greedy_methods
    • linear_algebra
    • neural_network
    • boolean_algebra
    • computer_vision
    • data_structures
    • networking_flow
    • web_programming
    • bit_manipulation
    • data_compression
    • machine_learning
    • cellular_automata
    • genetic_algorithm
    • divide_and_conquer
    • linear_programming
    • dynamic_programming
    • digital_image_processing

Related Topics

  • Documentation overview
    • API Reference
      • data_structures
        • data_structures.kd_tree
          • Previous: data_structures.kd_tree.kd_node
          • Next: data_structures.kd_tree.tests
©2014, TheAlgorithms. | Powered by Sphinx 8.2.3 & Alabaster 1.0.0 | Page source