6

I'm searching for a mature java M-Tree implementation -- Or even ANY M-Tree implementation (besides the only implementation I have found)

http://en.wikipedia.org/wiki/M-tree

For those who haven't heard of an M-tree (like me 2 days ago), an M-Tree is a search tree that can retrieve "n-nearest entries" or "all entries within Distance d" when the keys it uses can be placed in a "metric space" (the M stands for Metric).

I found one online at: https://github.com/erdavila/M-Tree

This implementation is workable if necessary but it is not Serializable, does not provide a "contains()" method, and it is currently throwing an assertion error (which I've figured out how to fix).

If a slightly more polished implementation exists I'd like to know because this data-structure seems super useful and I'd like to find a canonical implementation.

--- Added more info (in an effort to keep this question from getting closed) ---

My end goal is a Map in which the "public Value get(Key)" method returns the "closest" Value even when there isn't a precise Key match. Because I'm using Keys that are defined over a Metric Space I'm looking at for at a MTree to handle the "closest" part of this problem.

The implementation above isn't going to work because (1) it fails when the same Key is put in twice, (2) it won't allow me to remove a Key, and (3) it won't allow me to test if a Key was already inserted.

Ivan
  • 1,256
  • 1
  • 9
  • 16
  • 1
    Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – Jim Garrison Dec 08 '13 at 18:07
  • 3
    I respect, and share, the "spam" concern. However, as I'm not aware of any other implementation (besides the one I mentioned) I don't know how anyone could have an "opinionated answer" about why one implementation might be better than another. – Ivan Dec 08 '13 at 18:26
  • All recommendation questions are off topic. This is not because they are necessarily bad questions or not useful, it's just because that's the direction [so] decided to go (possibly because many / most of them tend to attract opinionated answers and spam). It's (probably) like why general hardware and software questions are off topic (well, ignoring that there's a [su] site for that). – Bernhard Barker Dec 08 '13 at 19:56
  • 1
    @Dukeling -- I understand. Keep in mind this policy invites people to rephrase question like this to "state canonical use-case for XYZ data structure" and hope the expected answer "you should use XYZ data structure" comes with the comment "which is implemented nicely here" (which you could argue is needlessly indirect) – Ivan Dec 08 '13 at 20:02
  • 2
    @Ivan: It's a Rule, though, and people with lots of reputation on stackoverflow like Rules. Phrase your question more awkwardly and you can probably get it reopened. – tmyklebu Dec 08 '13 at 20:25
  • 2
    This "rule" is idiotic, as are the jobsworths that enforce it. Searching for a good implementation of a particular algorithm is an incredibly common thing for a software developer to do. There are already perfectly adequate mechanisms for addressing spammy answers. Closing a question just because it /might/ attract bad answers is like drowning a baby because you're worried it may get sick. – sanity May 08 '17 at 00:25

0 Answers0