Abstract: Let s = s1..sn be a text (or sequence) on a finite alphabet Σ of size σ. A fingerprint in s is the set of distinct characters appearing in one of its substrings. The problem considered here is to compute the set F of all fingerprints of all substrings of s in order to answer efficiently certain questions on this set. A substring si..sj is a maximal location for a fingerprint f ∈ F (denoted by i, j ) if the alphabet of si..sj is f and si−1, sj+1, if defined, are not in f . The set of maximal locations in s is L (it is easy to see that |L| ≤ nσ). Two maximal locations i, j and k, l such that si..sj = s k ..s l are named copies, and the quotient set of L according to the copy relation is denoted by LC . We first present new exact efficient algorithms and data structures for the following three problems: (1) to compute F; (2) given f as a set of distinct characters in Σ, to answer if f represents a fingerprint in F; (3) given f , to find all maximal locations of f in s. As well as in papers concerning succinct data structures, in the paper all space complexities are counted in bits. Problem 1 is solved either in O(n + |LC | log σ) worst-case time (in this paper all logarithms are intended as base two logarithms) using O((n + |LC | + |F| log σ) log n) bits of space, or in O(n + |L| log σ) randomized expected time using O((n + |F| log σ) log n) bits of space. Problem 2 is solved either in O(|f |) expected time if only O(|f | log n) bits of working space for queries is allowed, or in worst-case O(|f |/ ) time if a working space of O(σ log n) bits is allowed (with a constant satisfying 0 < < 1). These algorithms use a data structure that occupies |F|(2 log σ + log 2 e)(1 + o(1)) bits. Problem 3 is solved with the same time complexity as Problem 2, but with the addition of an occ term to each of the complexities, where occ is the number of maximal locations corresponding to the given fingerprint. Our solution of this last problem requires a data structure that occupies O((n + |LC |) log n) bits of memory. In the second part of our paper we present a novel Monte Carlo approximate construction approach. Problem 1 is thus solved in O(n + |L|) expected time using O(|F| log n) bits of space but the algorithm is incorrect with an extremely small probability that can be bounded in advance.
The term fingerprint has also been used with a different meaning in the domain of string processing, where it refers to the set of distinct characters contained in one of the substrings of a given string, with the ongoing recent work, e.g., a study by Belazzougui et al. REF .
Various improvements to text fingerprinting
ArXiv
ArXiv
Mathematics Computer Science