A faster algorithm for efficient longest common substring calculation for non-parametric entropy estimation in sequential data
Bridget Smart, Max Ward, Matthew Roughan
TL;DR
The paper addresses the computational bottleneck in non-parametric entropy estimation for sequential data, where the longest common substring (LCS) length is required for pattern-based entropy estimates. It introduces LCSFinder, an algorithm that achieves sub-quadratic performance by leveraging a sorted suffix array combined with a persistent binary search tree to answer relaxed and strict LCS queries on dynamically growing sequences, yielding a worst-case complexity of $O(N \log^2 N)$ for equal-length inputs. The authors provide theoretical analysis and extensive empirical validation on synthetic and real-world datasets, including a large social media corpus, demonstrating dramatic speedups over brute-force approaches while maintaining accuracy. They also release a standalone package and integrate the method into ProcessEntropy, broadening the practical applicability of non-parametric entropy estimation for large-scale, real-time signal processing and information-flow studies.
Abstract
Non-parametric entropy estimation on sequential data is a fundamental tool in signal processing, capturing information flow within or between processes to measure predictability, redundancy, or similarity. Methods based on longest common substrings (LCS) provide a non-parametric estimate of typical set size but are often inefficient, limiting use on real-world data. We introduce LCSFinder, a new algorithm that improves the worst-case performance of LCS calculations from cubic to log-linear time. Although built on standard algorithmic constructs - including sorted suffix arrays and persistent binary search trees - the details require care to provide the matches required for entropy estimation on dynamically growing sequences. We demonstrate that LCSFinder achieves dramatic speedups over existing implementations on real and simulated data, enabling entropy estimation at scales previously infeasible in practical signal processing.
