Hardness of Dynamic Tree Edit Distance and Friends

Bingbing Hu, Jakob Nogler, Barna SahaarXiv 2025 · DOI

Abstract

This paper investigates the dynamic complexity of fundamental structural problems, including Tree Edit Distance (TED), Dyck Edit Distance, and RNA Folding. Utilizing fine-grained complexity frameworks, the authors demonstrate that these problems exhibit a "no dynamic advantage" phenomenon. Specifically, under standard conjectures like the $k$-Clique and APSP conjectures, any dynamic algorithm for these problems is essentially no more efficient than recomputing the static solution from scratch after each update. These results provide the first formal separation between the dynamic complexities of String Edit Distance and Tree Edit Distance.

Introduction: The Search for Dynamic Efficiency

In computational biology and natural language processing, we often deal with structures that evolve over time. Dynamic algorithms are designed to maintain solutions as inputs undergo small modifications, such as inserting or deleting a node. While String Edit Distance (Levenshtein distance) benefits from significant dynamic speedups, the complexity of more hierarchical structures like trees has remained less understood.

The authors focus on the Weighted Tree Edit Distance (TED) problem, alongside Dyck Edit Distance and RNA Folding. The central question is whether these problems allow for incremental updates that are faster than the $O(n^3)$ or $O(n^{2.7})$ static algorithms.

Formal definition of the Weighted Tree Edit Distance problem and its three fundamental edit operations.

Methodology: Fine-Grained Complexity Reductions

Since absolute lower bounds are difficult to prove, the authors employ fine-grained complexity to establish "conditional" lower bounds. They show that a fast dynamic algorithm for TED would imply breakthroughs in solving long-standing hard problems like Min-Weight $k$-Clique and $k$-Clique Detection.

The core of their proof involves:

  1. Clique Gadgets: Constructing intricate tree and string embeddings that encode graph neighborhoods. The edit distance between these gadgets effectively "computes" whether specific node groups form a clique.
  2. Dynamic-to-Static Mapping: Proving that a sequence of $N$ dynamic updates can be leveraged to solve a single large static instance of a clique problem. This implies that the per-update time cannot be significantly better than the static recomputation time.

Key Results and the "No Dynamic Speedup" Phenomenon

The most significant finding is that for weighted TED, RNA Folding, and Dyck Edit Distance, there is effectively no "memory" advantage. The best possible dynamic algorithm is to re-run the static algorithm.

  • Weighted TED: The authors establish a lower bound of $O(n^{4-\epsilon})$ total time for $n$ updates, meaning the $O(n^3)$ static algorithm is essentially optimal for each individual update. This hardness is linked to the All-Pairs Shortest Paths (APSP) problem.
  • Unweighted TED: Even without weights, TED remains difficult. The paper proves a per-update lower bound of roughly $O(n^2)$, relating it to the $k$-clique problem.
  • RNA Folding and Dyck Edit Distance: These problems also show no dynamic speedup, requiring $O(n^{4-\epsilon})$ total time for $n$ updates.

Discussion: Separating Strings from Trees

A major contribution of this work is the formal separation between dynamic String Edit Distance and dynamic Tree Edit Distance. While strings allow for sub-linear update times, trees require at least quadratic time per update. This confirms that the hierarchical nature of trees introduces a fundamental computational bottleneck that strings do not possess.

However, these results apply to exact algorithms. Future research may focus on dynamic approximation algorithms, which could potentially bypass these lower bounds for practical applications where a near-optimal solution suffices. Additionally, while the dynamic gap is now clear, the question of whether unweighted TED is strictly harder than String Edit Distance in a static setting remains an open challenge.

Summary updated

BibTeX
@misc{hu2025hardness,
  author = {Bingbing Hu and Jakob Nogler and Barna Saha},
  title = {{Hardness of Dynamic Tree Edit Distance and Friends}},
  year = {2025},
  eprint = {2511.09842},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.09842},
}
Figure