Edit Distance between Unrooted Trees in Cubic Time

04/26/2018
by   Bartłomiej Dudek, et al.
0

Edit distance between trees is a natural generalization of the classical edit distance between strings, in which the allowed elementary operations are contraction, uncontraction and relabeling of an edge. Demaine et al. [ACM Trans. on Algorithms, 6(1), 2009] showed how to compute the edit distance between rooted trees on n nodes in O(n^3) time. However, generalizing their method to unrooted trees seems quite problematic, and the most efficient known solution remains to be the previous O(n^3 n) time algorithm by Klein [ESA 1998]. Given the lack of progress on improving this complexity, it might appear that unrooted trees are simply more difficult than rooted trees. We show that this is, in fact, not the case, and edit distance between unrooted trees on n nodes can be computed in O(n^3) time. A significantly faster solution is unlikely to exist, as Bringmann et al. [SODA 2018] proved that the complexity of computing the edit distance between rooted trees cannot be decreased to O(n^3-ϵ) unless some popular conjecture fails, and the lower bound easily extends to unrooted trees. We also show that for two unrooted trees of size m and n, where m< n, our algorithm can be modified to run in O(nm^2(1+n/m)). This, again, matches the complexity achieved by Demaine et al. for rooted trees, who also showed that this is optimal if we restrict ourselves to the so-called decomposition algorithms.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/17/2023

Subcubic algorithm for (Unweighted) Unrooted Tree Edit Distance

The tree edit distance problem is a natural generalization of the classi...
research
09/15/2022

Õ(n+poly(k))-time Algorithm for Bounded Tree Edit Distance

Computing the edit distance of two strings is one of the most basic prob...
research
06/03/2021

Breaking the Cubic Barrier for (Unweighted) Tree Edit Distance

The (unweighted) tree edit distance problem for n node trees asks to com...
research
02/05/2021

Reconstructing Arbitrary Trees from Traces in the Tree Edit Distance Model

In this paper, we consider the problem of reconstructing trees from trac...
research
07/16/2020

String Sanitization Under Edit Distance: Improved and Generalized

Let W be a string of length n over an alphabet Σ, k be a positive intege...
research
05/17/2023

Revisiting the Complexity of and Algorithms for the Graph Traversal Edit Distance and Its Variants

The graph traversal edit distance (GTED) is an elegant distance measure ...
research
05/06/2021

Faster Algorithms for Bounded Tree Edit Distance

Tree edit distance is a well-studied measure of dissimilarity between ro...

Please sign up or login with your details

Forgot password? Click here to reset