Skip to main content
QUICK REVIEW

[Paper Review] Efficient Parallel Output-Sensitive Edit Distance

Xiangyun Ding, Xiaojun Dong|arXiv (Cornell University)|Jan 1, 2023
Algorithms and Data CompressionComputer Science1 citations
TL;DR

This paper presents the first systematic theoretical and practical study of parallel, output-sensitive edit distance algorithms. It proposes four novel parallel algorithms—three based on BFS (using suffix arrays and two hash-based LCP data structures) and one output-sensitive divide-and-conquer approach—achieving sub-quadratic work when the edit distance $k$ is small. The BFS-Hash and BFS-B-Hash variants achieve up to 48× speedup on 192 hyperthreads and process $10^9$-length strings in ~10 seconds with $k < 10^5$, outperforming ParlayLib by orders of magnitude.

ABSTRACT

Given two strings $A[1..n]$ and $B[1..m]$, and a set of operations allowed to edit the strings, the edit distance between $A$ and $B$ is the minimum number of operations required to transform $A$ into $B$. Sequentially, a standard Dynamic Programming (DP) algorithm solves edit distance with $Θ(nm)$ cost. In many real-world applications, the strings to be compared are similar and have small edit distances. To achieve highly practical implementations, we focus on output-sensitive parallel edit-distance algorithms, i.e., to achieve asymptotically better cost bounds than the standard $Θ(nm)$ algorithm when the edit distance is small. We study four algorithms in the paper, including three algorithms based on Breadth-First Search (BFS) and one algorithm based on Divide-and-Conquer (DaC). Our BFS-based solution is based on the Landau-Vishkin algorithm. We implement three different data structures for the longest common prefix (LCP) queries needed in the algorithm: the classic solution using parallel suffix array, and two hash-based solutions proposed in this paper. Our DaC-based solution is inspired by the output-insensitive solution proposed by Apostolico et al., and we propose a non-trivial adaption to make it output-sensitive. All our algorithms have good theoretical guarantees, and they achieve different tradeoffs between work (total number of operations), span (longest dependence chain in the computation), and space. We test and compare our algorithms on both synthetic data and real-world data. Our BFS-based algorithms outperform the existing parallel edit-distance implementation in ParlayLib in all test cases. By comparing our algorithms, we also provide a better understanding of the choice of algorithms for different input patterns. We believe that our paper is the first systematic study in the theory and practice of parallel edit distance.

Motivation & Objective

  • To close the gap between theoretical parallel algorithms and practical implementations for edit distance.
  • To design work-efficient, scalable, and I/O-friendly parallel algorithms that achieve sub-quadratic work when the edit distance $k$ is small.
  • To evaluate and compare multiple algorithmic approaches (BFS and divide-and-conquer) in both synthetic and real-world workloads.
  • To provide engineering insights into data structures for LCP queries (suffix arrays, hash-based methods) in parallel settings.
  • To demonstrate that work efficiency is critical in parallel algorithm design, especially when core counts are limited.

Proposed method

  • Adapts the Landau-Vishkin BFS-based algorithm for parallel execution using level-by-level traversal of edit distance states.
  • Introduces two novel hash-based data structures (BFS-Hash and BFS-B-Hash) to replace suffix arrays for LCP queries, improving space efficiency and cache-friendliness.
  • Proposes a non-trivial adaptation of Apostolico et al.'s output-insensitive divide-and-conquer algorithm to make it output-sensitive with $\widetilde{O}(nk)$ work and polylogarithmic span.
  • Employs blocking in BFS-B-Hash to reduce space overhead from 8× input size to sub-input size, with minimal time penalty.
  • Uses a parallel prefix table construction for LCP queries, optimized for shared-memory parallelism with high concurrency.
  • Evaluates tradeoffs between work, span, and space across four algorithms using synthetic and real-world datasets (DNA, Wikipedia, GitHub).

Experimental results

Research questions

  • RQ1Can output-sensitive parallel edit distance algorithms achieve sub-quadratic work and high parallelism in practice, beyond theoretical bounds?
  • RQ2How do different LCP data structures (suffix array vs. hash-based) impact performance and space usage in parallel BFS-based edit distance?
  • RQ3Can a divide-and-conquer approach be made output-sensitive with good theoretical guarantees and practical performance?
  • RQ4What is the impact of blocking in hash-based LCP structures on space efficiency and runtime in real-world edit patterns?
  • RQ5How do work efficiency and span tradeoffs affect overall performance when core counts are limited to hundreds or thousands?

Key findings

  • The BFS-Hash and BFS-B-Hash algorithms achieve up to 48× speedup on 192 hyperthreads, processing $10^9$-length strings with $k < 10^5$ in about ten seconds.
  • BFS-Hash outperforms ParlayLib by over 100× in runtime on large inputs, with ParlayLib only handling inputs up to $10^6$ in the same time.
  • BFS-B-Hash reduces auxiliary space to below input size by using blocking, with only a 1.08× to 1.19× time increase from $b=1$ to $b=64$, despite a theoretical $b$-factor in queries.
  • The divide-and-conquer-based DaC-SD algorithm achieves $\widetilde{O}(nk)$ work and polylogarithmic span, but is outperformed by BFS variants due to work inefficiency.
  • For small $k$, BFS-B-Hash is faster than BFS-Hash due to lower preprocessing cost and better cache behavior.
  • The study confirms that work efficiency is paramount in parallel design: even with high parallelism, excessive work cannot be compensated by more cores, especially when core counts are limited.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.