Top Banner
Topological Sorting under Regular Constraints Antoine Amarilli , Charles Paperman December th, Télécom ParisTech Université de Lille /
159

Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Jul 08, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Topological Sorting under Regular Constraints

Antoine Amarilli1, Charles Paperman2

December 7th, 20181Télécom ParisTech

2Université de Lille

1/24

Page 2: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b a b... in L!

2/24

Page 3: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b a b... in L!

2/24

Page 4: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:

• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b a b... in L!

2/24

Page 5: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b a b... in L!

2/24

Page 6: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b a b... in L!

2/24

Page 7: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a

b a b b a... not in L!

2/24

Page 8: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b

a b b a... not in L!

2/24

Page 9: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a

b b a... not in L!

2/24

Page 10: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b

b a... not in L!

2/24

Page 11: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b b

a... not in L!

2/24

Page 12: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b b a

... not in L!

2/24

Page 13: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b b a... not in L!

2/24

Page 14: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b a b... in L!

2/24

Page 15: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a

b a b a b... in L!

2/24

Page 16: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b

a b a b... in L!

2/24

Page 17: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a

b a b... in L!

2/24

Page 18: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b

a b... in L!

2/24

Page 19: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b a

b... in L!

2/24

Page 20: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b a b

... in L!

2/24

Page 21: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b a b... in L!

2/24

Page 22: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b a b... in L!

2/24

Page 23: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Constrained Topological Sorting

• Fix an alphabet: e.g., Σ = {a,b}

• Fix a language: e.g., L = (ab)∗

• We study constrained topological sorting:• Input: directed acyclic graph (DAG)with vertices labeled with Σ

• Output: is there a topological sortthat falls in L?

• Question: when is this problem tractable?

a

b a b

b a

a b a b a b... in L!

2/24

Page 24: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Motivation

• How we really ended up studying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XMLXML versioning

• Which a-posteriori motivation did we invent for the problem?→ Scheduling with constraints! → Veri�cation for concurrent code!→ Computational biology! → Blockchain! (joke)

• But why do we actually care?→ Natural problem and apparently nothing was known about it!

3/24

Page 25: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Motivation

• How we really ended up studying this problem:2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XMLXML versioning

• Which a-posteriori motivation did we invent for the problem?→ Scheduling with constraints! → Veri�cation for concurrent code!→ Computational biology! → Blockchain! (joke)

• But why do we actually care?→ Natural problem and apparently nothing was known about it!

3/24

Page 26: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Motivation

• How we really ended up studying this problem:2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XMLXML versioning

Order-uncertain databasesTop-k Aggregate queries

• Which a-posteriori motivation did we invent for the problem?→ Scheduling with constraints! → Veri�cation for concurrent code!→ Computational biology! → Blockchain! (joke)

• But why do we actually care?→ Natural problem and apparently nothing was known about it!

3/24

Page 27: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Motivation

• How we really ended up studying this problem:2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XMLXML versioning

Order-uncertain databasesTop-k Aggregate queries

Possible answers

• Which a-posteriori motivation did we invent for the problem?→ Scheduling with constraints! → Veri�cation for concurrent code!→ Computational biology! → Blockchain! (joke)

• But why do we actually care?→ Natural problem and apparently nothing was known about it!

3/24

Page 28: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Motivation

• How we really ended up studying this problem:2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XMLXML versioning

Order-uncertain databasesTop-k Aggregate queries

Possible answers

DAGs

Algebraic language theory?!

• Which a-posteriori motivation did we invent for the problem?→ Scheduling with constraints! → Veri�cation for concurrent code!→ Computational biology! → Blockchain! (joke)

• But why do we actually care?→ Natural problem and apparently nothing was known about it!

3/24

Page 29: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Motivation

• How we really ended up studying this problem:2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XMLXML versioning

Order-uncertain databasesTop-k Aggregate queries

Possible answers

DAGs

Algebraic language theory?!

• Which a-posteriori motivation did we invent for the problem?

→ Scheduling with constraints! → Veri�cation for concurrent code!→ Computational biology! → Blockchain! (joke)

• But why do we actually care?→ Natural problem and apparently nothing was known about it!

3/24

Page 30: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Motivation

• How we really ended up studying this problem:2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XMLXML versioning

Order-uncertain databasesTop-k Aggregate queries

Possible answers

DAGs

Algebraic language theory?!

• Which a-posteriori motivation did we invent for the problem?→ Scheduling with constraints! → Veri�cation for concurrent code!

→ Computational biology! → Blockchain! (joke)

• But why do we actually care?→ Natural problem and apparently nothing was known about it!

3/24

Page 31: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Motivation

• How we really ended up studying this problem:2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XMLXML versioning

Order-uncertain databasesTop-k Aggregate queries

Possible answers

DAGs

Algebraic language theory?!

• Which a-posteriori motivation did we invent for the problem?→ Scheduling with constraints! → Veri�cation for concurrent code!→ Computational biology! → Blockchain!

(joke)

• But why do we actually care?→ Natural problem and apparently nothing was known about it!

3/24

Page 32: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Motivation

• How we really ended up studying this problem:2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XMLXML versioning

Order-uncertain databasesTop-k Aggregate queries

Possible answers

DAGs

Algebraic language theory?!

• Which a-posteriori motivation did we invent for the problem?→ Scheduling with constraints! → Veri�cation for concurrent code!→ Computational biology! → Blockchain! (joke)

• But why do we actually care?→ Natural problem and apparently nothing was known about it!

3/24

Page 33: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Motivation

• How we really ended up studying this problem:2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XMLXML versioning

Order-uncertain databasesTop-k Aggregate queries

Possible answers

DAGs

Algebraic language theory?!

• Which a-posteriori motivation did we invent for the problem?→ Scheduling with constraints! → Veri�cation for concurrent code!→ Computational biology! → Blockchain! (joke)

• But why do we actually care?

→ Natural problem and apparently nothing was known about it!

3/24

Page 34: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Motivation

• How we really ended up studying this problem:2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XMLXML versioning

Order-uncertain databasesTop-k Aggregate queries

Possible answers

DAGs

Algebraic language theory?!

• Which a-posteriori motivation did we invent for the problem?→ Scheduling with constraints! → Veri�cation for concurrent code!→ Computational biology! → Blockchain! (joke)

• But why do we actually care?→ Natural problem and apparently nothing was known about it!

3/24

Page 35: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Formal problem statement

• Fix a regular language L on an �nite alphabet Σ

• Constrained topological sort problem CTS(L):• Input: a DAG G with vertices labeled by letters of Σ

• Output: is there a topological sort of G such thatthe sequence of vertex labels is a word of L

• Special case: the constrained shu�e problem CSh(L):• Input: a set of words w1, . . . ,wn of Σ∗

• Output: is there a shu�e of w1, . . . ,wn which is in L

• This is like CTS but the input DAG is an union of paths→ Question: What is the complexity of CTS(L) and CSh(L),

depending on the �xed language L?

4/24

Page 36: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Formal problem statement

• Fix a regular language L on an �nite alphabet Σ

• Constrained topological sort problem CTS(L):• Input: a DAG G with vertices labeled by letters of Σ

• Output: is there a topological sort of G such thatthe sequence of vertex labels is a word of L

a

b a b

b a

• Special case: the constrained shu�e problem CSh(L):• Input: a set of words w1, . . . ,wn of Σ∗

• Output: is there a shu�e of w1, . . . ,wn which is in L

• This is like CTS but the input DAG is an union of paths→ Question: What is the complexity of CTS(L) and CSh(L),

depending on the �xed language L?

4/24

Page 37: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Formal problem statement

• Fix a regular language L on an �nite alphabet Σ

• Constrained topological sort problem CTS(L):• Input: a DAG G with vertices labeled by letters of Σ

• Output: is there a topological sort of G such thatthe sequence of vertex labels is a word of L

a

b a b

b a

• Special case: the constrained shu�e problem CSh(L):• Input: a set of words w1, . . . ,wn of Σ∗

• Output: is there a shu�e of w1, . . . ,wn which is in L

• This is like CTS but the input DAG is an union of paths→ Question: What is the complexity of CTS(L) and CSh(L),

depending on the �xed language L?

4/24

Page 38: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Formal problem statement

• Fix a regular language L on an �nite alphabet Σ

• Constrained topological sort problem CTS(L):• Input: a DAG G with vertices labeled by letters of Σ

• Output: is there a topological sort of G such thatthe sequence of vertex labels is a word of L

a

b a b

b a

• Special case: the constrained shu�e problem CSh(L):• Input: a set of words w1, . . . ,wn of Σ∗

• Output: is there a shu�e of w1, . . . ,wn which is in L

• This is like CTS but the input DAG is an union of paths

a

a

b

b

b

a

→ Question: What is the complexity of CTS(L) and CSh(L),depending on the �xed language L?

4/24

Page 39: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Formal problem statement

• Fix a regular language L on an �nite alphabet Σ

