Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Name of this algorithm, and is there a numpy/scipy implementation of it?

Motivation:

I've seen this algorithm described, and I'd rather not reinvent the wheel if a standard implementation exists. I've also learned that if there is a scipy/numpy implementation, it is usually much faster than anything I can roll myself in python.

Algorithm Description

I have a large number of points on the plane (several million). Starting with a large box that encompasses all the points, I'd like to continuously subdivide the box into equal area sub-boxes. The subdivision continues recursively while there are at least 1,000 points in the sub-box. The algorithm returns a tree that describes the subdivisions and the mapping of the points to each leaf node of the tree.

What is the name of this algorithm (something like divide and conquer?), and is there a standard method of doing it when given a 2D numpy array of points?

like image 289
Hooked Avatar asked Mar 21 '12 18:03

Hooked


People also ask

What is SciPy and NumPy?

NumPy, stands for Numerical Python, is used for the manipulation of elements of numerical array data. SciPy, stands for Scientific Python, is used for numerical computations in Python. Both these packages provide extended functionality to work with Python.

Does NumPy have SciPy?

SciPy builds on NumPy. All the numerical code resides in SciPy. The SciPy module consists of all the NumPy functions. It is however better to use the fast processing NumPy.

Is SciPy different from NumPy?

What is the difference between NumPy and SciPy? In an ideal world, NumPy would contain nothing but the array data type and the most basic operations: indexing, sorting, reshaping, basic elementwise functions, etc. All numerical code would reside in SciPy.

What is SciPy used for in Python?

SciPy is a collection of mathematical algorithms and convenience functions built on the NumPy extension of Python. It adds significant power to the interactive Python session by providing the user with high-level commands and classes for manipulating and visualizing data.


1 Answers

It's called a quadtree partition. As far as Python code, see this thread.

like image 153
Ted Hopp Avatar answered Sep 30 '22 18:09

Ted Hopp