A k-d-tree (k-dimensional tree) is a data structure for storing points in multidimensional space. They can be used to efficiently query for whether a point exists, as well as to do Euclidean nearest-neighbor searches and searches inside of hyperdimensional rectangular regions.
Questions tagged [kdtree]
457 questions
0
votes
0 answers
Neighbour search with kd trees
I have a dataset of points in R^3. I'm able to build a kd-tree with python's subpackage spatial
(see here)
and performing a neighbour search (all points within distance r from the query point).
What I don't get is the following:
When I build the…

KungFury
- 9
- 1
0
votes
1 answer
SciPy KDTree distance units?
Let's say I have and array, where column 1 is in feet, column 2 is in feet, and column 3 is in seconds. For example:
x = [50 40 30]
I then have another array, y, with the same units and same number of columns, but many rows. I then turn it into a…

user1566200
- 1,826
- 4
- 27
- 47
0
votes
1 answer
Why need to alternate dimension in kd-tree construction
I have a question regarding the way to partition the spaces in kd-tree algorithm.
Assuming I have points in the plane, with (x,y) coordinate. Assuming we're not in a particular situation when points are in the same line. I was thinking why we need…

ctNGUYEN
- 241
- 2
- 6
0
votes
1 answer
Conditional jump or move depends on uninitialised value(s) and Segmentation fault
I'm using a ANN library (kdtree) and I have a problem creating and destroying these objects:
This is my constructor:
myKdtree::myKdtree(vector *P){
int nnPts = P->size();
dataPts = annAllocPts(P->size(), DIM);
for (int i = 0; i…

froure
- 121
- 2
- 10
0
votes
1 answer
Fast k-NN search over bag-of-words models
I have a large amount of documents of equal size. For each of those documents I'm building a bag of words model (BOW). Number of possible words in all documents is limited and large (2^16 for example). Generally speaking, I have N histograms of size…

Evgeny Lazin
- 9,193
- 6
- 47
- 83
0
votes
1 answer
KdTree C implementation resulting in core dump
I'm dealing with a core dump issue to which whom I cannot find a solution. Any kind of help would be appreciated 'cause I'm getting hopeless.
I assume the error appears when getting to the second execution of the building function but I'm clueless…

Tomasz Szymanek
- 253
- 2
- 5
- 15
0
votes
0 answers
Different return and coordinate types in nanoflann radius search
I'm trying to use nanoflann in a project and am looking at the vector-of-vector and radius search examples.
I can't find a way to perform a radius search with a different data type than the coordinate type. For example, my coordinates are vectors…

thekamz
- 13
- 5
0
votes
2 answers
Data structure for spatial queries (kNN) on dynamic data
For spatial queries like nearest neighbor search, in theory, KD tree or Voronoi or R tree(or one of its variants) work. But what is the preferred data structure/algo for dynamic data?

mithya
- 363
- 1
- 10
0
votes
1 answer
C++: looking for thread based a parallel kd tree library
Are there some implementation for KD-Tree on shared memory machines?
thanks
Arman.

Arman
- 4,566
- 10
- 45
- 66
0
votes
1 answer
KD-Tree on secondary memory?
I know some of the range searching data structure, for example kd-tree, Range tree and quad-tree.
But all the implementation is in memory, how can I implementation them on secondary memory with high performance I/O efficiency?
Here is the…

Zhao Yuhao
- 11
- 1
0
votes
1 answer
Finding nearest neighbor(s) in a KD Tree
Warning: Fairly long question, perhaps too long. If so, I apologize.
I'm working on a program involving a nearest neighbor(s) search of a kd tree (in this example, it is an 11 dimensional tree with 3961 individual points). We've only just learned…

user2993631
- 13
- 5
0
votes
1 answer
Data structure for irregular grid
Im wondering what is the best data structure for grid containing different sized rectangles/squares as game map sectors. I need to acces object within that grid by simple xyz coordinates.
searched for KdTrees, but they seem to find nearest object,…

user2550696
- 111
- 2
- 11
0
votes
1 answer
Python optomise nearest neighbour for large arrays
I have an array of points in 4D space (my array is roughly 1,000,000 long).
For each value in my array I need to find the kth (where k = 81) nearest neighbours
I then do some further code based on that..
[in brief, I'm effectively trying to extend…

CastleH
- 339
- 1
- 3
- 14
0
votes
1 answer
Modify this algorithm for Nearest Neighbour Search (NNS) to perform Approximate-NNS
From the slides of a course, I found these:
Given a set P in R^D, and a query point q, it's NN is point p_0 in P, where:
dist(p_0, q) <= dist(p, q), for every p in P.
Similarly, with an approximation factor 1 > ε > 0, the ε-NN is p_0, such…

gsamaras
- 71,951
- 46
- 188
- 305
0
votes
1 answer
Combining items into fixed sized groups for k-d tree
I'm using a k-d tree for spacial partitioning in a ray-tracer. I want to combine near-by primitives into fixed-sized groups so the data in each group can be deinterleaved and processed simultaneously using SIMD instructions. What is a good fast…

Rouslan
- 93
- 1
- 6