Spheres of Strings Under the Levenshtein Distance

Let Σ be a nonempty set of characters, called an alphabet. The run-length encoding (RLE) algorithm processes any nonempty string u over Σ and produces two outputs: a k-tuple (b1,b2,…,bk), where each bi is a character and bi+1≠bi; and a corresponding k-tuple (q1,q2,…,qk) of positive integers, so that...

Full description

Saved in:
Bibliographic Details
Published inAxioms Vol. 14; no. 8; p. 550
Main Authors Algarni, Said, Echi, Othman
Format Journal Article
LanguageEnglish
Published Basel MDPI AG 22.07.2025
Subjects
Online AccessGet full text
ISSN2075-1680
2075-1680
DOI10.3390/axioms14080550

Cover

More Information
Summary:Let Σ be a nonempty set of characters, called an alphabet. The run-length encoding (RLE) algorithm processes any nonempty string u over Σ and produces two outputs: a k-tuple (b1,b2,…,bk), where each bi is a character and bi+1≠bi; and a corresponding k-tuple (q1,q2,…,qk) of positive integers, so that the original string can be reconstructed as u=b1q1b2q2…bkqk. The integer k is termed the run-length of u, and symbolized by ρ(u). By convention, we let ρ(ε)=0. In the Euclidean space (Rn,∥·∥2), the volume of a sphere is determined solely by the dimension n and the radius, following well-established formulas. However, for spheres of strings under the edit metric, the situation is more complex, and no general formulas have been identified. This work intended to show that the volume of the sphere SL(u,1), composed of all strings of Levenshtein distance 1 from u, is dependent on the specific structure of the “RLE-decomposition” of u. Notably, this volume equals (2l(u)+1)s−2l(u)−ρ(u), where ρ(u) represents the run-length of u and l(u) denotes its length (i.e., the number of characters in u). Given an integer p≥2, we present a partial result concerning the computation of the volume |SL(u,p)| in the specific case where the run-length ρ(u)=1. More precisely, for a fixed integer n≥1 and a character a∈Σ, we explicitly compute the volume of the Levenshtein sphere of radius p, centered at the string u=an. This case corresponds to the simplest run structure and serves as a foundational step toward understanding the general behavior of Levenshtein spheres.
Bibliography:ObjectType-Article-1
SourceType-Scholarly Journals-1
ObjectType-Feature-2
content type line 14
ISSN:2075-1680
2075-1680
DOI:10.3390/axioms14080550