On Prefix-Sorting Finite Automata

02/04/2019
by   Jarno Alanko, et al.
0

Being able to efficiently test the membership of a word in a formal language is, arguably, one of the most fundamental problems in computer science. In this paper, we apply string-processing techniques (specifically, prefix-sorting) to speed up solutions for this problem on languages described by particular finite automata. Prefix sorting can be generalized to objects more complex than strings: the recent notion of Wheeler graph extends this concept to labeled graphs (for example, finite-state automata). A Wheeler graph admits a co-lexicographic ordering of its nodes and opens up the possibility of building fast and small data structures supporting path queries on the graph. However, while strings and trees can always be prefix-sorted in linear time, the situation on graphs is more complicated: not all graphs are Wheeler, and a recent result shows that the problem of identifying them is NP-complete even for acyclic NFAs. In this paper, we present the following results: (i) we show that the problem of recognizing and sorting Wheeler DFAs (even cyclic) can be solved offline in optimal linear time, (ii) when the DFA is acyclic, we give an online algorithm that, when fed with the DFA's states in any topological order, with logarithmic delay computes the co-lexicographic rank of a new incoming state or decides that such an ordering does not exist, and (iii) we show that also Wheeler 2-NFAs---i.e. those with at most two equally-labeled transitions leaving any state---admit a polynomial-time identification and prefix-sorting algorithm. Our algorithms (i)-(ii) generalize to labeled graphs existing prefix-sorting algorithms on strings and labeled trees that have been previously described in the literature.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/21/2023

Faster Prefix-Sorting Algorithms for Deterministic Finite Automata

Sorting is a fundamental algorithmic pre-processing technique which ofte...
research
05/09/2023

Sorting Finite Automata via Partition Refinement

Wheeler nondeterministic finite automata (WNFAs) were introduced as a ge...
research
07/13/2017

A Dichotomy on Constrained Topological Sorting

We introduce the constrained topological sorting problem (CTS-problem): ...
research
05/21/2019

Sampling from Stochastic Finite Automata with Applications to CTC Decoding

Stochastic finite automata arise naturally in many language and speech p...
research
09/26/2022

Inferring strings from position heaps in linear time

Position heaps are index structures of text strings used for the exact s...
research
08/16/2021

Constrained Synchronization and Subset Synchronization Problems for Weakly Acyclic Automata

We investigate the constrained synchronization problem for weakly acycli...
research
05/04/2023

Prefix Sorting DFAs: a Recursive Algorithm

In the past thirty years, numerous algorithms for building the suffix ar...

Please sign up or login with your details

Forgot password? Click here to reset