• Constrained topological sort problem CTS(L):• Input: a DAG G with vertices labeled by letters of Σ

• Output: is there a topological sort of G such thatthe sequence of vertex labels is a word of L

a

b a b

b a

• Special case: the constrained shu�e problem CSh(L):• Input: a set of words w1, . . . ,wn of Σ∗

• Output: is there a shu�e of w1, . . . ,wn which is in L

• This is like CTS but the input DAG is an union of paths

a

a

b

b

b

a

→ Question: What is the complexity of CTS(L) and CSh(L),depending on the �xed language L?

4/24

Page 40: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Dichotomy

Conjecture

Conjecture

For every regular language L, exactly one of the following holds:

• L has [some nice property] and CTS(L) is in NL

• L has [some nasty property] and CTS(L) is NP-hard

Here’s what we actually know:

• CTS and CSh are NP-hard for some languages, including (ab)∗

• They are in NL for some language families (monomials, groups)• Some languages are tractable for seemingly unrelated reasons→ Very mysterious landscape! (to us)

5/24

Page 41: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Dichotomy Conjecture

ConjectureFor every regular language L, exactly one of the following holds:

• L has [some nice property] and CTS(L) is in NL

• L has [some nasty property] and CTS(L) is NP-hard

Here’s what we actually know:

• CTS and CSh are NP-hard for some languages, including (ab)∗

• They are in NL for some language families (monomials, groups)• Some languages are tractable for seemingly unrelated reasons→ Very mysterious landscape! (to us)

5/24

Page 42: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Dichotomy Conjecture

ConjectureFor every regular language L, exactly one of the following holds:

• L has [some nice property] and CTS(L) is in NL

• L has [some nasty property] and CTS(L) is NP-hard

Here’s what we actually know:

• CTS and CSh are NP-hard for some languages, including (ab)∗

• They are in NL for some language families (monomials, groups)• Some languages are tractable for seemingly unrelated reasons→ Very mysterious landscape! (to us)

5/24

Page 43: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Dichotomy Conjecture

ConjectureFor every regular language L, exactly one of the following holds:

• L has [some nice property] and CTS(L) is in NL

• L has [some nasty property] and CTS(L) is NP-hard

Here’s what we actually know:

• CTS and CSh are NP-hard for some languages, including (ab)∗

• They are in NL for some language families (monomials, groups)

• Some languages are tractable for seemingly unrelated reasons→ Very mysterious landscape! (to us)

5/24

Page 44: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Dichotomy Conjecture

ConjectureFor every regular language L, exactly one of the following holds:

• L has [some nice property] and CTS(L) is in NL

• L has [some nasty property] and CTS(L) is NP-hard

Here’s what we actually know:

• CTS and CSh are NP-hard for some languages, including (ab)∗

• They are in NL for some language families (monomials, groups)• Some languages are tractable for seemingly unrelated reasons

→ Very mysterious landscape! (to us)

5/24

Page 45: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Dichotomy Conjecture

ConjectureFor every regular language L, exactly one of the following holds:

• L has [some nice property] and CTS(L) is in NL

• L has [some nasty property] and CTS(L) is NP-hard

Here’s what we actually know:

• CTS and CSh are NP-hard for some languages, including (ab)∗

• They are in NL for some language families (monomials, groups)• Some languages are tractable for seemingly unrelated reasons→ Very mysterious landscape! (to us)

5/24

Page 46: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Hardness Results

Page 47: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Existing Hardness Result

... but the target is a word which is provided as input!

→ Does not directly apply for us, because we �x the target language

6/24

Page 48: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Existing Hardness Result

... but the target is a word which is provided as input!

→ Does not directly apply for us, because we �x the target language

6/24

Page 49: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Existing Hardness Result

... but the target is a word which is provided as input!

→ Does not directly apply for us, because we �x the target language

6/24

Page 50: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Hardness for CTS

• We can reduce their problem to CSh for the language (aA+ bB)∗

• To determine if the shu�e of aab and bb contains ababb ...

solve the CSh-problem for aab and bb and ABABB→ CSh((aA+ bB)∗) is NP-hard and the same holds for CTS

• Similar technique: CSh((ab)∗) is NP-hard

• Custom reduction technique to show NP-hardness

7/24

Page 51: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Hardness for CTS

• We can reduce their problem to CSh for the language (aA+ bB)∗

• To determine if the shu�e of aab and bb contains ababb ...solve the CSh-problem for aab and bb and ABABB

→ CSh((aA+ bB)∗) is NP-hard and the same holds for CTS

• Similar technique: CSh((ab)∗) is NP-hard

• Custom reduction technique to show NP-hardness

7/24

Page 52: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Hardness for CTS

• We can reduce their problem to CSh for the language (aA+ bB)∗

• To determine if the shu�e of aab and bb contains ababb ...solve the CSh-problem for aab and bb and ABABB

→ CSh((aA+ bB)∗) is NP-hard and the same holds for CTS

• Similar technique: CSh((ab)∗) is NP-hard

• Custom reduction technique to show NP-hardness

7/24

Page 53: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Hardness for CTS

• We can reduce their problem to CSh for the language (aA+ bB)∗

• To determine if the shu�e of aab and bb contains ababb ...solve the CSh-problem for aab and bb and ABABB

→ CSh((aA+ bB)∗) is NP-hard and the same holds for CTS

• Similar technique: CSh((ab)∗) is NP-hard

• Custom reduction technique to show NP-hardness

7/24

Page 54: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Hardness for CTS

• We can reduce their problem to CSh for the language (aA+ bB)∗

• To determine if the shu�e of aab and bb contains ababb ...solve the CSh-problem for aab and bb and ABABB

→ CSh((aA+ bB)∗) is NP-hard and the same holds for CTS

• Similar technique: CSh((ab)∗) is NP-hard

• Custom reduction technique to show NP-hardness

7/24

Page 55: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The reduction technique

Ga

b a b

b a

Pbcacbcacbcac

• Say we want to solve CTS for (ab)∗ (NP-hard)

• Say we know how to solve CTS for (abc)∗

• Take an instance G for (ab)∗, with 2n vertices

• Add the path P: (bcac)n

• A topsort of G ∪ P achieving (abc)∗

gives a topsort of G achieving (ab)∗

• Conversely, any topsort of G achieving (ab)∗

extends to a topsort of G+ P achieving (abc)∗

• Hence, CTS((abc)∗) is NP-hard

8/24

Page 56: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The reduction technique

Ga

b a b

b a

Pbcacbcacbcac

• Say we want to solve CTS for (ab)∗ (NP-hard)

• Say we know how to solve CTS for (abc)∗

• Take an instance G for (ab)∗, with 2n vertices

• Add the path P: (bcac)n

• A topsort of G ∪ P achieving (abc)∗

gives a topsort of G achieving (ab)∗

• Conversely, any topsort of G achieving (ab)∗

extends to a topsort of G+ P achieving (abc)∗

• Hence, CTS((abc)∗) is NP-hard

8/24

Page 57: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The reduction technique

Ga

b a b

b a

Pbcacbcacbcac

• Say we want to solve CTS for (ab)∗ (NP-hard)

• Say we know how to solve CTS for (abc)∗

• Take an instance G for (ab)∗, with 2n vertices

• Add the path P: (bcac)n

• A topsort of G ∪ P achieving (abc)∗

gives a topsort of G achieving (ab)∗

• Conversely, any topsort of G achieving (ab)∗

extends to a topsort of G+ P achieving (abc)∗

• Hence, CTS((abc)∗) is NP-hard

8/24

Page 58: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The reduction technique

Ga

b a b

b a

Pbcacbcacbcac

• Say we want to solve CTS for (ab)∗ (NP-hard)

• Say we know how to solve CTS for (abc)∗

• Take an instance G for (ab)∗, with 2n vertices

• Add the path P: (bcac)n

• A topsort of G ∪ P achieving (abc)∗

gives a topsort of G achieving (ab)∗

• Conversely, any topsort of G achieving (ab)∗

extends to a topsort of G+ P achieving (abc)∗

• Hence, CTS((abc)∗) is NP-hard

8/24

Page 59: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The reduction technique

Ga

b a b

b a

Pbcacbcacbcac

• Say we want to solve CTS for (ab)∗ (NP-hard)

• Say we know how to solve CTS for (abc)∗

• Take an instance G for (ab)∗, with 2n vertices

• Add the path P: (bcac)n

• A topsort of G ∪ P achieving (abc)∗

gives a topsort of G achieving (ab)∗

• Conversely, any topsort of G achieving (ab)∗

extends to a topsort of G+ P achieving (abc)∗

• Hence, CTS((abc)∗) is NP-hard

8/24

Page 60: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The reduction technique

Ga

b a b

b a

Pbcacbcacbcac

• Say we want to solve CTS for (ab)∗ (NP-hard)

• Say we know how to solve CTS for (abc)∗

• Take an instance G for (ab)∗, with 2n vertices

• Add the path P: (bcac)n

