arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1902.01088cs.DS
收藏

正则语言满足前缀排序

Regular Languages meet Prefix Sorting

Jarno Alanko, Giovanna D'Agostino, Alberto Policriti, Nicola Prezza

摘要:

通过前缀(或后缀)排序索引字符串可以说是过去几十年中开发的最成功的算法技术之一。索引可以扩展到语言吗?本文的主要贡献是对状态可前缀排序的自动机所接受的正则语言的子类进行了研究。从最近的Wheeler图的概念出发[Gagie等人,TCS 2017]-自然地将前缀排序的概念扩展到标记图-我们研究了Wheeler语言的属性,即正则语言允许接受Wheeler有限自动机。有趣的是,我们将这个家族描述为具有共字典序的正则语言的自然扩展:当排序时,属于Wheeler语言的字符串被划分为有限数量的共字典区间,每个区间由来自单个Myhill-Nerode等价类的元素形成。此外:(i)我们证明了每一个具有$n$态的Wheeler NFA(WDFA)都有一个等价的Wheeler DFA(WDFA),它至多具有$2n-1-|Σ|$态,并且能在$O(n^3)$时间内计算。这与一般的NFA形成鲜明对比。(ii)我们描述了一个二次算法的前缀排序一个适当的超集的WDFAs,一个$O(n\log n)$时间在线算法排序非循环WDFAs,和一个最佳的线性时间离线算法排序一般WDFAs。通过贡献(i),我们的算法也可以用于索引任何WNFA,其代价是自动机的大小加倍。(iii)我们提供了一个最小化定理,其特征在于最小的WDFA识别相同的语言的任何输入WDFA。相应的构造性算法在非循环情况下在最优线性时间内运行,而在一般情况下在$O(n\log n)$时间内运行。(iv)我们展示了如何计算最小的WDFA相当于任何非循环DFA在接近最佳的时间。

英文摘要:

Indexing strings via prefix (or suffix) sorting is, arguably, one of the most successful algorithmic techniques developed in the last decades. Can indexing be extended to languages? The main contribution of this paper is to initiate the study of the sub-class of regular languages accepted by an automaton whose states can be prefix-sorted. Starting from the recent notion of Wheeler graph [Gagie et al., TCS 2017]-which extends naturally the concept of prefix sorting to labeled graphs-we investigate the properties of Wheeler languages, that is, regular languages admitting an accepting Wheeler finite automaton. Interestingly, we characterize this family as the natural extension of regular languages endowed with the co-lexicographic ordering: when sorted, the strings belonging to a Wheeler language are partitioned into a finite number of co-lexicographic intervals, each formed by elements from a single Myhill-Nerode equivalence class. Moreover: (i) We show that every Wheeler NFA (WNFA) with $n$ states admits an equivalent Wheeler DFA (WDFA) with at most $2n-1-|Σ|$ states that can be computed in $O(n^3)$ time. This is in sharp contrast with general NFAs. (ii) We describe a quadratic algorithm to prefix-sort a proper superset of the WDFAs, a $O(n\log n)$-time online algorithm to sort acyclic WDFAs, and an optimal linear-time offline algorithm to sort general WDFAs. By contribution (i), our algorithms can also be used to index any WNFA at the moderate price of doubling the automaton's size. (iii) We provide a minimization theorem that characterizes the smallest WDFA recognizing the same language of any input WDFA. The corresponding constructive algorithm runs in optimal linear time in the acyclic case, and in $O(n\log n)$ time in the general case. (iv) We show how to compute the smallest WDFA equivalent to any acyclic DFA in nearly-optimal time.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