Faster Weighted and Unweighted Tree Edit Distance and APSP Equivalence

Type: Preprint

Publication Date: 2024-11-10

Citations: 0

DOI: https://doi.org/10.48550/arxiv.2411.06502

View Chat PDF

Abstract

The tree edit distance (TED) between two rooted ordered trees with $n$ nodes labeled from an alphabet $\Sigma$ is the minimum cost of transforming one tree into the other by a sequence of valid operations consisting of insertions, deletions and relabeling of nodes. The tree edit distance is a well-known generalization of string edit distance and has been studied since the 1970s. Years of steady improvements have led to an $O(n^3)$ algorithm [DMRW 2010]. Fine-grained complexity casts light onto the hardness of TED showing that a truly subcubic time algorithm for TED implies a truly subcubic time algorithm for All-Pairs Shortest Paths (APSP) [BGMW 2020]. Therefore, under the popular APSP hypothesis, a truly subcubic time algorithm for TED cannot exist. However, unlike many problems in fine-grained complexity for which conditional hardness based on APSP also comes with equivalence to APSP, whether TED can be reduced to APSP has remained unknown. In this paper, we resolve this. Not only we show that TED is fine-grained equivalent to APSP, our reduction is tight enough, so that combined with the fastest APSP algorithm to-date [Williams 2018] it gives the first ever subcubic time algorithm for TED running in $n^3/2^{\Omega(\sqrt{\log{n}})}$ time. We also consider the unweighted tree edit distance problem in which the cost of each edit is one. For unweighted TED, a truly subcubic algorithm is known due to Mao [Mao 2022], later improved slightly by D\"{u}rr [D\"{u}rr 2023] to run in $O(n^{2.9148})$. Their algorithm uses bounded monotone min-plus product as a crucial subroutine, and the best running time for this product is $\tilde{O}(n^{\frac{3+\omega}{2}})\leq O(n^{2.6857})$ (where $\omega$ is the exponent of fast matrix multiplication). In this work, we close this gap and give an algorithm for unweighted TED that runs in $\tilde{O}(n^{\frac{3+\omega}{2}})$ time.

Locations

  • arXiv (Cornell University) - View - PDF

Similar Works

Action Title Year Authors
+ Faster Algorithms for Bounded Tree Edit Distance. 2021 Shyan Akmal
Ce Jin
+ Faster Algorithms for Bounded Tree Edit Distance 2021 Shyan Akmal
Ce Jin
+ PDF Chat Breaking the Cubic Barrier for (Unweighted) Tree Edit Distance 2023 Xiao Wen Mao
+ Breaking the Cubic Barrier for (Unweighted) Tree Edit Distance 2021 Xiao Mao
+ PDF Chat Breaking the Cubic Barrier for (Unweighted) Tree Edit Distance 2022 Xiao Wen Mao
+ Optimal Algorithms for Bounded Weighted Edit Distance 2023 Alejandro Cassis
Tomasz Kociumaka
Philip Wellnitz
+ Weighted Edit Distance Computation: Strings, Trees and Dyck 2023 Debarati Das
Jacob Gilbert
MohammadTaghi Hajiaghayi
Tomasz Kociumaka
Barna Saha
+ Subcubic algorithm for (Unweighted) Unrooted Tree Edit Distance 2023 Krzysztof Pióro
+ PDF Chat Tree Edit Distance Cannot be Computed in Strongly Subcubic Time (Unless APSP Can) 2020 Karl Bringmann
Paweł Gawrychowski
Shay Mozes
Oren Weimann
+ Faster Approximate All Pairs Shortest Paths 2023 Barna Saha
Christopher Ye
+ PDF Chat Optimal Algorithms for Bounded Weighted Edit Distance 2023 Alejandro Cassis
Tomasz Kociumaka
Philip Wellnitz
+ PDF Chat Faster Approximate All Pairs Shortest Paths 2024 Barna Saha
Christopher Ye
+ Weighted Edit Distance Computation: Strings, Trees, and Dyck 2023 Debarati Das
Jacob Gilbert
MohammadTaghi Hajiaghayi
Tomasz Kociumaka
Barna Saha
+ Tree Edit Distance Cannot be Computed in Strongly Subcubic Time (unless APSP can) 2017 Karl Bringmann
Paweł Gawrychowski
Shay Mozes
Oren Weimann
+ An Almost Optimal Edit Distance Oracle 2021 Panagiotis Charalampopoulos
Paweł Gawrychowski
Shay Mozes
Oren Weimann
+ Edit Distance between Unrooted Trees in Cubic Time 2018 Bartłomiej Dudek
Paweł Gawrychowski
+ Edit Distance between Unrooted Trees in Cubic Time 2018 Bartłomiej Dudek
Paweł Gawrychowski
+ PDF Chat Tree Edit Distance Cannot be Computed in Strongly Subcubic Time (unless APSP can) 2018 Karl Bringmann
Paweł Gawrychowski
Shay Mozes
Oren Weimann
+ PDF Chat Fine-Grained Optimality of Partially Dynamic Shortest Paths and More 2024 Barna Saha
Virginia Vassilevska Williams
Yinzhan Xu
Christopher Ye
+ Size-constrained Weighted Ancestors with Applications 2023 Philip Bille
Yakov Nekrich
Solon P. Pissis

Cited by (0)

Action Title Year Authors

Citing (0)

Action Title Year Authors