• A topsort of G ∪ P achieving (abc)∗

gives a topsort of G achieving (ab)∗

• Conversely, any topsort of G achieving (ab)∗

extends to a topsort of G+ P achieving (abc)∗

• Hence, CTS((abc)∗) is NP-hard

8/24

Page 61: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The reduction technique

Ga

b a b

b a

Pbcacbcacbcac

• Say we want to solve CTS for (ab)∗ (NP-hard)

• Say we know how to solve CTS for (abc)∗

• Take an instance G for (ab)∗, with 2n vertices

• Add the path P: (bcac)n

• A topsort of G ∪ P achieving (abc)∗

gives a topsort of G achieving (ab)∗

• Conversely, any topsort of G achieving (ab)∗

extends to a topsort of G+ P achieving (abc)∗

• Hence, CTS((abc)∗) is NP-hard

8/24

Page 62: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The reduction technique

Ga

b a b

b a

Pbcacbcacbcac

• Say we want to solve CTS for (ab)∗ (NP-hard)

• Say we know how to solve CTS for (abc)∗

• Take an instance G for (ab)∗, with 2n vertices

• Add the path P: (bcac)n

• A topsort of G ∪ P achieving (abc)∗

gives a topsort of G achieving (ab)∗

• Conversely, any topsort of G achieving (ab)∗

extends to a topsort of G+ P achieving (abc)∗

• Hence, CTS((abc)∗) is NP-hard

8/24

Page 63: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The reduction technique

Ga

b a b

b a

Pbcacbcacbcac

• Say we want to solve CTS for (ab)∗ (NP-hard)

• Say we know how to solve CTS for (abc)∗

• Take an instance G for (ab)∗, with 2n vertices

• Add the path P: (bcac)n

• A topsort of G ∪ P achieving (abc)∗

gives a topsort of G achieving (ab)∗

• Conversely, any topsort of G achieving (ab)∗

extends to a topsort of G+ P achieving (abc)∗

• Hence, CTS((abc)∗) is NP-hard

8/24

Page 64: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Formalizing the reduction

De�nitionA language L shu�e-reduces to a language L′ if, given any n in unary,we can compute in PTIME a word Pi having the following property:

for any word w of length n, we have w ∈ Li� the shu�e of w and Pi contains a word of L′.

TheoremIf L shu�e-reduces to L′ then:

• CSh(L) reduces in PTIME to CSh(L′)

• CTS(L) reduces in PTIME to CTS(L′)

9/24

Page 65: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Formalizing the reduction

De�nitionA language L shu�e-reduces to a language L′ if, given any n in unary,we can compute in PTIME a word Pi having the following property:for any word w of length n, we have w ∈ Li� the shu�e of w and Pi contains a word of L′.

TheoremIf L shu�e-reduces to L′ then:

• CSh(L) reduces in PTIME to CSh(L′)

• CTS(L) reduces in PTIME to CTS(L′)

9/24

Page 66: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Formalizing the reduction

De�nitionA language L shu�e-reduces to a language L′ if, given any n in unary,we can compute in PTIME a word Pi having the following property:for any word w of length n, we have w ∈ Li� the shu�e of w and Pi contains a word of L′.

TheoremIf L shu�e-reduces to L′ then:

• CSh(L) reduces in PTIME to CSh(L′)

• CTS(L) reduces in PTIME to CTS(L′)

9/24

Page 67: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Other hard languages

• The reduction shows hardness for:• (ab+ b)∗ (also simpler argument)• (aa+ bb)∗ with P2i = (ab)i

• u∗ if u contains two di�erent letters

• Conjecture: if F is �nite then CTS(F∗) is NP-hardunless it contains a power of each of its letters

• Idea: reason about consumption rates of letters?• Not even complete for F∗ languages, as (aa+ bb)∗ is NP-hard

10/24

Page 68: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Other hard languages

• The reduction shows hardness for:• (ab+ b)∗ (also simpler argument)• (aa+ bb)∗ with P2i = (ab)i

• u∗ if u contains two di�erent letters

• Conjecture: if F is �nite then CTS(F∗) is NP-hardunless it contains a power of each of its letters

• Idea: reason about consumption rates of letters?• Not even complete for F∗ languages, as (aa+ bb)∗ is NP-hard

10/24

Page 69: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Other hard languages

• The reduction shows hardness for:• (ab+ b)∗ (also simpler argument)• (aa+ bb)∗ with P2i = (ab)i

• u∗ if u contains two di�erent letters

• Conjecture: if F is �nite then CTS(F∗) is NP-hardunless it contains a power of each of its letters

• Idea: reason about consumption rates of letters?

• Not even complete for F∗ languages, as (aa+ bb)∗ is NP-hard

10/24

Page 70: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Other hard languages

• The reduction shows hardness for:• (ab+ b)∗ (also simpler argument)• (aa+ bb)∗ with P2i = (ab)i

• u∗ if u contains two di�erent letters

• Conjecture: if F is �nite then CTS(F∗) is NP-hardunless it contains a power of each of its letters

• Idea: reason about consumption rates of letters?• Not even complete for F∗ languages, as (aa+ bb)∗ is NP-hard

10/24

Page 71: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Results

Page 72: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability for Monomials

• Monomial: language of the form A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• Union of monomials: union of �nitely many such languages

• Example: pattern matching Σ∗ word1 Σ∗ + Σ∗ word2 Σ∗

• Logical interpretation: languages de�nable in Σ2[<]

TheoremFor any union of monomials L, the problem CTS(L) is in NL

11/24

Page 73: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability for Monomials

• Monomial: language of the form A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• Union of monomials: union of �nitely many such languages• Example: pattern matching Σ∗ word1 Σ∗ + Σ∗ word2 Σ∗

• Logical interpretation: languages de�nable in Σ2[<]

TheoremFor any union of monomials L, the problem CTS(L) is in NL

11/24

Page 74: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability for Monomials

• Monomial: language of the form A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• Union of monomials: union of �nitely many such languages• Example: pattern matching Σ∗ word1 Σ∗ + Σ∗ word2 Σ∗

• Logical interpretation: languages de�nable in Σ2[<]

TheoremFor any union of monomials L, the problem CTS(L) is in NL

11/24

Page 75: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability for Monomials

• Monomial: language of the form A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• Union of monomials: union of �nitely many such languages• Example: pattern matching Σ∗ word1 Σ∗ + Σ∗ word2 Σ∗

• Logical interpretation: languages de�nable in Σ2[<]

TheoremFor any union of monomials L, the problem CTS(L) is in NL

11/24

Page 76: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Idea for Monomials

• Tractable languages are clearly closed under unionso it su�ces to consider a monomial: A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• We can guess the positions of the individual ai• Check that the other vertices can �t in the A∗i (uses NL = co-NL)

• Check that the descendants of an are all in An+1• Find the vertices that must be enumerated before an

• The ancestors of the ai• The ancestors of vertices with a letter not in An+1

• Inductively solve the problem for these vertices andA∗1 a1 A∗2 a2 · · · A∗n

12/24

Page 77: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Idea for Monomials

• Tractable languages are clearly closed under unionso it su�ces to consider a monomial: A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• We can guess the positions of the individual ai

• Check that the other vertices can �t in the A∗i (uses NL = co-NL)• Check that the descendants of an are all in An+1• Find the vertices that must be enumerated before an

• The ancestors of the ai• The ancestors of vertices with a letter not in An+1

• Inductively solve the problem for these vertices andA∗1 a1 A∗2 a2 · · · A∗n

12/24

Page 78: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Idea for Monomials

• Tractable languages are clearly closed under unionso it su�ces to consider a monomial: A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• We can guess the positions of the individual ai• Check that the other vertices can �t in the A∗i (uses NL = co-NL)

• Check that the descendants of an are all in An+1• Find the vertices that must be enumerated before an

• The ancestors of the ai• The ancestors of vertices with a letter not in An+1

• Inductively solve the problem for these vertices andA∗1 a1 A∗2 a2 · · · A∗n

12/24

Page 79: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Idea for Monomials

• Tractable languages are clearly closed under unionso it su�ces to consider a monomial: A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• We can guess the positions of the individual ai• Check that the other vertices can �t in the A∗i (uses NL = co-NL)

• Check that the descendants of an are all in An+1

• Find the vertices that must be enumerated before an• The ancestors of the ai• The ancestors of vertices with a letter not in An+1

• Inductively solve the problem for these vertices andA∗1 a1 A∗2 a2 · · · A∗n

12/24

Page 80: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Idea for Monomials

• Tractable languages are clearly closed under unionso it su�ces to consider a monomial: A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• We can guess the positions of the individual ai• Check that the other vertices can �t in the A∗i (uses NL = co-NL)

• Check that the descendants of an are all in An+1• Find the vertices that must be enumerated before an

• The ancestors of the ai• The ancestors of vertices with a letter not in An+1

• Inductively solve the problem for these vertices andA∗1 a1 A∗2 a2 · · · A∗n

