An Algorithm for Comparing Similarity Between Two Trees
An important problem in geometric computing is defining and computing similarity between two geometric shapes, e.g. point sets, curves and surfaces, etc. Important geometric and topological information of many shapes can be captured by defining a tree structure on them (e.g. medial axis and contour trees). Hence, it is natural to study the problem of comparing similarity between trees. We study gapped edit distance between two ordered labeled trees, first proposed by Touzet \cite{Touzet2003}. Given two binary trees $T_{1}$ and $T_{2}$ with $m$ and $n$ nodes. We compute the general gap edit distance in $O(m^{3}n^{2} + m^{2}n^{3})$ time. The computation of this distance in the case of arbitrary trees has shown to be NP-hard \cite{Touzet2003}. We also give an algorithm for computing the complete subtree gap edit distance, which can be applied to comparing contour trees of terrains in $\mathbb{R}^{3}$.
💡 Research Summary
The paper addresses the problem of measuring similarity between ordered labeled trees by extending the classic tree edit distance with gap operations. While the standard tree edit distance allows only single-node insertions, deletions, or relabelings, the gap edit distance permits the insertion or deletion of a contiguous set of nodes (a “gap”) in a single operation, with a cost that is not necessarily linear in the number of nodes. Two gap models originally proposed by Touzet are considered: the general gap model, where any set of consecutive nodes may form a gap, and the complete‑subtree gap model, where a gap must be an entire subtree.
Touzet proved that computing the general gap edit distance for arbitrary trees is NP‑hard, but left open the possibility of polynomial‑time algorithms for restricted tree families. This work focuses on binary trees and provides the first polynomial‑time algorithms for both gap models.
General Gap Model (binary trees).
The authors formulate a dynamic programming (DP) scheme that tracks, for each pair of nodes (i in T₁, j in T₂), whether i and/or j belong to a currently open gap. This yields a four‑dimensional DP table D
Comments & Academic Discussion
Loading comments...
Leave a Comment