M-tree Implementation

Creating the Tree

Creating a new M-tree is as easy as saying "new"! In fact, in order to create a new index structure, it is sufficient to instantiate the MT class, e.g.:

MT *tree=new MT;

Then, in order to provide persistence to the index, the user has to "link" the MT object to a file on disk, with the MT::Create method if the index has to be created from scratch, or with the MT::Open method if the index is already stored in a file.

Inserting Objects

Objects can be inserted in the tree one by one or using a bulk-loading technique.

Searching the M-tree

The M-tree can be searched using nearest neighbors and range queries, even in a complex environment where query predicates are expressed as conjunctions, disjunctions, and negations of simple predicates. Moreover, a sorted access to the tree is also provided, where indexed objects are returned one by one sorted by increasing distance to the query predicate.

Performance Evaluation

The library includes three integer values, compdists, IOread, and IOwrite, to keep track of CPU and I/O costs for performance evaluation. More precisely, every time a distance is computed (i.e. the method Object::distance is called), the value of compdists is increased by 1; every time a node is read from disk (through the method MTfile::Read), the value of IOread is increased by 1; every time a node is written on disk (through the method MTfile::Write), the value of IOwrite is increased by 1.