{"title":"构建线性大小后缀三元组的线性时间在线算法","authors":"","doi":"10.1016/j.tcs.2024.114765","DOIUrl":null,"url":null,"abstract":"<div><p>The suffix trees are fundamental data structures for various kinds of string processing. The suffix tree of a text string <em>T</em> of length <em>n</em> has <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> nodes and edges, and the string label of each edge is encoded by a pair of positions in <em>T</em>. Thus, even after the tree is built, the input string <em>T</em> needs to be kept stored and random access to <em>T</em> is still needed. The <em>linear-size suffix tries</em> (<em>LSTs</em>), proposed by Crochemore et al. [Linear-size suffix tries, TCS 638:171-178, 2016], are a “stand-alone” alternative to the suffix trees. Namely, the LST of an input text string <em>T</em> of length <em>n</em> occupies <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> total space, and supports pattern matching and other tasks with the same efficiency as the suffix tree without the need to store the input text string <em>T</em>. Crochemore et al. proposed an <em>offline</em> algorithm which transforms the suffix tree of <em>T</em> into the LST of <em>T</em> in <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mi>log</mi><mo></mo><mi>σ</mi><mo>)</mo></math></span> time and <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> space, where <em>σ</em> is the alphabet size. In this paper, we present two types of <em>online</em> algorithms which “directly” construct the LST, from right to left, and from left to right, without constructing the suffix tree as an intermediate structure. Both algorithms construct the LST incrementally when a new symbol is read, and do not access the previously read symbols. Both of the right-to-left construction algorithm and the left-to-right construction algorithm work in <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mi>log</mi><mo></mo><mi>σ</mi><mo>)</mo></math></span> time and <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> space. The main feature of our algorithms is that the input text string does not need to be stored.</p></div>","PeriodicalId":49438,"journal":{"name":"Theoretical Computer Science","volume":null,"pages":null},"PeriodicalIF":0.9000,"publicationDate":"2024-08-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Linear time online algorithms for constructing linear-size suffix trie\",\"authors\":\"\",\"doi\":\"10.1016/j.tcs.2024.114765\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><p>The suffix trees are fundamental data structures for various kinds of string processing. The suffix tree of a text string <em>T</em> of length <em>n</em> has <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> nodes and edges, and the string label of each edge is encoded by a pair of positions in <em>T</em>. Thus, even after the tree is built, the input string <em>T</em> needs to be kept stored and random access to <em>T</em> is still needed. The <em>linear-size suffix tries</em> (<em>LSTs</em>), proposed by Crochemore et al. [Linear-size suffix tries, TCS 638:171-178, 2016], are a “stand-alone” alternative to the suffix trees. Namely, the LST of an input text string <em>T</em> of length <em>n</em> occupies <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> total space, and supports pattern matching and other tasks with the same efficiency as the suffix tree without the need to store the input text string <em>T</em>. Crochemore et al. proposed an <em>offline</em> algorithm which transforms the suffix tree of <em>T</em> into the LST of <em>T</em> in <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mi>log</mi><mo></mo><mi>σ</mi><mo>)</mo></math></span> time and <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> space, where <em>σ</em> is the alphabet size. In this paper, we present two types of <em>online</em> algorithms which “directly” construct the LST, from right to left, and from left to right, without constructing the suffix tree as an intermediate structure. Both algorithms construct the LST incrementally when a new symbol is read, and do not access the previously read symbols. Both of the right-to-left construction algorithm and the left-to-right construction algorithm work in <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mi>log</mi><mo></mo><mi>σ</mi><mo>)</mo></math></span> time and <span><math><mi>O</mi><mo>(</mo><mi>n</mi><mo>)</mo></math></span> space. The main feature of our algorithms is that the input text string does not need to be stored.</p></div>\",\"PeriodicalId\":49438,\"journal\":{\"name\":\"Theoretical Computer Science\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.9000,\"publicationDate\":\"2024-08-06\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Theoretical Computer Science\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S0304397524003827\",\"RegionNum\":4,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"COMPUTER SCIENCE, THEORY & METHODS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Theoretical Computer Science","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0304397524003827","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
引用次数: 0
摘要
后缀树是各种字符串处理的基本数据结构。长度为 n 的文本字符串 T 的后缀树有 O(n) 个节点和边,每条边的字符串标签由 T 中的一对位置编码。Crochemore 等人提出的线性大小后缀尝试(LST)[Linear-size suffix tries, TCS 638:171-178, 2016]是后缀树的 "独立 "替代品。Crochemore 等人提出了一种离线算法,可以在 O(nlogσ) 时间和 O(n) 空间内将 T 的后缀树转化为 T 的 LST,其中 σ 是字母表大小。本文提出了两种在线算法,分别从右向左和从左向右 "直接 "构建 LST,而不将后缀树作为中间结构。这两种算法都是在读取新符号时增量构建 LST,而不访问之前读取的符号。从右到左构建算法和从左到右构建算法的工作时间和空间分别为 O(nlogσ) 和 O(n)。我们算法的主要特点是无需存储输入文本字符串。
Linear time online algorithms for constructing linear-size suffix trie
The suffix trees are fundamental data structures for various kinds of string processing. The suffix tree of a text string T of length n has nodes and edges, and the string label of each edge is encoded by a pair of positions in T. Thus, even after the tree is built, the input string T needs to be kept stored and random access to T is still needed. The linear-size suffix tries (LSTs), proposed by Crochemore et al. [Linear-size suffix tries, TCS 638:171-178, 2016], are a “stand-alone” alternative to the suffix trees. Namely, the LST of an input text string T of length n occupies total space, and supports pattern matching and other tasks with the same efficiency as the suffix tree without the need to store the input text string T. Crochemore et al. proposed an offline algorithm which transforms the suffix tree of T into the LST of T in time and space, where σ is the alphabet size. In this paper, we present two types of online algorithms which “directly” construct the LST, from right to left, and from left to right, without constructing the suffix tree as an intermediate structure. Both algorithms construct the LST incrementally when a new symbol is read, and do not access the previously read symbols. Both of the right-to-left construction algorithm and the left-to-right construction algorithm work in time and space. The main feature of our algorithms is that the input text string does not need to be stored.
期刊介绍:
Theoretical Computer Science is mathematical and abstract in spirit, but it derives its motivation from practical and everyday computation. Its aim is to understand the nature of computation and, as a consequence of this understanding, provide more efficient methodologies. All papers introducing or studying mathematical, logic and formal concepts and methods are welcome, provided that their motivation is clearly drawn from the field of computing.