I got n points which belong to a rainbow (or are close to being a “rainbow color”). Now given a point which is also a rainbow color, I want to find the closest match out of the n points.
What is a robust and simple data structure + algorithm combination to do this? Using (R,G,B) tuples and Eularian distances came to my mind.
Yes, I got a serious use case 🙂
I’m not playing around with rainbows 😉 but I have almost the same situation and I use a kd-tree for this to quickly search the closest “point”. My points are also rgb colors in the form of 0-1 floats
http://code.google.com/p/python-kdtree/