<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>On String Attractors</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Nicola Prezza</string-name>
          <email>nicola.prezza@di.unipi.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, University of Pisa</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>String attractors are combinatorial objects recently introduced as an universal framework for studying dictionary compressors. In this brief communication we summarize possible future developments and open problems related to the subject.</p>
      </abstract>
      <kwd-group>
        <kwd>String attractors</kwd>
        <kwd>compressed computation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Let S be a string of length n. Informally, a string attractor [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] for S is a set
[1::n] with the following property: any substring of S has at least one
occurrence in S crossing at least one position in . The following de nition
formalizes a generalized version of this concept.
      </p>
      <p>
        De nition 1 (String k-attractor [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]). A k-attractor of a string S 2 n is a
set of positions [1::n] such that every substring S[i::j] with i j &lt; i + k
has at least one occurrence S[i0::j0] = S[i::j] with j00 2 [i0::j0] for some j00 2 .
      </p>
      <p>When k = n, we simply call an attractor of S.</p>
      <p>
        String attractors were originally introduced as a unifying framework for
known dictionary compressors: Straight-Line programs [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] (context-free
grammars generating the string), Collage Systems [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], Macro schemes [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] (a set of
substring equations having the string as unique solution; this includes
LempelZiv 77 [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]), the run-length Burrows-Wheeler transform [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] (a string permutation
whose number of equal-letter runs decreases as the string's repetitiveness
increases), and the compact directed acyclic word graph [
        <xref ref-type="bibr" rid="ref1 ref3">1, 3</xref>
        ] (the minimization
of the su x tree). As shown in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], any of the above compressed representations
induces a string attractor of the same asymptotic size [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. The other way round
also holds for a subset of the above compressors: given a string attractor of
size , one can build a compressed representation of size O( log(n= )). These
reductions imply the following interesting facts:
(1) We can asymptotically relate the output sizes of di erent compressors.
(2) We can design universal compressed data structures (i.e. working on top of
any of the above compressors).
      </p>
      <p>
        With respect to point (2), it can be shown that one can perform optimal-time
random access within O( polylog n) space [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Similarly, fast text indexing can
be achieved within the same space [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>
        Computing a minimum k-attractor is NP-complete for general alphabets and
k 3, and APX-complete for constant k 3 [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. If the alphabet and k are small,
however, the problem admits polynomial-time solutions [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        Veri cation and approximation, on the other hand, are much easier problems:
we can decide whether is a proper k-attractor in optimal O(n) time and
space [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and, with a simple reduction to set-cover, we can compute a O(log k)
approximation of the smallest k -attractor in polynomial time [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>In the following sections we list some interesting open problems and
promising future developments related to these new combinatorial objects. We divide
the exposition in four sections: complexity and approximability problems,
combinatorial problems (enumeration of attractors and relations with the string's
complexity), generalizations (to trees, graphs, grids), and algorithmic problems
(universal compressed data structures and quick algorithms on attractors).
2</p>
    </sec>
    <sec id="sec-2">
      <title>Complexity and Approximability</title>
      <p>The rst open problem that we discuss is the complexity of 2-attractor:
Problem 1. Is the (decisional version of) 2-attractor solvable in polynomial-time?</p>
      <p>
        The reason why Problem 1 is so interesting is that k-attractor is NP-complete
for k 3, and one can easily verify that 1-attractor can be solved in linear
time with a naive algorithm. The only remaining case, k = 2, is still open.
Interestingly, if we restrict our attention to just substrings of length 2 (not 2),
then the corresponding problem | dubbed sharp-2-attractor, can be solved in
polynomial time [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        A related problem is that of improving the dependency on the alphabet size
in the original NP-completeness proof of [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] (which used polynomial alphabets):
      </p>
      <sec id="sec-2-1">
        <title>Problem 2. Is k-attractor still NP-complete for alphabets of size</title>
        <p>= no(1)?</p>
        <p>
          Note that k-attractor can be solved in polynomial time when k log k 2
O(log n) [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], so the NP-completeness proof should somehow put some
lowerbound restriction on (in particular, note that 3-attractor is not NP-complete
in the binary case).
        </p>
        <p>The next problems are concerned with (in-)approximability. To start with,
all polynomial-time approximation algorithms we know of achieve rate O(log k)
(including reductions from dictionary compressors).</p>
        <p>Problem 3. Can we compute a o(log k)-approximation of the smallest k-attractor
in polynomial time?</p>
        <p>
          The n-attractor problem is deeply related to set-cover [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ], for which it is
known that no o(log n)-approximation can be computed in polynomial time. A
natural question is therefore whether this inapproximability result transfers to
the minimum attractor problem. Note that the linear-time algorithm
LempelZiv 77 achieves O(log n) approximation; such an inapproximability result would
therefore imply that LZ77 is optimal among polynomial-time dictionary
compressors. The best inapproximability result we know so far is that k-attractor
cannot be approximated within factor &lt; 11809=11808 in polynomial time, so we
get the additional open problem:
Problem 4. Can we approximate k-attractor within factor 11809=11808 +
polynomial time, for any 0?
in
3
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Combinatorics</title>
      <p>
        String attractors raise (quite naturally) several questions of combinatorial
nature. One of the most intriguing open problems in this case is that of representing
the string in attractor-space. All random access data structures provided in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ],
as well as the reductions to compressed formats, achieve O( log(n= )) space (in
words of (log n) bits). In what follows, let be the size of a smallest attractor
for the string. We are left with the question:
Problem 5. Can we encode a string within o( log(n= ) log n) bits of space? is
this space below the Kolmogorov complexity for some in nite family of strings?
      </p>
      <p>
        A related question, important to understand the power of these objects (as
well as designing smaller data structures), is:
Problem 6. Does there exist an in nite family of strings such that
where b is the size of the smallest bidirectional macro scheme? [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]
= o(b),
      </p>
      <p>
        Macro schemes [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] are the most general and powerful dictionary compressors
known to date. Since fast random access can be supported within O(b log(n=b))
space, a positive answer to the above question would imply smaller random
access data structures (of size o(b log(n=b)) for some strings).
      </p>
      <p>A similar problem is that of the relation between the number r of equal-letter
runs in the Burrows-Wheeler transform and :
Problem 7. Does it hold that r 2 O( polylog n)?</p>
      <p>
        Note that the above relation holds for all other known dictionary
compressors [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] (except CDAWG). A positive answer to Problem 7 would immediately
prove new relations between dictionary compressors (e.g. is r 2 O(z polylog n),
z being the size of the LZ77 parse?).
      </p>
      <p>A natural combinatorial question, related to the previous ones, is:</p>
      <sec id="sec-3-1">
        <title>Problem 8. How many strings in</title>
        <p>n have a smallest attractor of size ?</p>
        <p>Let f ( ; n; ) be the size of this class of strings (i.e. strings of length n, on
alphabet of size , and with smallest attractor of size ). Note that the class with
= 1 is precisely that of unary strings, therefore f (1; n; ) = . Now, a simple
information-theoretic argument shows that any encoding for this class will use,
in the worst case, at least log2(f ( ; n; )) bits. This implies that no string can
be represented within o(log2(f ( ; n; ))) space (see problem 5).</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Generalizations</title>
      <p>It is natural to try generalizing string attractors to more complex objects such
as trees, graphs, and grids. Here we give a tentative formulation for (labeled)
graphs:
De nition 2 (Graph attractor). A graph attractor is a set of edges such
that every connected subgraph has an isomorphic occurrence crossing at least one
of the edges in .</p>
      <p>Note that this formulation coincides with De nition 1 in the case of
undirected labeled path graphs. Note also that the veri cation problem on graphs (is
a \graph attractor"?) now becomes much harder due to the NP-completeness
of subgraph isomorphism. Indeed, it is easy to see that the veri cation problem
itself becomes NP-complete: given an (unlabeled, undirected) graph G = hV; Ei,
then G contains a subgraph isomorphic to a given (disjoint) graph H if and only
if = E is a graph attractor for the graph G [ H. Nevertheless, De nition 2
could be useful to approach the hard problem of graph compression, for which
only few techniques exist:
Problem 9. Can we use De nition 2 to compress a graph G? (say, within space
O(j j polylog jGj)).</p>
      <p>Similarly, a natural generalization of string attractors could be useful to
compress repetitive sets of multi-dimensional points (e.g. two-dimensional grids).
In this case, the generalization is more straightforward:
De nition 3 (Grid attractor). An attractor for a grid on [1::n] [1::n] is a
set of points such that every sub-grid has an occurrence crossing at least one
of the points in .</p>
      <p>It is actually not hard to generalize the random access data structure of [5,
Thm 5.3] to support access on grids within O(j j polylog n) space, where is
a grid attractor as de ned in De nition 3. The same idea can be generalized to
arbitrary dimension d 2. We leave this extension as future work.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Algorithms and Data Structures</title>
      <p>
        To conclude this communication, we consider problems related to algorithms and
data structures on string attractors. A natural research direction is to explore
which queries can be supported on these combinatorial objects. As seen above,
random access [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], as well as text indexing [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], can be supported in O( polylog n)
space. While in the former case the provided upper-bound matches the lower
bound, the problem of optimality remains open for text indexing:
Problem 10. Can we locate patterns in O(m + occ) time within O( polylog n)
space, where m is the pattern length and occ is the number of occurrences?
      </p>
      <p>Similarly, no structures have been proposed yet for queries such as RMQ
(range minimum), rank, and select. An interesting research direction could also
be that of devising dynamic data structures based on string attractors (e.g.
strings with insert, delete, and access operations).</p>
      <p>
        As far as veri cation and optimization are concerned, it is still not known
whether we can check that a given set is a valid string attractor in
optimal O(n= log n + ) time and space (this problem was addressed in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]).
The same holds for exact algorithms for computing a minimum attractor: the
Fixed Parameter Tractable algorithm described in [4, Thm 24] runs in O(n) +
exp(O( k log k)) time. Is it possible to reduce the dependency on k and ?
      </p>
      <p>
        We conclude the section with a problem of practical importance. The greedy
approximation algorithm for k-attractor discussed in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] (i.e. iteratively pick the
text position that covers the largest number of uncovered substrings) achieves a
O(log k) approximation factor, but a naive implementation runs in O(n3) time.
Implementing e ciently this approximation (say, in O(n log n) time) would be
extremely valuable to build more space-e cient data structures in practice.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Anselm</given-names>
            <surname>Blumer</surname>
          </string-name>
          , Janet Blumer, David Haussler,
          <string-name>
            <surname>Ross McConnell</surname>
            ,
            <given-names>and Andrzej</given-names>
          </string-name>
          <string-name>
            <surname>Ehrenfeucht</surname>
          </string-name>
          .
          <article-title>Complete inverted les for e cient text retrieval and analysis</article-title>
          .
          <source>Journal of the ACM</source>
          ,
          <volume>34</volume>
          (
          <issue>3</issue>
          ):
          <volume>578</volume>
          {
          <fpage>595</fpage>
          ,
          <year>1987</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Michael</given-names>
            <surname>Burrows</surname>
          </string-name>
          and
          <string-name>
            <given-names>David J.</given-names>
            <surname>Wheeler</surname>
          </string-name>
          .
          <article-title>A block sorting lossless data compression algorithm</article-title>
          .
          <source>Technical Report 124</source>
          , Digital Equipment Corporation,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Maxime</given-names>
            <surname>Crochemore</surname>
          </string-name>
          and
          <string-name>
            <given-names>Renaud</given-names>
            <surname>Verin</surname>
          </string-name>
          .
          <article-title>Direct construction of compact directed acyclic word graphs</article-title>
          .
          <source>In Combinatorial Pattern Matching (CPM)</source>
          , pages
          <fpage>116</fpage>
          {
          <fpage>129</fpage>
          . Springer,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Dominik</given-names>
            <surname>Kempa</surname>
          </string-name>
          , Alberto Policriti, Nicola Prezza, and
          <string-name>
            <given-names>Eva</given-names>
            <surname>Rotenberg</surname>
          </string-name>
          . String Attractors:
          <article-title>Veri cation and Optimization</article-title>
          . In Yossi Azar, Hannah Bast, and Grzegorz Herman, editors,
          <source>26th Annual European Symposium on Algorithms (ESA</source>
          <year>2018</year>
          ), volume
          <volume>112</volume>
          <source>of Leibniz International Proceedings in Informatics (LIPIcs)</source>
          , pages
          <fpage>52</fpage>
          :1{
          <fpage>52</fpage>
          :
          <fpage>13</fpage>
          ,
          <string-name>
            <surname>Dagstuhl</surname>
          </string-name>
          , Germany,
          <year>2018</year>
          . Schloss Dagstuhl{
          <article-title>Leibniz-Zentrum fuer Informatik</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Dominik</given-names>
            <surname>Kempa</surname>
          </string-name>
          and
          <string-name>
            <given-names>Nicola</given-names>
            <surname>Prezza</surname>
          </string-name>
          .
          <article-title>At the Roots of Dictionary Compression: String Attractors</article-title>
          .
          <source>In Annual Symposium on Theory of Computing (STOC)</source>
          , pages
          <fpage>827</fpage>
          {
          <fpage>840</fpage>
          . ACM,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>T.</given-names>
            <surname>Kida</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Matsumoto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Shibata</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Takeda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Shinohara</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Arikawa</surname>
          </string-name>
          .
          <article-title>Collage system: A unifying framework for compressed pattern matching</article-title>
          .
          <source>Theor. Comput. Sci.</source>
          ,
          <volume>298</volume>
          (
          <issue>1</issue>
          ):
          <volume>253</volume>
          {
          <fpage>272</fpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. John C.
          <article-title>Kie er and En-Hui Yang</article-title>
          .
          <article-title>Grammar-based codes: A new class of universal lossless source codes</article-title>
          .
          <source>IEEE Transactions on Information Theory</source>
          ,
          <volume>46</volume>
          (
          <issue>3</issue>
          ):
          <volume>737</volume>
          {
          <fpage>754</fpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>A.</given-names>
            <surname>Lempel</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Ziv</surname>
          </string-name>
          .
          <article-title>On the complexity of nite sequences</article-title>
          .
          <source>IEEE Trans. Information Theory</source>
          ,
          <volume>22</volume>
          (
          <issue>1</issue>
          ):
          <volume>75</volume>
          {
          <fpage>81</fpage>
          ,
          <year>1976</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Gonzalo</given-names>
            <surname>Navarro</surname>
          </string-name>
          and
          <string-name>
            <given-names>Nicola</given-names>
            <surname>Prezza</surname>
          </string-name>
          .
          <source>Universal Compressed Text Indexing. Theoretical Computer Science</source>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>James</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Storer</surname>
            and
            <given-names>Thomas G.</given-names>
          </string-name>
          <string-name>
            <surname>Szymanski</surname>
          </string-name>
          .
          <article-title>Data compression via textual substitution</article-title>
          .
          <source>Journal of the ACM</source>
          ,
          <volume>29</volume>
          (
          <issue>4</issue>
          ):
          <volume>928</volume>
          {
          <fpage>951</fpage>
          ,
          <year>1982</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>