Skip to main content
QUICK REVIEW

[論文レビュー] Sorting Finite Automata via Partition Refinement

Ruben Becker, Manuel Cáceres|arXiv (Cornell University)|Jan 1, 2023
semigroups and automata theoryComputer Science被引用数 1
ひとこと要約

本稿では、拡張されたパーティション精錬技術を用いて、Wheeler NFAにおける共通辞書順全順序およびDFAにおける最小幅共通辞書順部分順序を計算する、O(|δ| log |Q|) 時間の効率的アルゴリズムを提示する。パッケージ・タージャンアルゴリズムを順序付きパーティションに適応させ、 pruning ヒューリスティクスを組み込むことで、最適な時間計算量を達成し、実用的に従来手法を上回る性能を示す。実装例では、大規模なオートマトンにおいて最大10,000倍の高速化が達成された。

ABSTRACT

Wheeler nondeterministic finite automata (WNFAs) were introduced as a generalization of prefix sorting from strings to labeled graphs. WNFAs admit optimal solutions to classic hard problems on labeled graphs and languages. The problem of deciding whether a given NFA is Wheeler is known to be NP-complete. Recently, however, Alanko et al. showed how to side-step this complexity by switching to preorders: letting $Q$ be the set of states, $E$ the set of transitions, $|Q|=n$, and $|E|=m$, they provided a $O(mn^2)$-time algorithm computing a totally-ordered partition of the WNFA's states such that (1) equivalent states recognize the same regular language, and (2) the order of non-equivalent states is consistent with any Wheeler order, when one exists. Then, the output is a preorder of the states as useful for pattern matching as standard Wheeler orders. Further research generalized these concepts to arbitrary NFAs by introducing co-lex partial preorders: any NFA admits a partial preorder of its states reflecting the co-lex order of their accepted strings; the smaller the width of such preorder is, the faster regular expression matching queries can be performed. To date, the fastest algorithm for computing the smallest-width partial preorder on NFAs runs in $O(m^2+n^{5/2})$ time, while on DFAs the same can be done in $O(\min(n^2\log n,mn))$ time. In this paper, we provide much more efficient solutions to the problem above. Our results are achieved by extending a classic algorithm for the relational coarsest partition refinement problem to work with ordered partitions. Specifically, we provide a $O(m\log n)$-time algorithm computing a co-lex total preorder when the input is a WNFA, and an algorithm with the same time complexity computing the smallest-width co-lex partial order of any DFA. Also, we present implementations of our algorithms and show that they are very efficient in practice.

研究の動機と目的

  • pangenomeグラフなどの大規模応用分野におけるパターンマッチングのための有限オートマトンにおける共通辞書順全順序計算の計算ボトルネックを解消すること。
  • Wheelerオートマトンの決定がNP完全であることを踏まえ、Wheeler順序の有用性を保つ全順序計算に焦点を当てる。
  • DFAにおける最小幅共通辞書順部分順序およびWNFAにおける全順序を、時間的・空間的に効率的なアルゴリズムで計算すること。
  • 5000万ステートおよびエッジを超えるオートマトンにスケーリング可能な実用的実装を提供し、実世界の効率性を示すこと。

提案手法

  • 古典的なパッケージ・タージャンアルゴリズムを粗いパーティション精錬に拡張し、順序付きパーティション上で動作させることで、ステートの共通辞書順序付けを可能にする。
  • 精錬後に不要な遷移を削除するためのpruning機構を導入し、各非ソースステートが、精錬済みオートマトン内で正確に1本の入力遷移を持つことを保証する。
  • 各ステートについて、Ainf および Asup という精錬済みオートマトン上で後退ウォークを用いて、受理される文字列の下界と上界を計算する。
  • サフィックス倍増スタイルのアルゴリズムを適用し、ポ인터ベースの2kホップナビゲーションを用いて、逆サフィックス配列(ISA)の共通辞書順序をO(|Q| log |Q|) 時間で計算する。
  • 均し計算分析を用いて、pruningが合計でO(|δ|)の追加作業しか加えないことを示し、O(|δ| log |Q|) 時間計算量が保たれることを確認する。
  • C++でアルゴリズムを実装し、合成的および実世界のpangenome DFAに対して評価を行い、WGTリネーミングヒューリスティクスと比較した。

実験結果

リサーチクエスチョン

  • RQ1Wheeler NFAにおけるステートの共通辞書順序は、パーティション精錬の理論的下界と一致するO(|δ| log |Q|) 時間で計算可能か?
  • RQ2任意のDFAについて、最小幅共通辞書順部分順序をO(|δ| log |Q|) 時間で計算可能か? これは従来のO(|δ|² + |Q|⁵ᐟ²) の境界を改善するものか?
  • RQ3大規模オートマトンにおいて、提案手法のパーティション精錬とpruningは、WGTのリネーミングヒューリスティクスと比較して実用的にどの程度優れているか?
  • RQ4pruningステップは、精錬プロセスにおけるメモリおよび時間的オーバーヘッドを削減しながら、正しさをどの程度保っているか?
  • RQ5本アルゴリズムは、5000万ステートおよびエッジを超える実世界のpangenomeグラフに、低メモリおよび時間計算量を維持したままスケーリング可能か?

主な発見

  • 提案手法は、任意のWheeler NFAについて、O(|δ| log |Q|) 時間で共通辞書順全順序を計算し、パッケージ・タージャンアルゴリズムの最適計算量と一致する。
  • DFAにおいては、O(|δ| log |Q|) 時間で最小幅共通辞書順部分順序を計算し、従来のO(|δ|² + |Q|⁵ᐟ²) の境界を改善した。
  • 100万ステートNFAでは、実装がWheeler全順序を約7秒で計算し、ほぼ線形のスケーラビリティを示した。
  • 実装は、WGTリネーミングヒューリスティクスに比べ、実行時間で最大10,000倍の高速化を達成し、大規模入力では3倍のメモリ効率も示した。
  • 5100万ステートおよび5300万エッジを持つpangenomic DFAについて、355秒で正しくpruningを実行し、ピークメモリ使用量は33.2 GBに留めた。
  • pruningステップは均し計算でたかだかO(|δ|)の追加時間しか加えないことが確認され、追加処理にもかかわらず、全体の計算量がO(|δ| log |Q|) のまま保たれていることが裏付けられた。

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。