12/24

Page 81: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Idea for Monomials

• Tractable languages are clearly closed under unionso it su�ces to consider a monomial: A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• We can guess the positions of the individual ai• Check that the other vertices can �t in the A∗i (uses NL = co-NL)

• Check that the descendants of an are all in An+1• Find the vertices that must be enumerated before an

• The ancestors of the ai

• The ancestors of vertices with a letter not in An+1• Inductively solve the problem for these vertices andA∗1 a1 A∗2 a2 · · · A∗n

12/24

Page 82: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Idea for Monomials

• Tractable languages are clearly closed under unionso it su�ces to consider a monomial: A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• We can guess the positions of the individual ai• Check that the other vertices can �t in the A∗i (uses NL = co-NL)

• Check that the descendants of an are all in An+1• Find the vertices that must be enumerated before an

• The ancestors of the ai• The ancestors of vertices with a letter not in An+1

• Inductively solve the problem for these vertices andA∗1 a1 A∗2 a2 · · · A∗n

12/24

Page 83: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Idea for Monomials

• Tractable languages are clearly closed under unionso it su�ces to consider a monomial: A∗1 a1 A∗2 a2 · · · A∗n an A∗n+1where a1, . . . ,an ∈ Σ and A1, . . . ,An+1 ⊆ Σ

• We can guess the positions of the individual ai• Check that the other vertices can �t in the A∗i (uses NL = co-NL)

• Check that the descendants of an are all in An+1• Find the vertices that must be enumerated before an

• The ancestors of the ai• The ancestors of vertices with a letter not in An+1

• Inductively solve the problem for these vertices andA∗1 a1 A∗2 a2 · · · A∗n

12/24

Page 84: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The Algebraic Approach

Fails

Can we just study algebraically the tractable languages?

Not really...

• Not closed under intersection• Not closed under complement• Not closed under inverse morphism• Not closed under concatenation(not in paper, only known for CTS)

• For CSh: not closed under quotient

13/24

Page 85: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The Algebraic Approach Fails

Can we just study algebraically the tractable languages? Not really...

• Not closed under intersection• Not closed under complement• Not closed under inverse morphism• Not closed under concatenation(not in paper, only known for CTS)

• For CSh: not closed under quotient

13/24

Page 86: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

The Algebraic Approach Fails

Can we just study algebraically the tractable languages? Not really...

• Not closed under intersection• Not closed under complement• Not closed under inverse morphism• Not closed under concatenation(not in paper, only known for CTS)

• For CSh: not closed under quotient

13/24

Page 87: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Side Remark: CTS and CSh are Di�erent

Consider the language L = bΣ∗ + aaΣ∗ + (ab)∗

• CTS(L) is NP-hard because (ab)−1L = (ab)∗

• CSh(L) is in NL: trivial if there is more than one word

Hence, some languages are tractable for CSh and hard for CTS

14/24

Page 88: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Side Remark: CTS and CSh are Di�erent

Consider the language L = bΣ∗ + aaΣ∗ + (ab)∗

• CTS(L) is NP-hard because (ab)−1L = (ab)∗

• CSh(L) is in NL: trivial if there is more than one word

Hence, some languages are tractable for CSh and hard for CTS

14/24

Page 89: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Side Remark: CTS and CSh are Di�erent

Consider the language L = bΣ∗ + aaΣ∗ + (ab)∗

• CTS(L) is NP-hard because (ab)−1L = (ab)∗

• CSh(L) is in NL: trivial if there is more than one word

Hence, some languages are tractable for CSh and hard for CTS

14/24

Page 90: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Side Remark: CTS and CSh are Di�erent

Consider the language L = bΣ∗ + aaΣ∗ + (ab)∗

• CTS(L) is NP-hard because (ab)−1L = (ab)∗

• CSh(L) is in NL: trivial if there is more than one word

Hence, some languages are tractable for CSh and hard for CTS

14/24

Page 91: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width

• CSh(L) is in NL for any regular language L if we assume thatthere are at most k input words w1, . . . ,wk for a constant k ∈ N

→ Need k counters to remember the current position in each word,plus automaton state

• CTS(L) is in in NL for any regular language L ifthe input DAG G has width ≤ k for constant k ∈ N

• Width: size of the largest antichain(subset of pairwise incomparable vertices)

→ Partition G in k chains (Dilworth’s theorem),and conclude by NL algorithm

a

b a b

b a

→ These results are making an additional assumption, but...

15/24

Page 92: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width

• CSh(L) is in NL for any regular language L if we assume thatthere are at most k input words w1, . . . ,wk for a constant k ∈ N→ Need k counters to remember the current position in each word,

plus automaton state

• CTS(L) is in in NL for any regular language L ifthe input DAG G has width ≤ k for constant k ∈ N

• Width: size of the largest antichain(subset of pairwise incomparable vertices)

→ Partition G in k chains (Dilworth’s theorem),and conclude by NL algorithm

a

b a b

b a

→ These results are making an additional assumption, but...

15/24

Page 93: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width

• CSh(L) is in NL for any regular language L if we assume thatthere are at most k input words w1, . . . ,wk for a constant k ∈ N→ Need k counters to remember the current position in each word,

plus automaton state

• CTS(L) is in in NL for any regular language L ifthe input DAG G has width ≤ k for constant k ∈ N

• Width: size of the largest antichain(subset of pairwise incomparable vertices)

→ Partition G in k chains (Dilworth’s theorem),and conclude by NL algorithm

a

b a b

b a

→ These results are making an additional assumption, but...

15/24

Page 94: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width

• CSh(L) is in NL for any regular language L if we assume thatthere are at most k input words w1, . . . ,wk for a constant k ∈ N→ Need k counters to remember the current position in each word,

plus automaton state

• CTS(L) is in in NL for any regular language L ifthe input DAG G has width ≤ k for constant k ∈ N

• Width: size of the largest antichain(subset of pairwise incomparable vertices)

→ Partition G in k chains (Dilworth’s theorem),and conclude by NL algorithm

a

b a b

b a

→ These results are making an additional assumption, but...

15/24

Page 95: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width

• CSh(L) is in NL for any regular language L if we assume thatthere are at most k input words w1, . . . ,wk for a constant k ∈ N→ Need k counters to remember the current position in each word,

plus automaton state

• CTS(L) is in in NL for any regular language L ifthe input DAG G has width ≤ k for constant k ∈ N

• Width: size of the largest antichain(subset of pairwise incomparable vertices)

→ Partition G in k chains (Dilworth’s theorem),and conclude by NL algorithm

a

b a b

b a

→ These results are making an additional assumption, but...

15/24

Page 96: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width

• CSh(L) is in NL for any regular language L if we assume thatthere are at most k input words w1, . . . ,wk for a constant k ∈ N→ Need k counters to remember the current position in each word,

plus automaton state

• CTS(L) is in in NL for any regular language L ifthe input DAG G has width ≤ k for constant k ∈ N

• Width: size of the largest antichain(subset of pairwise incomparable vertices)

→ Partition G in k chains (Dilworth’s theorem),and conclude by NL algorithm

a

b a b

b a

→ These results are making an additional assumption, but...

15/24

Page 97: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width

• CSh(L) is in NL for any regular language L if we assume thatthere are at most k input words w1, . . . ,wk for a constant k ∈ N→ Need k counters to remember the current position in each word,

plus automaton state

• CTS(L) is in in NL for any regular language L ifthe input DAG G has width ≤ k for constant k ∈ N

• Width: size of the largest antichain(subset of pairwise incomparable vertices)

→ Partition G in k chains (Dilworth’s theorem),and conclude by NL algorithm

a

b a b

b a

→ These results are making an additional assumption, but...

15/24

Page 98: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width

• CSh(L) is in NL for any regular language L if we assume thatthere are at most k input words w1, . . . ,wk for a constant k ∈ N→ Need k counters to remember the current position in each word,

plus automaton state

• CTS(L) is in in NL for any regular language L ifthe input DAG G has width ≤ k for constant k ∈ N

• Width: size of the largest antichain(subset of pairwise incomparable vertices)

→ Partition G in k chains (Dilworth’s theorem),and conclude by NL algorithm

a

b a b

b a

→ These results are making an additional assumption, but...

15/24

Page 99: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width

• CSh(L) is in NL for any regular language L if we assume thatthere are at most k input words w1, . . . ,wk for a constant k ∈ N→ Need k counters to remember the current position in each word,

plus automaton state

• CTS(L) is in in NL for any regular language L ifthe input DAG G has width ≤ k for constant k ∈ N

• Width: size of the largest antichain(subset of pairwise incomparable vertices)

→ Partition G in k chains (Dilworth’s theorem),and conclude by NL algorithm

a

b a b

b a

→ These results are making an additional assumption, but...15/24

Page 100: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width (2)

• Fix Σ = {a,b}, take any regular language L and constant k ∈ N,we know that CTS is in NL for L+ Σ∗(ak + bk)Σ∗

