Cartesian tree matching is a form of generalized pattern matching where a substring of the text matches with the pattern if they share the same Cartesian tree. This form of matching finds application for time series of stock prices and can be of interest for melody matching between musical scores. For the indexing problem, the state-of-the-art data structure is a Burrows-Wheeler transform based solution due to [Kim and Cho, CPM'21], which uses nearly succinct space and can count the number of substrings that Cartesian tree match with a pattern in time linear in the pattern length. The authors address the construction of their data structure with a straight-forward solution that, however, requires pointer-based data structures, resulting in O(n lg n) bits of space, where n is the text length [Kim and Cho, CPM'21, Section A.4]. We address this bottleneck by a construction that requires O(n lg σ) bits of space and has a time complexity of O(n (lg σ lg n)/(lg lg n)), where σ is alphabet size. Additionally, we can extend this index for indexing multiple circular texts in the spirit of the extended Burrows-Wheeler transform without sacrificing the time and space complexities. We present this index in a dynamic variant, where we pay a logarithmic slowdown and need space linear in the input texts in bits for the extra functionality that we can incrementally add texts. Our extended setting is of interest for finding repetitive motifs common in the aforementioned applications, independent of offsets and scaling.
@InProceedings{osterkamp_et_al:LIPIcs.CPM.2025.26, author = {Osterkamp, Eric M. and K\"{o}ppl, Dominik}, title = {{Extending the Burrows-Wheeler Transform for Cartesian Tree Matching and Constructing It}}, booktitle = {36th Annual Symposium on Combinatorial Pattern Matching (CPM 2025)}, pages = {26:1--26:17}, series = {Leibniz International Proceedings in Informatics (LIPIcs)}, ISBN = {978-3-95977-369-0}, ISSN = {1868-8969}, year = {2025}, volume = {331}, editor = {Bonizzoni, Paola and M\"{a}kinen, Veli}, publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik}, address = {Dagstuhl, Germany}, URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.CPM.2025.26}, URN = {urn:nbn:de:0030-drops-231201}, doi = {10.4230/LIPIcs.CPM.2025.26}, annote = {Keywords: Cartesian tree matching, extended Burrows-Wheeler transform, construction algorithm, generalized pattern matching} }
Feedback for Dagstuhl Publishing