English

Computing the LCP Array of a Labeled Graph

Data Structures and Algorithms 2024-04-23 v1

Abstract

The LCP array is an important tool in stringology, allowing to speed up pattern matching algorithms and enabling compact representations of the suffix tree. Recently, Conte et al. [DCC 2023] and Cotumaccio et al. [SPIRE 2023] extended the definition of this array to Wheeler DFAs and, ultimately, to arbitrary labeled graphs, proving that it can be used to efficiently solve matching statistics queries on the graph's paths. In this paper, we provide the first efficient algorithm building the LCP array of a directed labeled graph with nn nodes and mm edges labeled over an alphabet of size σ\sigma. After arguing that the natural generalization of a compact-space LCP-construction algorithm by Beller et al. [J. Discrete Algorithms 2013] runs in time Ω(nσ)\Omega(n\sigma), we present a new algorithm based on dynamic range stabbing building the LCP array in O(nlogσ)O(n\log \sigma) time and O(nlogσ)O(n\log\sigma) bits of working space.

Keywords

Cite

@article{arxiv.2404.14235,
  title  = {Computing the LCP Array of a Labeled Graph},
  author = {Jarno Alanko and Davide Cenzato and Nicola Cotumaccio and Sung-Hwan Kim and Giovanni Manzini and Nicola Prezza},
  journal= {arXiv preprint arXiv:2404.14235},
  year   = {2024}
}
R2 v1 2026-06-28T16:02:21.968Z