🤖 AI Summary
This work studies dynamic approximation algorithms for the Dyck edit distance and tree edit distance—measures quantifying the cost of repairing unbalanced parentheses and transforming ordered trees, respectively, with applications in LaTeX, JSON/XML parsing, and RNA structure evolution. We introduce a novel “structural reduction + dynamic maintenance” paradigm: both problems are reduced to dynamically maintainable string edit distance instances. We design the first history-independent dynamic heavy-light decomposition, breaking the constant-degree restriction. Our static approximation ratio improves to Õ(√n), and we achieve an O(k log n)-approximate decomposition. Consequently, we obtain an n<sup>o(1)</sup>-approximation for Dyck edit distance with n<sup>o(1)</sup> update time; for tree edit distance, we attain an n<sup>1/2+o(1)</sup> approximation ratio, polylogarithmic update time, and near-linear static runtime—surpassing all prior state-of-the-art results.
📝 Abstract
We present the first dynamic algorithms for Dyck and tree edit distances with subpolynomial update times. Dyck edit distance measures how far a parenthesis string is from a well-parenthesized expression, while tree edit distance quantifies the minimum number of node insertions, deletions, and substitutions required to transform one rooted, ordered, labeled tree into another. Despite extensive study, no prior work has addressed efficient dynamic algorithms for these problems, which naturally arise in evolving structured data such as LaTeX documents, JSON or XML files, and RNA secondary structures.
Our main contribution is a set of reductions and decompositions that transform Dyck and tree edit distance instances into efficiently maintainable string edit distance instances, which can be approximated within a $n^{o(1)}$ factor in $n^{o(1)}$ update time. For Dyck edit distance, our reduction incurs only polylogarithmic overheads in approximation and update time, yielding an $n^{o(1)}$-approximation with $n^{o(1)}$ updates. For tree edit distance, we introduce a new static reduction that improves the best-known approximation ratio from $n^{3/4}$ to $ ilde{O}(sqrt{n})$ and removes the restriction to constant-degree trees. Extending this reduction dynamically achieves $n^{1/2+o(1)}$ approximation with $n^{o(1)}$ update time.
A key component is a dynamic maintenance algorithm for history-independent heavy-light decompositions, of independent interest. We also provide a novel static and dynamic decomposition achieving an $O(k log n)$-approximation when the tree edit distance is at most $k$. Combined with the trivial bound $k le n$, this yields a dynamic deterministic $O(sqrt{n log n})$-approximation. In the static setting, our algorithm runs in near-linear time; dynamically, it requires only polylogarithmic updates, improving on prior linear-time static $O(sqrt{n})$-approximation.