• If the input DAG has width < 2k, use the result for bounded width• Otherwise we can achieve ak or bk with a large antichain

• A similar technique shows that (ab)∗ + Σ∗aaΣ∗ is tractable

→ Does it su�ce to bound the width of all letters but one?→ Unknown for L+ Σ∗akΣ∗ with arbitrary L and k > 2!

16/24

Page 101: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width (2)

• Fix Σ = {a,b}, take any regular language L and constant k ∈ N,we know that CTS is in NL for L+ Σ∗(ak + bk)Σ∗

• If the input DAG has width < 2k, use the result for bounded width

• Otherwise we can achieve ak or bk with a large antichain

• A similar technique shows that (ab)∗ + Σ∗aaΣ∗ is tractable

→ Does it su�ce to bound the width of all letters but one?→ Unknown for L+ Σ∗akΣ∗ with arbitrary L and k > 2!

16/24

Page 102: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width (2)

• Fix Σ = {a,b}, take any regular language L and constant k ∈ N,we know that CTS is in NL for L+ Σ∗(ak + bk)Σ∗

• If the input DAG has width < 2k, use the result for bounded width• Otherwise we can achieve ak or bk with a large antichain

• A similar technique shows that (ab)∗ + Σ∗aaΣ∗ is tractable

→ Does it su�ce to bound the width of all letters but one?→ Unknown for L+ Σ∗akΣ∗ with arbitrary L and k > 2!

16/24

Page 103: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width (2)

• Fix Σ = {a,b}, take any regular language L and constant k ∈ N,we know that CTS is in NL for L+ Σ∗(ak + bk)Σ∗

• If the input DAG has width < 2k, use the result for bounded width• Otherwise we can achieve ak or bk with a large antichain

• A similar technique shows that (ab)∗ + Σ∗aaΣ∗ is tractable

→ Does it su�ce to bound the width of all letters but one?

→ Unknown for L+ Σ∗akΣ∗ with arbitrary L and k > 2!

16/24

Page 104: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on Width (2)

• Fix Σ = {a,b}, take any regular language L and constant k ∈ N,we know that CTS is in NL for L+ Σ∗(ak + bk)Σ∗

• If the input DAG has width < 2k, use the result for bounded width• Otherwise we can achieve ak or bk with a large antichain

• A similar technique shows that (ab)∗ + Σ∗aaΣ∗ is tractable

→ Does it su�ce to bound the width of all letters but one?→ Unknown for L+ Σ∗akΣ∗ with arbitrary L and k > 2!

16/24

Page 105: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

An Annoying Open Problem

a

a

a

a

b

bb

b

b

• Fix the alphabet Σ = {a,b}

• Assume that the input DAG has a-width 1, i.e.,there is a total order on the a-labeled elements

• Easy greedy PTIME algorithm for CTS((ab)∗):• If we want an a, take the next one (no choice)• If we want a b, take an available b-vertexwhose �rst a-descendant is as high as possible(idea: consume the most blocking b’s)

• Should generalizes to CTS(L) for any L... right?!

Open problemFix Σ = {a,b} and an arbitrary regular language L. Given a DAGwithout two incomparable a’s, can you solve CTS(L)?

17/24

Page 106: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

An Annoying Open Problem

a

a

a

a

b

bb

b

b

• Fix the alphabet Σ = {a,b}

• Assume that the input DAG has a-width 1, i.e.,there is a total order on the a-labeled elements

• Easy greedy PTIME algorithm for CTS((ab)∗):• If we want an a, take the next one (no choice)• If we want a b, take an available b-vertexwhose �rst a-descendant is as high as possible(idea: consume the most blocking b’s)

• Should generalizes to CTS(L) for any L... right?!

Open problemFix Σ = {a,b} and an arbitrary regular language L. Given a DAGwithout two incomparable a’s, can you solve CTS(L)?

17/24

Page 107: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

An Annoying Open Problem

a

a

a

a

b

bb

b

b

• Fix the alphabet Σ = {a,b}

• Assume that the input DAG has a-width 1, i.e.,there is a total order on the a-labeled elements

• Easy greedy PTIME algorithm for CTS((ab)∗):• If we want an a, take the next one (no choice)• If we want a b, take an available b-vertexwhose �rst a-descendant is as high as possible(idea: consume the most blocking b’s)

• Should generalizes to CTS(L) for any L... right?!

Open problemFix Σ = {a,b} and an arbitrary regular language L. Given a DAGwithout two incomparable a’s, can you solve CTS(L)?

17/24

Page 108: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

An Annoying Open Problem

a

a

a

a

b

bb

b

b

• Fix the alphabet Σ = {a,b}

• Assume that the input DAG has a-width 1, i.e.,there is a total order on the a-labeled elements

• Easy greedy PTIME algorithm for CTS((ab)∗):

• If we want an a, take the next one (no choice)• If we want a b, take an available b-vertexwhose �rst a-descendant is as high as possible(idea: consume the most blocking b’s)

• Should generalizes to CTS(L) for any L... right?!

Open problemFix Σ = {a,b} and an arbitrary regular language L. Given a DAGwithout two incomparable a’s, can you solve CTS(L)?

17/24

Page 109: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

An Annoying Open Problem

a

a

a

a

b

bb

b

b

• Fix the alphabet Σ = {a,b}

• Assume that the input DAG has a-width 1, i.e.,there is a total order on the a-labeled elements

• Easy greedy PTIME algorithm for CTS((ab)∗):• If we want an a, take the next one (no choice)

• If we want a b, take an available b-vertexwhose �rst a-descendant is as high as possible(idea: consume the most blocking b’s)

• Should generalizes to CTS(L) for any L... right?!

Open problemFix Σ = {a,b} and an arbitrary regular language L. Given a DAGwithout two incomparable a’s, can you solve CTS(L)?

17/24

Page 110: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

An Annoying Open Problem

a

a

a

a

b

bb

b

b

• Fix the alphabet Σ = {a,b}

• Assume that the input DAG has a-width 1, i.e.,there is a total order on the a-labeled elements

• Easy greedy PTIME algorithm for CTS((ab)∗):• If we want an a, take the next one (no choice)• If we want a b, take an available b-vertexwhose �rst a-descendant is as high as possible(idea: consume the most blocking b’s)

• Should generalizes to CTS(L) for any L... right?!

Open problemFix Σ = {a,b} and an arbitrary regular language L. Given a DAGwithout two incomparable a’s, can you solve CTS(L)?

17/24

Page 111: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

An Annoying Open Problem

a

a

a

a

b

bb

b

b

• Fix the alphabet Σ = {a,b}

• Assume that the input DAG has a-width 1, i.e.,there is a total order on the a-labeled elements

• Easy greedy PTIME algorithm for CTS((ab)∗):• If we want an a, take the next one (no choice)• If we want a b, take an available b-vertexwhose �rst a-descendant is as high as possible(idea: consume the most blocking b’s)

• Should generalizes to CTS(L) for any L...

right?!

Open problemFix Σ = {a,b} and an arbitrary regular language L. Given a DAGwithout two incomparable a’s, can you solve CTS(L)?

17/24

Page 112: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

An Annoying Open Problem

a

a

a

a

b

bb

b

b

• Fix the alphabet Σ = {a,b}

• Assume that the input DAG has a-width 1, i.e.,there is a total order on the a-labeled elements

• Easy greedy PTIME algorithm for CTS((ab)∗):• If we want an a, take the next one (no choice)• If we want a b, take an available b-vertexwhose �rst a-descendant is as high as possible(idea: consume the most blocking b’s)

• Should generalizes to CTS(L) for any L... right?!

Open problemFix Σ = {a,b} and an arbitrary regular language L. Given a DAGwithout two incomparable a’s, can you solve CTS(L)?

17/24

Page 113: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

An Annoying Open Problem

a

a

a

a

b

bb

b

b

• Fix the alphabet Σ = {a,b}

• Assume that the input DAG has a-width 1, i.e.,there is a total order on the a-labeled elements

• Easy greedy PTIME algorithm for CTS((ab)∗):• If we want an a, take the next one (no choice)• If we want a b, take an available b-vertexwhose �rst a-descendant is as high as possible(idea: consume the most blocking b’s)

• Should generalizes to CTS(L) for any L... right?!

Open problemFix Σ = {a,b} and an arbitrary regular language L. Given a DAGwithout two incomparable a’s, can you solve CTS(L)?

17/24

Page 114: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on the Structure of Groups

• Group language: the underlying monoid is a �nite group→ Automata where each letter acts bijectively

• District group monomial: language G1 a1 · · · Gn an Gn+1where a1, . . . ,an ∈ Σ and G1, . . . ,Gn are group languageson subsets of the alphabet Σ

TheoremFor any union L of district group monomials, CSh(L) is in NL

→ Only for CSh; complexity for CTS is unknown!

18/24

Page 115: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on the Structure of Groups

• Group language: the underlying monoid is a �nite group→ Automata where each letter acts bijectively

