R Tree 50,000 foot overview?

Posted by roufamatic on Stack Overflow See other posts from Stack Overflow or by roufamatic
Published on 2010-05-07T07:54:21Z Indexed on 2010/05/07 7:58 UTC
Read the original article Hit count: 174

Filed under:
|
|
|

I'm working on a school project that involves taking a lat/long point and finding the top five closest points in a known list of places. The list is to be stored in memory, with the caveat that we must choose an "appropriate data structure" -- that is, we cannot simply store all the places in an array and compare distances one-by-one in a linear fashion. The teacher suggested grouping the place data by US State to prevent calculating the distance for places that are obviously too far away. I think I can do better.

From my research online it seems like an R-Tree or one of its variants might be a neat solution. Unfortunately, that sentence is as far as I've gotten with understanding the actual technique, as the literature is simply too dense for my non-academic head.

  • Can somebody give me a really high overview of what the process is for populating an R-Tree with lat/long data, and then traversing the tree to find those 5 nearest neighbors of a given point?

  • Additionally the project is in C, and I don't have to reinvent the wheel on this, so if you've used an existing open source C implementation of an R Tree I'd be interested in your experiences.

© Stack Overflow or respective owner

Related posts about homework

Related posts about c