A Dichotomy on Constrained Topological Sorting

07/13/2017
by   Antoine Amarilli, et al.
0

We introduce the constrained topological sorting problem (CTS-problem): given a target language L and a directed acyclic graph (DAG) G with labeled vertices, determine if G has a topological sort which forms a word that belongs to L. This natural problem applies to several settings, including scheduling with costs or verifying concurrent programs. It also generalizes the shuffle problem of formal language theory, which asks if a list of input strings has an interleaving that achieves a target string. We accordingly call constrained shuffle problem (CSh-problem) the restriction of our CTS-problem where the input DAG consists of disjoint strings. We study the complexity of the CTS-problem and CSh-problem for regular target languages: for each fixed regular language L, we call CTS(L) and CSh(L) the corresponding problems, where the input is the DAG. Our goal is to characterize the regular languages for which these problems are tractable. We show that both problems are tractable (in NL) for unions of monomials, a useful language class for pattern matching, as well as some other cases. We extend this for the CSh-problem to unions of district group monomials. We also show NP-hardness for some other languages such as (ab)^*. These results lead to a dichotomy for a different problem phrasing, when the target is specified as a semiautomaton to enforce some closure assumptions, and where the semiautomaton is assumed to be counter-free. In this case, both problems are in NL if the transition monoid of the semiautomaton is in some class, and NP-hard otherwise. Without the counter-freeness assumption, we can extend the dichotomy to a partial result for the CSh-problem. Our proofs use a variety of tools ranging from complexity theory, combinatorics, algebraic automata theory, Ramsey's theorem, as well as a custom reduction and other new techniques.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/02/2020

On a Class of Constrained Synchronization Problems in NP

The class of known constraint automata for which the constrained synchro...
research
02/04/2019

On Prefix-Sorting Finite Automata

Being able to efficiently test the membership of a word in a formal lang...
research
03/01/2019

A Trichotomy for Regular Trail Queries

Regular path queries (RPQs) are an essential component of graph query la...
research
05/18/2020

On the Separability Problem of String Constraints

We address the separability problem for straight-line string constraints...
research
05/09/2023

Sorting Finite Automata via Partition Refinement

Wheeler nondeterministic finite automata (WNFAs) were introduced as a ge...
research
06/26/2023

Semënov Arithmetic, Affine VASS, and String Constraints

We study extensions of Semënov arithmetic, the first-order theory of the...
research
10/26/2020

A Purely Regular Approach to Non-Regular Core Spanners

The regular spanners (characterised by vset-automata) are closed under t...

Please sign up or login with your details

Forgot password? Click here to reset