• District group monomial: language G1 a1 · · · Gn an Gn+1where a1, . . . ,an ∈ Σ and G1, . . . ,Gn are group languageson subsets of the alphabet Σ

TheoremFor any union L of district group monomials, CSh(L) is in NL

→ Only for CSh; complexity for CTS is unknown!

18/24

Page 116: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on the Structure of Groups

• Group language: the underlying monoid is a �nite group→ Automata where each letter acts bijectively

• District group monomial: language G1 a1 · · · Gn an Gn+1where a1, . . . ,an ∈ Σ and G1, . . . ,Gn are group languageson subsets of the alphabet Σ

TheoremFor any union L of district group monomials, CSh(L) is in NL

→ Only for CSh; complexity for CTS is unknown!

18/24

Page 117: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on the Structure of Groups

• Group language: the underlying monoid is a �nite group→ Automata where each letter acts bijectively

• District group monomial: language G1 a1 · · · Gn an Gn+1where a1, . . . ,an ∈ Σ and G1, . . . ,Gn are group languageson subsets of the alphabet Σ

TheoremFor any union L of district group monomials, CSh(L) is in NL

→ Only for CSh; complexity for CTS is unknown!

18/24

Page 118: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Structure for Groups

• By far the most technical proof of the paper

• From district group monomials to group languages:• Guess the vertices where the ai are mapped• Guess (in succession) how each input word is split

• For groups: distinguish the rare and frequent letters of Σ• Rare letters are in constantly many strings: NL algorithm on them• Frequent letters are in enough strings to generate anything→ Key (CSh): �nd an antichain with all frequent letters many times

• Two main challenges:• Even on frequent letters, we can only achieve all group elementsup to commutative information→ E.g., in a group G× (Z/2Z) with generators of the form (gi, 1),

a large odd number of generators will never achieve (g,0)

→ Antichain lemma: Constantly many elements su�ce to achieveanything in the spanned subgroup up to “commutative information”

• When doing the NL algorithm on rare letters, constant bound onthe number of frequent letter insertions

19/24

Page 119: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Structure for Groups

• By far the most technical proof of the paper• From district group monomials to group languages:• Guess the vertices where the ai are mapped• Guess (in succession) how each input word is split

• For groups: distinguish the rare and frequent letters of Σ• Rare letters are in constantly many strings: NL algorithm on them• Frequent letters are in enough strings to generate anything→ Key (CSh): �nd an antichain with all frequent letters many times

• Two main challenges:• Even on frequent letters, we can only achieve all group elementsup to commutative information→ E.g., in a group G× (Z/2Z) with generators of the form (gi, 1),

a large odd number of generators will never achieve (g,0)

→ Antichain lemma: Constantly many elements su�ce to achieveanything in the spanned subgroup up to “commutative information”

• When doing the NL algorithm on rare letters, constant bound onthe number of frequent letter insertions

19/24

Page 120: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Structure for Groups

• By far the most technical proof of the paper• From district group monomials to group languages:• Guess the vertices where the ai are mapped• Guess (in succession) how each input word is split

• For groups: distinguish the rare and frequent letters of Σ

• Rare letters are in constantly many strings: NL algorithm on them• Frequent letters are in enough strings to generate anything→ Key (CSh): �nd an antichain with all frequent letters many times

• Two main challenges:• Even on frequent letters, we can only achieve all group elementsup to commutative information→ E.g., in a group G× (Z/2Z) with generators of the form (gi, 1),

a large odd number of generators will never achieve (g,0)

→ Antichain lemma: Constantly many elements su�ce to achieveanything in the spanned subgroup up to “commutative information”

• When doing the NL algorithm on rare letters, constant bound onthe number of frequent letter insertions

19/24

Page 121: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Structure for Groups

• By far the most technical proof of the paper• From district group monomials to group languages:• Guess the vertices where the ai are mapped• Guess (in succession) how each input word is split

• For groups: distinguish the rare and frequent letters of Σ• Rare letters are in constantly many strings: NL algorithm on them• Frequent letters are in enough strings to generate anything

→ Key (CSh): �nd an antichain with all frequent letters many times• Two main challenges:

• Even on frequent letters, we can only achieve all group elementsup to commutative information→ E.g., in a group G× (Z/2Z) with generators of the form (gi, 1),

a large odd number of generators will never achieve (g,0)

→ Antichain lemma: Constantly many elements su�ce to achieveanything in the spanned subgroup up to “commutative information”

• When doing the NL algorithm on rare letters, constant bound onthe number of frequent letter insertions

19/24

Page 122: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Structure for Groups

• By far the most technical proof of the paper• From district group monomials to group languages:• Guess the vertices where the ai are mapped• Guess (in succession) how each input word is split

• For groups: distinguish the rare and frequent letters of Σ• Rare letters are in constantly many strings: NL algorithm on them• Frequent letters are in enough strings to generate anything→ Key (CSh): �nd an antichain with all frequent letters many times

• Two main challenges:• Even on frequent letters, we can only achieve all group elementsup to commutative information→ E.g., in a group G× (Z/2Z) with generators of the form (gi, 1),

a large odd number of generators will never achieve (g,0)

→ Antichain lemma: Constantly many elements su�ce to achieveanything in the spanned subgroup up to “commutative information”

• When doing the NL algorithm on rare letters, constant bound onthe number of frequent letter insertions

19/24

Page 123: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Structure for Groups

• By far the most technical proof of the paper• From district group monomials to group languages:• Guess the vertices where the ai are mapped• Guess (in succession) how each input word is split

• For groups: distinguish the rare and frequent letters of Σ• Rare letters are in constantly many strings: NL algorithm on them• Frequent letters are in enough strings to generate anything→ Key (CSh): �nd an antichain with all frequent letters many times

• Two main challenges:• Even on frequent letters, we can only achieve all group elementsup to commutative information→ E.g., in a group G× (Z/2Z) with generators of the form (gi, 1),

a large odd number of generators will never achieve (g,0)

→ Antichain lemma: Constantly many elements su�ce to achieveanything in the spanned subgroup up to “commutative information”

• When doing the NL algorithm on rare letters, constant bound onthe number of frequent letter insertions

19/24

Page 124: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Structure for Groups

• By far the most technical proof of the paper• From district group monomials to group languages:• Guess the vertices where the ai are mapped• Guess (in succession) how each input word is split

• For groups: distinguish the rare and frequent letters of Σ• Rare letters are in constantly many strings: NL algorithm on them• Frequent letters are in enough strings to generate anything→ Key (CSh): �nd an antichain with all frequent letters many times

• Two main challenges:• Even on frequent letters, we can only achieve all group elementsup to commutative information→ E.g., in a group G× (Z/2Z) with generators of the form (gi, 1),

a large odd number of generators will never achieve (g,0)

→ Antichain lemma: Constantly many elements su�ce to achieveanything in the spanned subgroup up to “commutative information”

• When doing the NL algorithm on rare letters, constant bound onthe number of frequent letter insertions

19/24

Page 125: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Proof Structure for Groups

• By far the most technical proof of the paper• From district group monomials to group languages:• Guess the vertices where the ai are mapped• Guess (in succession) how each input word is split

• For groups: distinguish the rare and frequent letters of Σ• Rare letters are in constantly many strings: NL algorithm on them• Frequent letters are in enough strings to generate anything→ Key (CSh): �nd an antichain with all frequent letters many times

• Two main challenges:• Even on frequent letters, we can only achieve all group elementsup to commutative information→ E.g., in a group G× (Z/2Z) with generators of the form (gi, 1),

a large odd number of generators will never achieve (g,0)

→ Antichain lemma: Constantly many elements su�ce to achieveanything in the spanned subgroup up to “commutative information”

• When doing the NL algorithm on rare letters, constant bound onthe number of frequent letter insertions 19/24

Page 126: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on All Sorts of Strange Reasons

• (aa+ b)∗ is in NL for CSh:

• Ad-hoc greedy algorithm: consume string with most odd a blocks• Complexity open for CTS!• Complexity open for (ak + b)∗ for k > 2!• What about similar languages like (aa+ bb+ ab)∗?

• (caa)∗d(cbb)∗dΣ∗ + Σ∗ccΣ∗ is in NL for CSh but NP-hard for CTS• Tractability argument: another ad hoc greedy algorithm• Hardness argument: from k-clique encoded to a bipartite graph

20/24

Page 127: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on All Sorts of Strange Reasons

• (aa+ b)∗ is in NL for CSh:• Ad-hoc greedy algorithm: consume string with most odd a blocks

• Complexity open for CTS!• Complexity open for (ak + b)∗ for k > 2!• What about similar languages like (aa+ bb+ ab)∗?

• (caa)∗d(cbb)∗dΣ∗ + Σ∗ccΣ∗ is in NL for CSh but NP-hard for CTS• Tractability argument: another ad hoc greedy algorithm• Hardness argument: from k-clique encoded to a bipartite graph

20/24

