请输入您要查询的百科知识:

 

词条 M-tree
释义

  1. Overview

  2. M-Tree construction

      Components    Insert    Split  

  3. M-Tree Queries

      Range Query    k-NN queries  

  4. See also

  5. References

{{Context|date=June 2010}}

M-trees are tree data structures that are similar to R-trees and B-trees. It is constructed using a metric and relies on the triangle inequality for efficient range and k-nearest neighbor (k-NN) queries.

While M-trees can perform well in many conditions, the tree can also have large overlap and there is no clear strategy on how to best avoid overlap. In addition, it can only be used for distance functions that satisfy the triangle inequality, while many advanced dissimilarity functions used in information retrieval do not satisfy this.[1]

Overview

As in any Tree-based data structure, the M-Tree is composed of Nodes and Leaves. In each node there is a data object that identifies it uniquely and a pointer to a sub-tree where its children reside. Every leaf has several data objects. For each node there is a radius that defines a Ball in the desired metric space. Thus, every node and leaf residing in a particular node is at most distance from , and every node and leaf with node parent keep the distance from it.

M-Tree construction

Components

An M-Tree has these components and sub-components:

  1. Non-leaf nodes
    1. A set of routing objects NRO.
    2. Pointer to Node's parent object Op.
  2. Leaf nodes
    1. A set of objects NO.
    2. Pointer to Node's parent object Op.
  3. Routing Object
    1. (Feature value of) routing object Or.
    2. Covering radius r(Or).
    3. Pointer to covering tree T(Or).
    4. Distance of Or from its parent object d(Or,P(Or))
  4. Object
    1. (Feature value of the) object Oj.
    2. Object identifier oid(Oj).
    3. Distance of Oj from its parent object d(Oj,P(Oj))

Insert

The main idea is first to find a leaf node {{mvar|N}} where the new object {{mvar|O}} belongs. If {{mvar|N}} is not full then just attach it to {{mvar|N}}. If {{mvar|N}} is full then invoke a method to split {{mvar|N}}. The algorithm is as follows:

