,
Panagiotis Charalampopoulos
,
Jakub Radoszewski
Creative Commons Attribution 4.0 International license
We consider the problem of maintaining the size of the LZ77 factorization of a string S of length at most n under the following operations: (a) appending a given letter to S and (b) deleting the first letter of S. Our main result is an algorithm for this problem with amortized update time Õ(√n). As a corollary, we obtain an Õ(n√n)-time algorithm for computing the most LZ77-compressible rotation of a length-n string - a naive approach for this problem would compute the LZ77 factorization of each possible rotation and would thus take quadratic time in the worst case. We also show an Ω(√n) lower bound for the additive sensitivity of LZ77 with respect to the rotation operation. Our algorithm employs dynamic trees to maintain the longest-previous-factor array information and depends on periodicity-based arguments that bound the number of the required updates and enable their efficient computation.
@InProceedings{bannai_et_al:LIPIcs.CPM.2024.3,
author = {Bannai, Hideo and Charalampopoulos, Panagiotis and Radoszewski, Jakub},
title = {{Maintaining the Size of LZ77 on Semi-Dynamic Strings}},
booktitle = {35th Annual Symposium on Combinatorial Pattern Matching (CPM 2024)},
pages = {3:1--3:20},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-326-3},
ISSN = {1868-8969},
year = {2024},
volume = {296},
editor = {Inenaga, Shunsuke and Puglisi, Simon J.},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.CPM.2024.3},
URN = {urn:nbn:de:0030-drops-201134},
doi = {10.4230/LIPIcs.CPM.2024.3},
annote = {Keywords: Lempel-Ziv, compression, LZ77, semi-dynamic algorithm, cyclic rotation}
}