Page 128: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on All Sorts of Strange Reasons

• (aa+ b)∗ is in NL for CSh:• Ad-hoc greedy algorithm: consume string with most odd a blocks• Complexity open for CTS!

• Complexity open for (ak + b)∗ for k > 2!• What about similar languages like (aa+ bb+ ab)∗?

• (caa)∗d(cbb)∗dΣ∗ + Σ∗ccΣ∗ is in NL for CSh but NP-hard for CTS• Tractability argument: another ad hoc greedy algorithm• Hardness argument: from k-clique encoded to a bipartite graph

20/24

Page 129: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on All Sorts of Strange Reasons

• (aa+ b)∗ is in NL for CSh:• Ad-hoc greedy algorithm: consume string with most odd a blocks• Complexity open for CTS!• Complexity open for (ak + b)∗ for k > 2!

• What about similar languages like (aa+ bb+ ab)∗?

• (caa)∗d(cbb)∗dΣ∗ + Σ∗ccΣ∗ is in NL for CSh but NP-hard for CTS• Tractability argument: another ad hoc greedy algorithm• Hardness argument: from k-clique encoded to a bipartite graph

20/24

Page 130: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on All Sorts of Strange Reasons

• (aa+ b)∗ is in NL for CSh:• Ad-hoc greedy algorithm: consume string with most odd a blocks• Complexity open for CTS!• Complexity open for (ak + b)∗ for k > 2!• What about similar languages like (aa+ bb+ ab)∗?

• (caa)∗d(cbb)∗dΣ∗ + Σ∗ccΣ∗ is in NL for CSh but NP-hard for CTS• Tractability argument: another ad hoc greedy algorithm• Hardness argument: from k-clique encoded to a bipartite graph

20/24

Page 131: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Tractability Based on All Sorts of Strange Reasons

• (aa+ b)∗ is in NL for CSh:• Ad-hoc greedy algorithm: consume string with most odd a blocks• Complexity open for CTS!• Complexity open for (ak + b)∗ for k > 2!• What about similar languages like (aa+ bb+ ab)∗?

• (caa)∗d(cbb)∗dΣ∗ + Σ∗ccΣ∗ is in NL for CSh but NP-hard for CTS• Tractability argument: another ad hoc greedy algorithm• Hardness argument: from k-clique encoded to a bipartite graph

20/24

Page 132: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy

Page 133: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Prelude to the Kind of Dichotomy

• We were aiming for a dichotomy, but...

• Let’s try to make the problem simpler

• Idea: If we don’t �x a target language but a language “family”then we can hope for a coarser dichotomy

• We can restrict to “families” closed under algebraic operationsand go back to the algebraic approach

21/24

Page 134: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Prelude to the Kind of Dichotomy

• We were aiming for a dichotomy, but...• Let’s try to make the problem simpler

• Idea: If we don’t �x a target language but a language “family”then we can hope for a coarser dichotomy

• We can restrict to “families” closed under algebraic operationsand go back to the algebraic approach

21/24

Page 135: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Prelude to the Kind of Dichotomy

• We were aiming for a dichotomy, but...• Let’s try to make the problem simpler

• Idea: If we don’t �x a target language but a language “family”then we can hope for a coarser dichotomy

• We can restrict to “families” closed under algebraic operationsand go back to the algebraic approach

21/24

Page 136: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy

• Fix a semiautomaton S = (Q,Σ, δ) with Q the set of states,with Σ a �nite alphabet, and with δ the transitions.