{{algorithm-begin|name=Insert}}
   Input: Node {{mvar|N}} of M-Tree {{mvar|MT}}, {{nowrap|Entry }}   Output: A new instance of {{mvar|MT}} containing all entries in original {{nowrap|{{mvar|MT}} plus }}
   {{nowrap|}}'s routing objects or objects   '''if''' {{mvar|N}} is not a leaf '''then'''   {        /* Look for entries that the new object fits into */        {{nowrap|let  be routing objects from 's set of routing objects }} {{nowrap|such that }}        {{nowrap|'''if'''  is not empty '''then'''}}        {           /* If there are one or more entry, then look for an entry such that is closer to the new object */           {{nowrap|}}        }        '''else'''        {           /* If there are no such entry, then look for an object with minimal distance from */            /* its covering radius's edge to the new object */           {{nowrap|}}           /* Upgrade the new radii of the entry */           {{nowrap|}}        }        /* Continue inserting in the next level */        {{nowrap|'''return''' insert();}}   '''else'''   {        /* If the node has capacity then just insert the new object */        '''if''' {{mvar|N}} is not full '''then'''        { {{nowrap|store()}} }        /* The node is at full capacity, then it is needed to do a new split in this level */        '''else'''        { {{nowrap|split()}} }   }
{{algorithm-end}}

Split

If the split method arrives to the root of the tree, then it choose two routing objects from {{mvar|N}}, and creates two new nodes containing all the objects in original {{mvar|N}}, and store them into the new root. If split methods arrives to a node {{mvar|N}} that is not the root of the tree, the method choose two new routing objects from {{mvar|N}}, re-arrange every routing object in {{mvar|N}} in two new nodes and , and store these new nodes in the parent node of original {{mvar|N}}. The split must be repeated if has not enough capacity to store . The algorithm is as follow:

{{algorithm-begin|name=Split}}
   Input: Node {{mvar|N}} of M-Tree {{mvar|MT}}, {{nowrap|Entry }}   Output: A new instance of {{mvar|MT}} containing a new partition.
   /* The new routing objects are now all those in the node plus the new routing object */   let be {{mvar|NN}} entries of {{nowrap|}}   '''if''' {{mvar|N}} is not the root '''then'''   {      /*Get the parent node and the parent routing object*/      {{nowrap|let  be the parent routing object of {{mvar|N}}}}      {{nowrap|let  be the parent node of {{mvar|N}}}}   }   /* This node will contain part of the objects of the node to be split */   Create a new node {{mvar|N'}}   /* Promote two routing objects from the node to be split, to be new routing objects */   Create new objects {{nowrap| and .}}   Promote({{nowrap|}})   /* Choose which objects from the node being split will act as new routing objects */   Partition({{nowrap|}})   /* Store entries in each new routing object */   {{nowrap|Store 's entries in {{mvar|N}} and 's entries in {{mvar|N'}}}}   '''if''' {{mvar|N}} is the current root '''then'''   {       /* Create a new node and set it as new root and store the new routing objects */       {{nowrap|Create a new root node }}       {{nowrap|Store  and  in }}   }   '''else'''   {       /* Now use the parent routing object to store one of the new objects */       {{nowrap|Replace entry  with entry  in }}       {{nowrap|'''if'''  is no full '''then'''}}       {           /* The second routing object is stored in the parent only if it has free capacity */           {{nowrap|Store  in }}       }       '''else'''       {            /*If there is no free capacity then split the level up*/            {{nowrap|split()}}       }   }
{{algorithm-end}}

M-Tree Queries

Range Query

A range query is where a minimum similarity/maximum distance value is specified.

For a given query object {{tmath|Q \\in D}} and a maximum search distance

{{tmath|r(Q)}}, the range query range(Q, r(Q)) selects all the indexed objects {{tmath|O_j}} such that {{tmath|d(O_j, Q) \\le r(Q)}}.[2]

Algorithm RangeSearch starts from the root node and recursively traverses all the paths which cannot be excluded from leading to qualifying objects.

{{algorithm-begin|name=RangeSearch}}
 {    {{nowrap|'''let'''  '''be''' the parent object of node {{mvar|N}};}}    '''if''' {{mvar|N}} '''is not''' a leaf '''then''' {      {{nowrap|'''for each''' entry() '''in''' {{mvar|N}}}} '''do''' {           {{nowrap|'''if''' }} '''then''' {              {{nowrap|Compute ;}}             {{nowrap|'''if''' }} '''then'''               {{nowrap|RangeSearch(*ptr()),{{mvar|Q}},);}}            }     }   }   '''else''' {      {{nowrap|'''for each''' entry() '''in''' {{mvar|N}}}} '''do''' {           {{nowrap|'''if''' }} '''then''' {              {{nowrap|Compute ;}}             {{nowrap|'''if''' }} '''then'''               {{nowrap|add  to the result;}}           }     }   } }
{{algorithm-end}}
  • is the identifier of the object which resides on a separate data file.
  • is a sub-tree – the covering tree of

k-NN queries

K Nearest Neighbor (k-NN) query takes the cardinality of the input set as an input parameter. For a given query object Q ∈ D and an

integer k ≥ 1, the k-NN query NN(Q, k) selects the k indexed objects which have the shortest distance from Q, according to the distance function d.

[2]

See also

  • Segment tree
  • Interval tree - A degenerate R-Tree for 1 dimension (usually time).
  • Bounding volume hierarchy
  • Spatial index
  • GiST

References

1. ^{{cite conference | first = Paolo | last = Ciaccia |author2=Patella, Marco |author3=Zezula, Pavel | title = M-tree An Efficient Access Method for Similarity Search in Metric Spaces | booktitle = Proceedings of the 23rd VLDB Conference Athens, Greece, 1997 | pages = 426–435 | publisher = Very Large Databases Endowment Inc. | year = 1997 | location = IBM Almaden Research Center | url = http://www.vldb.org/conf/1997/P426.PDF | accessdate = 2010-09-07 | id = p426}}
2. ^{{cite web|title=Indexing Metric Spaces with M-tree|url=http://www-db.deis.unibo.it/research/papers/SEBD97.pdf|work=Department of Computer Science and Engineering|publisher=University of Bologna|accessdate=19 November 2013|author1=P. Ciaccia |author2=M. Patella |author3=F. Rabitti |author4=P. Zezula |page=3}}
{{CS-Trees}}{{DEFAULTSORT:M-Tree}}

3 : Trees (data structures)|Database index techniques|Geometric data structures

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/11 14:00:59