Definition 4.6 (pq-Gram Distance) For p > 0 and q > 0, the pq-gram distance, ∆p,q(T1, T2), between two trees T1 and T2 is defined as follows:
Definition 4.6 (pq-Gram Distance) For p > 0 and q > 0, the pq-gram distance, ∆p,q(T1, T2), between two trees T1 and T2 is defined as follows:
∆p,q(T1, T2) = 1 − 2 |Pp,q(T1) ∩ Pp,q(T2)| |Pp,q(T1) ∪ Pp,q(T2)|
Definition 4.1 (pq-Extended Tree) Let T be a tree, and p > 0 and q > 0 be two integers.
Definition 4.1 (pq-Extended Tree) Let T be a tree, and p > 0 and q > 0 be two integers. The pqextended tree, Tpq, is constructed from T by adding p−1 ancestors to the root node, inserting q−1 children before the first and after the last child of each non-leaf node, and adding q children to each leaf of T. All newly inserted nodes are null nodes that do not occur in T.
the tree to extend
insert p-1 ancestors to the root node
add q children to each leaf node in t
the extended tree
Definition 4.4 (Label-tuple) Let G be a pq-gram with the nodes V (G) = {v1, ...
Definition 4.4 (Label-tuple) Let G be a pq-gram with the nodes V (G) = {v1, ... , vp, vp+1, ... , vp+q}, where vi is the i-th node in preorder. The tuple l(G) = (l(v1), ... , l(vp), l(vp+1), ... , l(vp+q)) is called the label-tuple of G.
Definition 4.3 (pq-Gram) For p > 0 and q > 0, a pq-gram of a tree T is defined as a subtree of the extended tree Tpq that is isomorphic to the pq-gram pattern.
Definition 4.3 (pq-Gram) For p > 0 and q > 0, a pq-gram of a tree T is defined as a subtree of the extended tree Tpq that is isomorphic to the pq-gram pattern.
the PQGram to retrieve all subtrees of
all subtrees of the PQGram