kdtree

KDTree Implementation in Java

I'm looking for a KDTree implementation in Java. I've done a google search and the results seem pretty haphazard. There are actually lots of results, but they're mostly just little one-off implementations, and I'd rather find something with a little more "production value". Something like apache collections or the excellent C5 collection...

Which datastructure is appropriate for this situation?

I'm trying to decide which datastructure to use to store key-value pairs when only features needed are insertion lookup Specifically, I don't need to be able to delete pairs, or iterate through keys/values/pairs. The keys are integer tuples, the values are pointers (references, whatever). I'm only storing a couple million pairs spr...

kdtree implementation C++

Any recommendations for a C/C++ kd-tree? I'm looking for an existing implementation which the poster hopefully has worked with or has heard good things about. Also, I need to use this kd-tree to do a 1/2-NN search. ...

nearest neighbor - k-d tree - wikipedia proof.

On the wikipedia entry for k-d trees, an algorithm is presented for doing a nearest neighbor search on a k-d tree. What I don't understand is the explanation of step 3.2. How do you know there isn't a closer point just because the difference between the splitting coordinate of the search point and the current node is greater than the d...

Is k-d tree efficient for kNN search. k nearest neighbors search

I have to implement k nearest neighbors search for 10 dimensional data in kd-tree. But problem is that my algorithm is very fast for k=1, but as much as 2000x slower for k>1 (k=2,5,10,20,100) Is this normal for kd trees, or am I doing something worng? ...

Deleting an element from a kd-tree of two dimensions.

I would like to extend a kd-tree (2D) class to be able to remove nodes (points). This removal should be conducted without having to rebuild large sections of the tree. The algorithm described in these slides, on slide 13 seems to be what I am after. However, I am trouble following the description of "findmin()" found on slide 7, which is...

Efficient method for finding KNN of all nodes in a KD-Tree

I'm currently attempting to find K Nearest Neighbor of all nodes of a balanced KD-Tree (with K=2). My implementation is a variation of the code from the Wikipedia article and it's decently fast to find KNN of any node O(log N). The problem lies with the fact that I need to find KNN of each node. Coming up with about O(N log N) if I ...

Is it possible to find the KNN for a node that is *IN* the KD-tree?

Hi there, Trying to create a KNN search using a KD-tree. I can form the KD-tree fine (or at least, I believe I can!). My problem is that I am searching to find the closest 2 neighbours to every point in a list of points. So, is there a method to find the K nearest neighbours to a point using a KD tree even if the point is actually IN ...

C++: looking for thread based a parallel kd tree library.

Hello, Are there some implementation for KD-Tree on shared memory machines? thanks Arman. ...

Confused about definition of a 'median' when constructing a kd-Tree

Hi there. Im trying to build a kd-tree for searching through a set of points, but am getting confused about the use of 'median' in the wikipedia article. For ease of use, the wikipedia article states the pseudo-code of kd-tree construction as: function kdtree (list of points pointList, int depth) { if pointList is empty retu...

Simple C/C++ library for triangle-intersection acceleration structure

I'm raytracing and would like to speed it up via some acceleration structure (kd-tree, BVH, whatever). I don't want to code it up myself. What I've tried so far: Yanking the kd-tree out of pbrt. There are so many intra-dependencies that I couldn't succeed at this without pulling all of pbrt into my code. CGAL's AABB tree. Frustratingly...

Alternative to distance metric in nearest neighbor algorithm?

Hi, I came across an implementation of the nearest neighbor algorithm for finding matches between certain keypoints in two similar images. The keypoints were generated by the SIFT algorithm. The points are described by a 128 dimension vector, and there are many such points in both images. The matching algorithm uses the nearest neighbor...

How to use KDTree to make top-k query and range query on arbitrary dimensions

Hi, I have used KD-tree(libkdtree++) to store a multi-dimensional data set, and the requirements here is this data set can support top-k/range queries on different dimensions. For example, a KDTree<3, Point> tree: to find the top 100 points whose have highest Point[1](y axis) values. From the implementation of libkdtree++, what's sim...

KD-Tree in GLSL

Hi everybody, after one day of trying to figure out how to implement a kd-tree in OpenGL/GLSL i am pretty frustrated ... I declare my KD-Nodes like this in GLSL: layout(std140) uniform node{ ivec4 splitPoint; int dataPtr; } nodes[1024]; SplitPoint holds the kd-tree splitpoint, the fourth element of the vector holds the splitDire...

what is a range query

What is a range query over a kdtree and how is it done by python? ...

Is a KD-Tree a unique ordering of a given data set?

Given a set of data points, a kdtree is created over them, but is this kdtree a unique one? ...

Distributed KD-tree

Hi, My friend and I are working on a project for distributed KD-tree with applications to location-aware services in mind. Can anyone point us to papers related to this? Thanks ...

How to best store lines in a kd-tree

I know kd-trees are traditionally used to store points, but I want to store lines instead. Would it be best to split the line at every intersection with the splitting of the kd-tree? or would storing just the end-points into kd-suffice for nearest neighbor finding? ...