🤖 AI Summary
This work addresses the inefficiency of constructing Compact Directed Acyclic Word Graphs (CDAWGs) for highly repetitive strings by proposing the first output-sensitive construction algorithm. The approach unifies two equivalent characterizations of the CDAWG—namely, the edge-compressed DAWG and the DAG obtained by merging isomorphic subtrees of the suffix tree—and leverages the fully-functional compressed suffix tree of Gagie, Navarro, and Prezza, together with run-length compressed Burrows–Wheeler Transform (BWT) representations and DAG-merging techniques. By parameterizing complexity in terms of the number of BWT runs \( r \) and the number of CDAWG edges \( e_L \), the algorithm constructs the CDAWG in \( O(e_L \log n \log(n/r)) \) time and \( O(r \log(n/r) + e_L) \) space, significantly outperforming conventional methods on highly repetitive inputs.
📝 Abstract
The compact directed acyclic word graph (CDAWG) of a string can be viewed in two equivalent ways: as the edge-compacted DAWG of the string, and as the DAG obtained from the suffix tree by merging the nodes whose subtrees are isomorphic. By exploiting these two views in opposite directions, we show how to build, for the (reversed) input string of length $n$, the CDAWG with $e_L$ edges in $O(e_L\log n\log(n/r))$ time with $O(r\log(n/r)+e_L)$ words of working space, provided that the fully functional compressed suffix tree of Gagie, Navarro, and Prezza of size $O(r\log(n/r))$ is available. Here, $r$ denotes the number of BWT-runs of the input string.