# Efficiently computing runs on a trie

**Authors:** Ryo Sugahara, Yuto Nakashima, Shunsuke Inenaga, Hideo Bannai, Masayuki, Takeda

arXiv: 1901.10633 · 2021-04-21

## TL;DR

This paper introduces an efficient method to compute and bound the number of runs in tries, a type of rooted edge-labeled tree, with a new algorithm achieving near-linear time complexity.

## Contribution

The paper establishes an upper bound on the number of runs in tries and presents an $O(n \log \log n)$ time algorithm for their enumeration.

## Key findings

- Number of runs in a trie is less than the number of edges.
- Asymptotic lower bound on maximum run density in tries is approximately 0.993238.
- Proposed algorithm runs in $O(n \log \log n)$ time and uses $O(n)$ space.

## Abstract

A maximal repetition, or run, in a string, is a maximal periodic substring whose smallest period is at most half the length of the substring. In this paper, we consider runs that correspond to a path on a trie, or in other words, on a rooted edge-labeled tree where the endpoints of the path must be a descendant/ancestor of the other. For a trie with $n$ edges, we show that the number of runs is less than $n$. We also show an asymptotic lower bound on the maximum density of runs in tries: $\lim_{n\rightarrow\infty}\rho_\mathcal{T}(n)/n \geq 0.993238$ where $\rho_{\mathcal{T}}(n)$ is the maximum number of runs in a trie with $n$ edges. Furthermore, we also show an $O(n\log \log n)$ time and $O(n)$ space algorithm for finding all runs.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1901.10633/full.md

## Figures

1 figure with captions in the complete paper: https://tomesphere.com/paper/1901.10633/full.md

## References

22 references — full list in the complete paper: https://tomesphere.com/paper/1901.10633/full.md

---
Source: https://tomesphere.com/paper/1901.10633