Topological Sorting with Regular Constraints

We introduce the constrained topological sorting problem (CTS): given a regular language K and a directed acyclic graph G with labeled vertices, determine if G has a topological sort that forms a word in K. This natural problem applies to several settings, e.g., scheduling with costs or verifying concurrent programs. We consider the problem CTS[K] where the target language K is fixed, and study its complexity depending on K. We show that CTS[K] is tractable when K falls in several language families, e.g., unions of monomials, which can be used for pattern matching. However, we show that CTS[K] is NP-hard for K = (ab) * and introduce a shuffle reduction technique to show hardness for more languages. We also study the special case of the constrained shuffle problem (CSh), where the input graph is a disjoint union of strings, and show that CSh[K] is additionally tractable when K is a group language or a union of district group monomials. We conjecture that a dichotomy should hold on the complexity of CTS[K] or CSh[K] depending on K, and substantiate this by proving a coarser dichotomy under a different problem phrasing which ensures that tractable languages are closed under common operators.

[1]  Samuel R. Buss,et al.  Unshuffling a square is NP-hard , 2014, J. Comput. Syst. Sci..

[2]  R. P. Dilworth,et al.  A DECOMPOSITION THEOREM FOR PARTIALLY ORDERED SETS , 1950 .

[3]  M. Schützenberger,et al.  Sur Le Produit De Concatenation Non Ambigu , 1976 .

[4]  David S. Johnson,et al.  Complexity Results for Multiprocessor Scheduling under Resource Constraints , 1975, SIAM J. Comput..

[5]  David S. Johnson,et al.  The NP-Completeness Column: An Ongoing Guide , 1982, J. Algorithms.

[6]  Charles Paperman,et al.  A Dichotomy on Constrained Topological Sorting , 2017, ArXiv.

[7]  Benjamin Moseley,et al.  Scheduling Parallel DAG Jobs Online to Minimize Average Flow Time , 2016, SODA.

[8]  Takayuki Kimura An algebraic system for process structuring and interprocess communication , 1976, STOC '76.

[9]  David Haussler,et al.  On the Complexity of Iterated Shuffle , 1984, J. Comput. Syst. Sci..

[10]  Tomás Feder,et al.  The Computational Structure of Monotone Monadic SNP and Constraint Satisfaction: A Study through Datalog and Group Theory , 1999, SIAM J. Comput..

[11]  Oscar H. Ibarra,et al.  On the Complexity and Decidability of Some Problems Involving Shuffle , 2015, DCFS.

[12]  Manuel Bodirsky,et al.  The complexity of temporal constraint satisfaction problems , 2010, JACM.

[13]  Anthony Mansfield,et al.  On the computational complexity of a merge recognition problem , 1983, Discret. Appl. Math..

[14]  Jean-Éric Pin,et al.  Syntactic Semigroups , 1997, Handbook of Formal Languages.

[15]  David S. Johnson,et al.  Computers and Intractability: A Guide to the Theory of NP-Completeness , 1978 .

[16]  Denis Thérien,et al.  The Computing Power of Programs over Finite Monoids , 2002, J. Autom. Lang. Comb..

[17]  Thomas Wilke,et al.  Over words, two variables are as powerful as one quantifier alternation , 1998, STOC '98.

[18]  John D. Kececioglu,et al.  Reconstructing a history of recombinations from a set of sequences , 1994, SODA '94.

[19]  Jean-Éric Pin Jean-Eric Pin () , 2022 .

[20]  Romeo Rizzi,et al.  On Recognizing Words That Are Squares for the Shuffle Product , 2013, CSR.

[21]  Denis Thérien,et al.  DIAMONDS ARE FOREVER: THE VARIETY DA , 2002 .

[22]  Jorge Almeida,et al.  Finite Semigroups and Universal Algebra , 1995 .

[23]  William C. Rounds,et al.  Complexity of expressions allowing concurrency , 1978, POPL '78.

[24]  Neil Immerman,et al.  Nondeterministic space is closed under complementation , 1988, [1988] Proceedings. Structure in Complexity Theory Third Annual Conference.

[25]  Daniel Deutch,et al.  Possible and Certain Answers for Queries over Order-Incomplete Data , 2017, TIME.