• Idea: we will give in the input a speci�cation, i.e.,a set {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• We specify the initial and �nal states (= closure by quotient)• We can toggle the �nal states (= closure by complement)• We will do a conjunction over the (ij, Fj) (= closure by intersection)

• Semiautomaton Constrained topological sort problem CTS(S):• Input:

• a DAG G with vertices labeled by letters of Σ,• a speci�cation of S, i.e., {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• Output: is there a topological sort of G such thatthe sequence of vertex labels is accepted by the automaton(Q,Σ, δ, ij, Fj) for all 1 ≤ j ≤ k

22/24

Page 137: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy

• Fix a semiautomaton S = (Q,Σ, δ) with Q the set of states,with Σ a �nite alphabet, and with δ the transitions.

• Idea: we will give in the input a speci�cation, i.e.,a set {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• We specify the initial and �nal states (= closure by quotient)• We can toggle the �nal states (= closure by complement)• We will do a conjunction over the (ij, Fj) (= closure by intersection)

• Semiautomaton Constrained topological sort problem CTS(S):• Input:

• a DAG G with vertices labeled by letters of Σ,• a speci�cation of S, i.e., {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• Output: is there a topological sort of G such thatthe sequence of vertex labels is accepted by the automaton(Q,Σ, δ, ij, Fj) for all 1 ≤ j ≤ k

22/24

Page 138: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy

• Fix a semiautomaton S = (Q,Σ, δ) with Q the set of states,with Σ a �nite alphabet, and with δ the transitions.

• Idea: we will give in the input a speci�cation, i.e.,a set {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• We specify the initial and �nal states (= closure by quotient)• We can toggle the �nal states (= closure by complement)• We will do a conjunction over the (ij, Fj) (= closure by intersection)

• Semiautomaton Constrained topological sort problem CTS(S):• Input:

• a DAG G with vertices labeled by letters of Σ,• a speci�cation of S, i.e., {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• Output: is there a topological sort of G such thatthe sequence of vertex labels is accepted by the automaton(Q,Σ, δ, ij, Fj) for all 1 ≤ j ≤ k

22/24

Page 139: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy

• Fix a semiautomaton S = (Q,Σ, δ) with Q the set of states,with Σ a �nite alphabet, and with δ the transitions.

• Idea: we will give in the input a speci�cation, i.e.,a set {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• We specify the initial and �nal states (= closure by quotient)

• We can toggle the �nal states (= closure by complement)• We will do a conjunction over the (ij, Fj) (= closure by intersection)

• Semiautomaton Constrained topological sort problem CTS(S):• Input:

• a DAG G with vertices labeled by letters of Σ,• a speci�cation of S, i.e., {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• Output: is there a topological sort of G such thatthe sequence of vertex labels is accepted by the automaton(Q,Σ, δ, ij, Fj) for all 1 ≤ j ≤ k

22/24

Page 140: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy

• Fix a semiautomaton S = (Q,Σ, δ) with Q the set of states,with Σ a �nite alphabet, and with δ the transitions.

• Idea: we will give in the input a speci�cation, i.e.,a set {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• We specify the initial and �nal states (= closure by quotient)• We can toggle the �nal states (= closure by complement)

• We will do a conjunction over the (ij, Fj) (= closure by intersection)

• Semiautomaton Constrained topological sort problem CTS(S):• Input:

• a DAG G with vertices labeled by letters of Σ,• a speci�cation of S, i.e., {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• Output: is there a topological sort of G such thatthe sequence of vertex labels is accepted by the automaton(Q,Σ, δ, ij, Fj) for all 1 ≤ j ≤ k

22/24

Page 141: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy

• Fix a semiautomaton S = (Q,Σ, δ) with Q the set of states,with Σ a �nite alphabet, and with δ the transitions.

• Idea: we will give in the input a speci�cation, i.e.,a set {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• We specify the initial and �nal states (= closure by quotient)• We can toggle the �nal states (= closure by complement)• We will do a conjunction over the (ij, Fj) (= closure by intersection)

• Semiautomaton Constrained topological sort problem CTS(S):• Input:

• a DAG G with vertices labeled by letters of Σ,• a speci�cation of S, i.e., {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• Output: is there a topological sort of G such thatthe sequence of vertex labels is accepted by the automaton(Q,Σ, δ, ij, Fj) for all 1 ≤ j ≤ k

22/24

Page 142: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy

• Fix a semiautomaton S = (Q,Σ, δ) with Q the set of states,with Σ a �nite alphabet, and with δ the transitions.

• Idea: we will give in the input a speci�cation, i.e.,a set {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• We specify the initial and �nal states (= closure by quotient)• We can toggle the �nal states (= closure by complement)• We will do a conjunction over the (ij, Fj) (= closure by intersection)

• Semiautomaton Constrained topological sort problem CTS(S):• Input:

• a DAG G with vertices labeled by letters of Σ,• a speci�cation of S, i.e., {(i1, F1), . . . , (ik, Fk)} with (ij, Fj) ∈ Q× 2Q

• Output: is there a topological sort of G such thatthe sequence of vertex labels is accepted by the automaton(Q,Σ, δ, ij, Fj) for all 1 ≤ j ≤ k

22/24

Page 143: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy (2)

TheoremFor every semiautomaton S, exactly one of the followingholds:

• The transition semigroup of S belongs to ... and CTS(S) is in NL

• The transition semigroup of S is not in ... and CTS(S) is NP-hard

• DA is a classic variety of semigroups• Counterfree is equivalent to being �rst-order de�nable and“not containing any groups”

• DO,DS are much less well understood varieties of semigroups

23/24

Page 144: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy (2)

TheoremFor every counterfree semiautomaton S, exactly one of the followingholds:

• The transition semigroup of S belongs to DA and CTS(S) is in NL

• The transition semigroup of S is not in DA and CTS(S) is NP-hard

• DA is a classic variety of semigroups

• Counterfree is equivalent to being �rst-order de�nable and“not containing any groups”

• DO,DS are much less well understood varieties of semigroups

23/24

Page 145: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy (2)

TheoremFor every counterfree semiautomaton S, exactly one of the followingholds:

• The transition semigroup of S belongs to DA and CTS(S) is in NL

• The transition semigroup of S is not in DA and CTS(S) is NP-hard

• DA is a classic variety of semigroups

• Counterfree is equivalent to being �rst-order de�nable and“not containing any groups”

• DO,DS are much less well understood varieties of semigroups

23/24

Page 146: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy (2)

TheoremFor every counterfree semiautomaton S, exactly one of the followingholds:

• The transition semigroup of S belongs to DA and CTS(S) is in NL

• The transition semigroup of S is not in DA and CTS(S) is NP-hard

• DA is a classic variety of semigroups• Counterfree is equivalent to being �rst-order de�nable and“not containing any groups”

• DO,DS are much less well understood varieties of semigroups

23/24

Page 147: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

A Kind of Dichotomy (2)

TheoremFor every ///////////////counterfree semiautomaton S, exactly one of the followingholds:

• The transition semigroup of S belongs to DO and CSh(S) is in NL

• The transition semigroup of S is not in DS and CSh(S) is NP-hard

• DA is a classic variety of semigroups• Counterfree is equivalent to being �rst-order de�nable and“not containing any groups”

• DO,DS are much less well understood varieties of semigroups23/24

Page 148: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Conclusion

Page 149: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Summary and Future Work

Language CSh (shu�e) CTS (top. sort)

(ab)∗, u∗ with di�erent letters NP-hard NP-hard

Monomials A∗1a1 · · ·A∗nanA∗n+1 in NL in NLGroups, district group monomials in NL

bΣ∗ + aaΣ∗ + (ab)∗ in NL NP-hard

L+ Σ∗(ak + bk)Σ∗ in NL in NL(ab)∗ + Σ∗a2Σ∗ in NL in NLL+ Σ∗akΣ∗

(aa+ bb)∗, (ab+ a)∗ NP-hard NP-hard(aa+ b)∗ in NL(ak + b)∗

Essentially all other languages...

Thanks for your attention!

24/24

Page 150: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Summary and Future Work

Language CSh (shu�e) CTS (top. sort)

(ab)∗, u∗ with di�erent letters NP-hard NP-hard

Monomials A∗1a1 · · ·A∗nanA∗n+1 in NL in NLGroups, district group monomials in NL

bΣ∗ + aaΣ∗ + (ab)∗ in NL NP-hard

L+ Σ∗(ak + bk)Σ∗ in NL in NL(ab)∗ + Σ∗a2Σ∗ in NL in NLL+ Σ∗akΣ∗

(aa+ bb)∗, (ab+ a)∗ NP-hard NP-hard(aa+ b)∗ in NL(ak + b)∗

Essentially all other languages...

Thanks for your attention!

24/24

Page 151: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Summary and Future Work

Language CSh (shu�e) CTS (top. sort)

(ab)∗, u∗ with di�erent letters NP-hard NP-hard

Monomials A∗1a1 · · ·A∗nanA∗n+1 in NL in NLGroups, district group monomials in NL

bΣ∗ + aaΣ∗ + (ab)∗ in NL NP-hard

L+ Σ∗(ak + bk)Σ∗ in NL in NL(ab)∗ + Σ∗a2Σ∗ in NL in NLL+ Σ∗akΣ∗

(aa+ bb)∗, (ab+ a)∗ NP-hard NP-hard(aa+ b)∗ in NL(ak + b)∗

Essentially all other languages...

Thanks for your attention!

24/24

Page 152: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Summary and Future Work

Language CSh (shu�e) CTS (top. sort)

(ab)∗, u∗ with di�erent letters NP-hard NP-hard

Monomials A∗1a1 · · ·A∗nanA∗n+1 in NL in NLGroups, district group monomials in NL

bΣ∗ + aaΣ∗ + (ab)∗ in NL NP-hard

L+ Σ∗(ak + bk)Σ∗ in NL in NL(ab)∗ + Σ∗a2Σ∗ in NL in NLL+ Σ∗akΣ∗

(aa+ bb)∗, (ab+ a)∗ NP-hard NP-hard(aa+ b)∗ in NL(ak + b)∗

Essentially all other languages...

Thanks for your attention!

24/24

Page 153: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Summary and Future Work

Language CSh (shu�e) CTS (top. sort)

(ab)∗, u∗ with di�erent letters NP-hard NP-hard

Monomials A∗1a1 · · ·A∗nanA∗n+1 in NL in NLGroups, district group monomials in NL

bΣ∗ + aaΣ∗ + (ab)∗ in NL NP-hard

L+ Σ∗(ak + bk)Σ∗ in NL in NL(ab)∗ + Σ∗a2Σ∗ in NL in NLL+ Σ∗akΣ∗

(aa+ bb)∗, (ab+ a)∗ NP-hard NP-hard(aa+ b)∗ in NL(ak + b)∗

Essentially all other languages...

Thanks for your attention!

24/24

Page 154: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Summary and Future Work

Language CSh (shu�e) CTS (top. sort)

(ab)∗, u∗ with di�erent letters NP-hard NP-hard

Monomials A∗1a1 · · ·A∗nanA∗n+1 in NL in NLGroups, district group monomials in NL

bΣ∗ + aaΣ∗ + (ab)∗ in NL NP-hard

L+ Σ∗(ak + bk)Σ∗ in NL in NL(ab)∗ + Σ∗a2Σ∗ in NL in NLL+ Σ∗akΣ∗

(aa+ bb)∗, (ab+ a)∗ NP-hard NP-hard(aa+ b)∗ in NL(ak + b)∗

Essentially all other languages...

Thanks for your attention!

24/24

Page 155: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Summary and Future Work

Language CSh (shu�e) CTS (top. sort)

(ab)∗, u∗ with di�erent letters NP-hard NP-hard

Monomials A∗1a1 · · ·A∗nanA∗n+1 in NL in NLGroups, district group monomials in NL

bΣ∗ + aaΣ∗ + (ab)∗ in NL NP-hard

L+ Σ∗(ak + bk)Σ∗ in NL in NL(ab)∗ + Σ∗a2Σ∗ in NL in NLL+ Σ∗akΣ∗

(aa+ bb)∗, (ab+ a)∗ NP-hard NP-hard(aa+ b)∗ in NL(ak + b)∗

Essentially all other languages...

Thanks for your attention!

24/24

Page 156: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Summary and Future Work

Language CSh (shu�e) CTS (top. sort)

(ab)∗, u∗ with di�erent letters NP-hard NP-hard

Monomials A∗1a1 · · ·A∗nanA∗n+1 in NL in NLGroups, district group monomials in NL

bΣ∗ + aaΣ∗ + (ab)∗ in NL NP-hard

L+ Σ∗(ak + bk)Σ∗ in NL in NL(ab)∗ + Σ∗a2Σ∗ in NL in NLL+ Σ∗akΣ∗

(aa+ bb)∗, (ab+ a)∗ NP-hard NP-hard(aa+ b)∗ in NL(ak + b)∗

Essentially all other languages...

Thanks for your attention!

24/24

Page 157: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Summary and Future Work

Language CSh (shu�e) CTS (top. sort)

(ab)∗, u∗ with di�erent letters NP-hard NP-hard

Monomials A∗1a1 · · ·A∗nanA∗n+1 in NL in NLGroups, district group monomials in NL

bΣ∗ + aaΣ∗ + (ab)∗ in NL NP-hard

L+ Σ∗(ak + bk)Σ∗ in NL in NL(ab)∗ + Σ∗a2Σ∗ in NL in NLL+ Σ∗akΣ∗

(aa+ bb)∗, (ab+ a)∗ NP-hard NP-hard(aa+ b)∗ in NL(ak + b)∗

Essentially all other languages...

Thanks for your attention! 24/24

Page 158: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

References

Amarilli, A. and Paperman, C. (2018).Topological Sorting under Regular Constraints.In ICALP.Warmuth, M. K. and Haussler, D. (1984).On the complexity of iterated shu�e.JCSS, 28(3).

Page 159: Topological Sorting under Regular Constraints · Topological Sorting under Regular Constraints Antoine Amarilli1, Charles Paperman2 December 7th, 2018 1Télécom ParisTech 2Université

Image Credits

Super-Dupont (slide 24) : Oui nide iou, Superdupont, Lob & Gotlib,drawn by Neal Adams, Alexis, Al Coutelis, Daniel Goossens, Solé,Gotlib. Fair use.