Next Article in Journal
Correction: Sato, M., et al. Total Optimization of Energy Networks in a Smart City by Multi-Population Global-Best Modified Brain Storm Optimization with Migration, Algorithms 2019, 12, 15
Previous Article in Journal
On the Role of Clustering and Visualization Techniques in Gene Microarray Data
Previous Article in Special Issue
Applications of Non-Uniquely Decodable Codes to Privacy-Preserving High-Entropy Data Representation
Open AccessArticle

Lyndon Factorization Algorithms for Small Alphabets and Run-Length Encoded Strings

Faculty of Applied Science & Technology, Sheridan College, 7899 McLaughlin Road, Brampton, ON L6Y 5H9, Canada
F-Secure Corporation, P.O.B. 24, FI-00181 Helsinki, Finland
Department of Computer Science, Aalto University, P.O.B. 15400, FI-00076 Aalto, Finland
Author to whom correspondence should be addressed.
This paper is an extended version of our paper: Ghuman, S.S.; Giaquinta, E.; Tarhio, J. Alternative algorithms for Lyndon factorization. In Proceedings of the Prague Stringology Conference 2014, Prague, Czech Republic, 1–3 September 2014; pp. 169–178.
Algorithms 2019, 12(6), 124;
Received: 24 May 2019 / Accepted: 17 June 2019 / Published: 21 June 2019
(This article belongs to the Special Issue String Matching and Its Applications)
PDF [829 KB, uploaded 2 July 2019]


We present two modifications of Duval’s algorithm for computing the Lyndon factorization of a string. One of the algorithms has been designed for strings containing runs of the smallest character. It works best for small alphabets and it is able to skip a significant number of characters of the string. Moreover, it can be engineered to have linear time complexity in the worst case. When there is a run-length encoded string R of length ρ , the other algorithm computes the Lyndon factorization of R in O ( ρ ) time and in constant space. It is shown by experimental results that the new variations are faster than Duval’s original algorithm in many scenarios. View Full-Text
Keywords: Lyndon factorization; string algorithms; run-length encoding Lyndon factorization; string algorithms; run-length encoding

Figure 1

This is an open access article distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited (CC BY 4.0).

Share & Cite This Article

MDPI and ACS Style

Ghuman, S.S.; Giaquinta, E.; Tarhio, J. Lyndon Factorization Algorithms for Small Alphabets and Run-Length Encoded Strings. Algorithms 2019, 12, 124.

Show more citation formats Show less citations formats

Note that from the first issue of 2016, MDPI journals use article numbers instead of page numbers. See further details here.

Related Articles

Article Metrics

Article Access Statistics



[Return to top]
Algorithms EISSN 1999-4893 Published by MDPI AG, Basel, Switzerland RSS E-Mail Table of Contents Alert
Back to Top