• Aucun résultat trouvé

Topological Sorting under Regular Constraints

N/A
N/A
Protected

Academic year: 2022

Partager "Topological Sorting under Regular Constraints"

Copied!
159
0
0

Texte intégral

(1)

Topological Sorting under Regular Constraints

Antoine Amarilli1,Charles Paperman2 December 7th, 2018

1Télécom ParisTech

2Université de Lille

(2)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b a b ... inL!

(3)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b a b ... inL!

(4)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b a b ... inL!

(5)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b a b ... inL!

(6)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b a b ... inL!

(7)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a

b a b b a ... not inL!

(8)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b

a b b a ... not inL!

(9)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a

b b a ... not inL!

(10)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b

b a ... not inL!

(11)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b b

a ... not inL!

(12)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b b a

... not inL!

(13)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b b a ... not inL!

(14)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b a b ... inL!

(15)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a

b a b a b ... inL!

(16)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b

a b a b ... inL!

(17)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a

b a b ... inL!

(18)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b

a b ... inL!

(19)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b a

b ... inL!

(20)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b a b

... inL!

(21)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b a b ... inL!

(22)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b a b ... inL!

(23)

Constrained Topological Sorting

Fix analphabet: e.g.,Σ ={a,b}

Fix alanguage: e.g.,L= (ab)

We studyconstrained topological sorting:

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

Output: is there atopological sort that falls inL?

Question:when is this problemtractable?

a

b a b

b a

a b a b a b ... inL!

(24)

Motivation

How wereally ended upstudying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XML XML versioning

Whicha-posteriori motivationdid we invent for the problem?

→Schedulingwith constraints! →Verification forconcurrent code!

→Computational biology! →Blockchain! (joke)

But why do weactually care?

→ Naturalproblem and apparentlynothingwas known about it!

(25)

Motivation

How wereally ended upstudying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XML XML versioning

Whicha-posteriori motivationdid we invent for the problem?

→Schedulingwith constraints! →Verification forconcurrent code!

→Computational biology! →Blockchain! (joke)

But why do weactually care?

→ Naturalproblem and apparentlynothingwas known about it!

(26)

Motivation

How wereally ended upstudying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XML XML versioning

Order-uncertain databases Top-k Aggregate queries

Whicha-posteriori motivationdid we invent for the problem?

→Schedulingwith constraints! →Verification forconcurrent code!

→Computational biology! →Blockchain! (joke)

But why do weactually care?

→ Naturalproblem and apparentlynothingwas known about it!

(27)

Motivation

How wereally ended upstudying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XML XML versioning

Order-uncertain databases Top-k Aggregate queries Possible answers

Whicha-posteriori motivationdid we invent for the problem?

→Schedulingwith constraints! →Verification forconcurrent code!

→Computational biology! →Blockchain! (joke)

But why do weactually care?

→ Naturalproblem and apparentlynothingwas known about it!

(28)

Motivation

How wereally ended upstudying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XML XML versioning

Order-uncertain databases Top-k Aggregate queries Possible answers

DAGs Algebraic language theory?!

Whicha-posteriori motivationdid we invent for the problem?

→Schedulingwith constraints! →Verification forconcurrent code!

→Computational biology! →Blockchain! (joke)

But why do weactually care?

→ Naturalproblem and apparentlynothingwas known about it!

(29)

Motivation

How wereally ended upstudying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XML XML versioning

Order-uncertain databases Top-k Aggregate queries Possible answers

DAGs Algebraic language theory?!

Whicha-posteriori motivationdid we invent for the problem?

→Schedulingwith constraints! →Verification forconcurrent code!

→Computational biology! →Blockchain! (joke)

But why do weactually care?

→ Naturalproblem and apparentlynothingwas known about it!

(30)

Motivation

How wereally ended upstudying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XML XML versioning

Order-uncertain databases Top-k Aggregate queries Possible answers

DAGs Algebraic language theory?!

Whicha-posteriori motivationdid we invent for the problem?

→Schedulingwith constraints! →Verification forconcurrent code!

→Computational biology! →Blockchain! (joke)

But why do weactually care?

→ Naturalproblem and apparentlynothingwas known about it!

(31)

Motivation

How wereally ended upstudying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XML XML versioning

Order-uncertain databases Top-k Aggregate queries Possible answers

DAGs Algebraic language theory?!

Whicha-posteriori motivationdid we invent for the problem?

→Schedulingwith constraints! →Verification forconcurrent code!

→Computational biology! →Blockchain!

(joke)

But why do weactually care?

→ Naturalproblem and apparentlynothingwas known about it!

(32)

Motivation

How wereally ended upstudying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XML XML versioning

Order-uncertain databases Top-k Aggregate queries Possible answers

DAGs Algebraic language theory?!

Whicha-posteriori motivationdid we invent for the problem?

→Schedulingwith constraints! →Verification forconcurrent code!

→Computational biology! →Blockchain! (joke)

But why do weactually care?

→ Naturalproblem and apparentlynothingwas known about it!

(33)

Motivation

How wereally ended upstudying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XML XML versioning

Order-uncertain databases Top-k Aggregate queries Possible answers

DAGs Algebraic language theory?!

Whicha-posteriori motivationdid we invent for the problem?

→Schedulingwith constraints! →Verification forconcurrent code!

→Computational biology! →Blockchain! (joke)

But why do weactually care?

→ Naturalproblem and apparentlynothingwas known about it!

(34)

Motivation

How wereally ended upstudying this problem:

2011 2012 2013 2014 2015 2016 2017 2018

Probabilistic XML XML versioning

Order-uncertain databases Top-k Aggregate queries Possible answers

DAGs Algebraic language theory?!

Whicha-posteriori motivationdid we invent for the problem?

→Schedulingwith constraints! →Verification forconcurrent code!

→Computational biology! →Blockchain! (joke)

(35)

Formal problem statement

Fix aregular languageLon anfinite alphabetΣ

Constrained topological sortproblemCTS(L):

Input:aDAGGwith vertices labeled by letters ofΣ

Output:is there atopological sortofGsuch that the sequence of vertex labels is awordofL

Special case: theconstrained shuffle problemCSh(L):

Input:a set ofwordsw1, . . . ,wnofΣ

Output:is there ashuffleofw1, . . . ,wnwhich is inL

This is likeCTSbut the input DAG is anunion of paths

→ Question:What is thecomplexityofCTS(L)andCSh(L), depending on the fixed languageL?

(36)

Formal problem statement

Fix aregular languageLon anfinite alphabetΣ

Constrained topological sortproblemCTS(L):

Input:aDAGGwith vertices labeled by letters ofΣ

Output:is there atopological sortofGsuch that the sequence of vertex labels is awordofL

a

b a b

b a

Special case: theconstrained shuffle problemCSh(L):

Input:a set ofwordsw1, . . . ,wnofΣ

Output:is there ashuffleofw1, . . . ,wnwhich is inL

This is likeCTSbut the input DAG is anunion of paths

→ Question:What is thecomplexityofCTS(L)andCSh(L), depending on the fixed languageL?

(37)

Formal problem statement

Fix aregular languageLon anfinite alphabetΣ

Constrained topological sortproblemCTS(L):

Input:aDAGGwith vertices labeled by letters ofΣ

Output:is there atopological sortofGsuch that the sequence of vertex labels is awordofL

a

b a b

b a

Special case: theconstrained shuffle problemCSh(L):

Input:a set ofwordsw1, . . . ,wnofΣ

Output:is there ashuffleofw1, . . . ,wnwhich is inL

This is likeCTSbut the input DAG is anunion of paths

→ Question:What is thecomplexityofCTS(L)andCSh(L), depending on the fixed languageL?

(38)

Formal problem statement

Fix aregular languageLon anfinite alphabetΣ

Constrained topological sortproblemCTS(L):

Input:aDAGGwith vertices labeled by letters ofΣ

Output:is there atopological sortofGsuch that the sequence of vertex labels is awordofL

a

b a b

b a

Special case: theconstrained shuffle problemCSh(L):

Input:a set ofwordsw1, . . . ,wnofΣ

Output:is there ashuffleofw1, . . . ,wnwhich is inL

This is likeCTSbut the input DAG is anunion of paths

a a b

b b a

→ Question:What is thecomplexityofCTS(L)andCSh(L), depending on the fixed languageL?

(39)

Formal problem statement

Fix aregular languageLon anfinite alphabetΣ

Constrained topological sortproblemCTS(L):

Input:aDAGGwith vertices labeled by letters ofΣ

Output:is there atopological sortofGsuch that the sequence of vertex labels is awordofL

a

b a b

b a

Special case: theconstrained shuffle problemCSh(L):

Input:a set ofwordsw1, . . . ,wnofΣ

Output:is there ashuffleofw1, . . . ,wnwhich is inL

This is likeCTSbut the input DAG is anunion of paths

a a b

b b a

→ Question:What is thecomplexityofCTS(L)andCSh(L), depending on the fixed languageL?

(40)

Dichotomy

Conjecture

Conjecture

For everyregular language L, exactly one of the following holds:

Lhas [some nice property] andCTS(L)isin NL

Lhas [some nasty property] andCTS(L)isNP-hard

Here’s what we actually know:

CTSandCShareNP-hardfor some languages, including(ab)

They arein NLforsome language families(monomials, groups)

Some languages are tractable forseemingly unrelatedreasons

→ Very mysterious landscape!(to us)

(41)

Dichotomy Conjecture

Conjecture

For everyregular language L, exactly one of the following holds:

Lhas [some nice property] andCTS(L)isin NL

Lhas [some nasty property] andCTS(L)isNP-hard

Here’s what we actually know:

CTSandCShareNP-hardfor some languages, including(ab)

They arein NLforsome language families(monomials, groups)

Some languages are tractable forseemingly unrelatedreasons

→ Very mysterious landscape!(to us)

(42)

Dichotomy Conjecture

Conjecture

For everyregular language L, exactly one of the following holds:

Lhas [some nice property] andCTS(L)isin NL

Lhas [some nasty property] andCTS(L)isNP-hard Here’s what we actually know:

CTSandCShareNP-hardfor some languages, including(ab)

They arein NLforsome language families(monomials, groups)

Some languages are tractable forseemingly unrelatedreasons

→ Very mysterious landscape!(to us)

(43)

Dichotomy Conjecture

Conjecture

For everyregular language L, exactly one of the following holds:

Lhas [some nice property] andCTS(L)isin NL

Lhas [some nasty property] andCTS(L)isNP-hard Here’s what we actually know:

CTSandCShareNP-hardfor some languages, including(ab)

They arein NLforsome language families(monomials, groups)

Some languages are tractable forseemingly unrelatedreasons

→ Very mysterious landscape!(to us)

(44)

Dichotomy Conjecture

Conjecture

For everyregular language L, exactly one of the following holds:

Lhas [some nice property] andCTS(L)isin NL

Lhas [some nasty property] andCTS(L)isNP-hard Here’s what we actually know:

CTSandCShareNP-hardfor some languages, including(ab)

They arein NLforsome language families(monomials, groups)

Some languages are tractable forseemingly unrelatedreasons

→ Very mysterious landscape!(to us)

(45)

Dichotomy Conjecture

Conjecture

For everyregular language L, exactly one of the following holds:

Lhas [some nice property] andCTS(L)isin NL

Lhas [some nasty property] andCTS(L)isNP-hard Here’s what we actually know:

CTSandCShareNP-hardfor some languages, including(ab)

They arein NLforsome language families(monomials, groups)

Some languages are tractable forseemingly unrelatedreasons

→ Very mysterious landscape!(to us)

(46)

Hardness Results

(47)

Existing Hardness Result

... but the target is awordwhich isprovided as input!

→ Does not directly apply for us, because wefixthe target language

(48)

Existing Hardness Result

... but the target is awordwhich isprovided as input!

→ Does not directly apply for us, because wefixthe target language

(49)

Existing Hardness Result

... but the target is awordwhich isprovided as input!

→ Does not directly apply for us, because wefixthe target language

(50)

Hardness for CTS

We can reduce their problem toCShfor thelanguage(aA+bB)

To determine if the shuffle of aab and bbcontains ababb ...

solve theCSh-problem for aab and bband ABABB

→ CSh((aA+bB))isNP-hardand the same holds forCTS

Similar technique:CSh((ab))isNP-hard

Customreduction techniqueto show NP-hardness

(51)

Hardness for CTS

We can reduce their problem toCShfor thelanguage(aA+bB)

To determine if the shuffle of aab and bbcontains ababb ...

solve theCSh-problem for aab and bband ABABB

→ CSh((aA+bB))isNP-hardand the same holds forCTS

Similar technique:CSh((ab))isNP-hard

Customreduction techniqueto show NP-hardness

(52)

Hardness for CTS

We can reduce their problem toCShfor thelanguage(aA+bB)

To determine if the shuffle of aab and bbcontains ababb ...

solve theCSh-problem for aab and bband ABABB

→ CSh((aA+bB))isNP-hardand the same holds forCTS

Similar technique:CSh((ab))isNP-hard

Customreduction techniqueto show NP-hardness

(53)

Hardness for CTS

We can reduce their problem toCShfor thelanguage(aA+bB)

To determine if the shuffle of aab and bbcontains ababb ...

solve theCSh-problem for aab and bband ABABB

→ CSh((aA+bB))isNP-hardand the same holds forCTS

Similar technique:CSh((ab))isNP-hard

Customreduction techniqueto show NP-hardness

(54)

Hardness for CTS

We can reduce their problem toCShfor thelanguage(aA+bB)

To determine if the shuffle of aab and bbcontains ababb ...

solve theCSh-problem for aab and bband ABABB

→ CSh((aA+bB))isNP-hardand the same holds forCTS

Similar technique:CSh((ab))isNP-hard

Customreduction techniqueto show NP-hardness

(55)

The reduction technique

G a

b a b

b a

P b c a c b c a c b c a c

Say we want to solveCTSfor(ab)(NP-hard)

Say we know how to solveCTSfor(abc)

Take aninstanceGfor(ab), with2nvertices

Add thepathP: (bcac)n

A topsort ofGPachieving(abc) gives a topsort ofGachieving(ab)

Conversely, any topsort ofGachieving(ab) extends to a topsort ofG+Pachieving(abc)

Hence,CTS((abc))isNP-hard

(56)

The reduction technique

G a

b a b

b a

P b c a c b c a c b c a c

Say we want to solveCTSfor(ab)(NP-hard)

Say we know how to solveCTSfor(abc)

Take aninstanceGfor(ab), with2nvertices

Add thepathP: (bcac)n

A topsort ofGPachieving(abc) gives a topsort ofGachieving(ab)

Conversely, any topsort ofGachieving(ab) extends to a topsort ofG+Pachieving(abc)

Hence,CTS((abc))isNP-hard

(57)

The reduction technique

G a

b a b

b a

P b c a c b c a c b c a c

Say we want to solveCTSfor(ab)(NP-hard)

Say we know how to solveCTSfor(abc)

Take aninstanceGfor(ab), with2nvertices

Add thepathP: (bcac)n

A topsort ofGPachieving(abc) gives a topsort ofGachieving(ab)

Conversely, any topsort ofGachieving(ab) extends to a topsort ofG+Pachieving(abc)

Hence,CTS((abc))isNP-hard

(58)

The reduction technique G

a

b a b

b a

P b c a c b c a c b c a c

Say we want to solveCTSfor(ab)(NP-hard)

Say we know how to solveCTSfor(abc)

Take aninstanceGfor(ab), with2nvertices

Add thepathP: (bcac)n

A topsort ofGPachieving(abc) gives a topsort ofGachieving(ab)

Conversely, any topsort ofGachieving(ab) extends to a topsort ofG+Pachieving(abc)

Hence,CTS((abc))isNP-hard

(59)

The reduction technique G

a

b a b

b a

P b c a c b c a c b c a c

Say we want to solveCTSfor(ab)(NP-hard)

Say we know how to solveCTSfor(abc)

Take aninstanceGfor(ab), with2nvertices

Add thepathP: (bcac)n

A topsort ofGPachieving(abc) gives a topsort ofGachieving(ab)

Conversely, any topsort ofGachieving(ab) extends to a topsort ofG+Pachieving(abc)

Hence,CTS((abc))isNP-hard

(60)

The reduction technique G

a

b a b

b a

P b c a c b c a c b c

Say we want to solveCTSfor(ab)(NP-hard)

Say we know how to solveCTSfor(abc)

Take aninstanceGfor(ab), with2nvertices

Add thepathP: (bcac)n

A topsort ofGPachieving(abc) gives a topsort ofGachieving(ab)

Conversely, any topsort ofGachieving(ab) extends to a topsort ofG+Pachieving(abc)

Hence,CTS((abc))isNP-hard

(61)

The reduction technique G

a

b a b

b a

P b c a c b c a c b c a c

Say we want to solveCTSfor(ab)(NP-hard)

Say we know how to solveCTSfor(abc)

Take aninstanceGfor(ab), with2nvertices

Add thepathP: (bcac)n

A topsort ofGPachieving(abc) gives a topsort ofGachieving(ab)

Conversely, any topsort ofGachieving(ab) extends to a topsort ofG+Pachieving(abc)

Hence,CTS((abc))isNP-hard

(62)

The reduction technique G

a

b a b

b a

P b c a c b c a c b c

Say we want to solveCTSfor(ab)(NP-hard)

Say we know how to solveCTSfor(abc)

Take aninstanceGfor(ab), with2nvertices

Add thepathP: (bcac)n

A topsort ofGPachieving(abc) gives a topsort ofGachieving(ab)

Conversely, any topsort ofGachieving(ab) extends to a topsort ofG+Pachieving(abc)

Hence,CTS((abc))isNP-hard

(63)

The reduction technique G

a

b a b

b a

P b c a c b c a c b c a c

Say we want to solveCTSfor(ab)(NP-hard)

Say we know how to solveCTSfor(abc)

Take aninstanceGfor(ab), with2nvertices

Add thepathP: (bcac)n

A topsort ofGPachieving(abc) gives a topsort ofGachieving(ab)

Conversely, any topsort ofGachieving(ab) extends to a topsort ofG+Pachieving(abc)

Hence,CTS((abc))isNP-hard

(64)

Formalizing the reduction

Definition

A languageLshuffle-reducesto a languageL0 if, given anynin unary, we can compute in PTIME a wordPi having the following property:

for any wordwof lengthn, we havewL iff the shuffle ofwandPi contains a word ofL0.

Theorem

IfLshuffle-reduces toL0 then:

CSh(L)reduces in PTIME toCSh(L0)

CTS(L)reduces in PTIME toCTS(L0)

(65)

Formalizing the reduction

Definition

A languageLshuffle-reducesto a languageL0 if, given anynin unary, we can compute in PTIME a wordPi having the following property:

for any wordwof lengthn, we havewL iff the shuffle ofwandPi contains a word ofL0.

Theorem

IfLshuffle-reduces toL0 then:

CSh(L)reduces in PTIME toCSh(L0)

CTS(L)reduces in PTIME toCTS(L0)

(66)

Formalizing the reduction

Definition

A languageLshuffle-reducesto a languageL0 if, given anynin unary, we can compute in PTIME a wordPi having the following property:

for any wordwof lengthn, we havewL iff the shuffle ofwandPi contains a word ofL0.

Theorem

IfLshuffle-reduces toL0 then:

CSh(L)reduces in PTIME toCSh(L0)

CTS(L)reduces in PTIME toCTS(L0)

(67)

Other hard languages

The reduction showshardnessfor:

(ab+b)(also simpler argument)

(aa+bb)withP2i= (ab)i

uifucontains two different letters

Conjecture:ifFis finite thenCTS(F)isNP-hard unless it contains a power of each of its letters

• Idea: reason aboutconsumption ratesof letters?

• Not evencompleteforFlanguages, as(aa+bb)isNP-hard

(68)

Other hard languages

The reduction showshardnessfor:

(ab+b)(also simpler argument)

(aa+bb)withP2i= (ab)i

uifucontains two different letters

Conjecture:ifFis finite thenCTS(F)isNP-hard unless it contains a power of each of its letters

• Idea: reason aboutconsumption ratesof letters?

• Not evencompleteforFlanguages, as(aa+bb)isNP-hard

(69)

Other hard languages

The reduction showshardnessfor:

(ab+b)(also simpler argument)

(aa+bb)withP2i= (ab)i

uifucontains two different letters

Conjecture:ifFis finite thenCTS(F)isNP-hard unless it contains a power of each of its letters

• Idea: reason aboutconsumption ratesof letters?

• Not evencompleteforFlanguages, as(aa+bb)isNP-hard

(70)

Other hard languages

The reduction showshardnessfor:

(ab+b)(also simpler argument)

(aa+bb)withP2i= (ab)i

uifucontains two different letters

Conjecture:ifFis finite thenCTS(F)isNP-hard unless it contains a power of each of its letters

• Idea: reason aboutconsumption ratesof letters?

• Not evencompleteforFlanguages, as(aa+bb)isNP-hard

(71)

Tractability Results

(72)

Tractability for Monomials

Monomial:language of the formA1 a1A2 a2 · · · AnanAn+1 wherea1, . . . ,an∈ΣandA1, . . . ,An+1 ⊆Σ

Union of monomials:union of finitely many such languages

Example:pattern matchingΣword1Σ+ Σword2Σ

Logical interpretation:languages definable inΣ2[<] Theorem

For any union of monomialsL, the problemCTS(L)isin NL

(73)

Tractability for Monomials

Monomial:language of the formA1 a1A2 a2 · · · AnanAn+1 wherea1, . . . ,an∈ΣandA1, . . . ,An+1 ⊆Σ

Union of monomials:union of finitely many such languages

Example:pattern matchingΣword1Σ+ Σword2Σ

Logical interpretation:languages definable inΣ2[<] Theorem

For any union of monomialsL, the problemCTS(L)isin NL

(74)

Tractability for Monomials

Monomial:language of the formA1 a1A2 a2 · · · AnanAn+1 wherea1, . . . ,an∈ΣandA1, . . . ,An+1 ⊆Σ

Union of monomials:union of finitely many such languages

Example:pattern matchingΣword1Σ+ Σword2Σ

Logical interpretation:languages definable inΣ2[<]

Theorem

For any union of monomialsL, the problemCTS(L)isin NL

(75)

Tractability for Monomials

Monomial:language of the formA1 a1A2 a2 · · · AnanAn+1 wherea1, . . . ,an∈ΣandA1, . . . ,An+1 ⊆Σ

Union of monomials:union of finitely many such languages

Example:pattern matchingΣword1Σ+ Σword2Σ

Logical interpretation:languages definable inΣ2[<]

Theorem

For any union of monomialsL, the problemCTS(L)isin NL

(76)

Proof Idea for Monomials

Tractable languages are clearlyclosed under union

so it suffices to consider a monomial:A1 a1A2 a2 · · · AnanAn+1 wherea1, . . . ,an∈ΣandA1, . . . ,An+1 ⊆Σ

We canguessthe positions of the individualai

Check that the other verticescan fitin theAi (uses NL = co-NL)

• Check that thedescendantsofanare all inAn+1

• Find the vertices thatmustbe enumerated beforean

• Theancestorsof theai

• Theancestorsof vertices with a letternot inAn+1

• Inductively solve the problem for these vertices and A1 a1A2 a2 · · · An

(77)

Proof Idea for Monomials

Tractable languages are clearlyclosed under union

so it suffices to consider a monomial:A1 a1A2 a2 · · · AnanAn+1 wherea1, . . . ,an∈ΣandA1, . . . ,An+1 ⊆Σ

We canguessthe positions of the individualai

Check that the other verticescan fitin theAi (uses NL = co-NL)

• Check that thedescendantsofanare all inAn+1

• Find the vertices thatmustbe enumerated beforean

• Theancestorsof theai

• Theancestorsof vertices with a letternot inAn+1

• Inductively solve the problem for these vertices and A1 a1A2 a2 · · · An

(78)

Proof Idea for Monomials

Tractable languages are clearlyclosed under union

so it suffices to consider a monomial:A1 a1A2 a2 · · · AnanAn+1 wherea1, . . . ,an∈ΣandA1, . . . ,An+1 ⊆Σ

We canguessthe positions of the individualai

Check that the other verticescan fitin theAi (uses NL = co-NL)

• Check that thedescendantsofanare all inAn+1

• Find the vertices thatmustbe enumerated beforean

• Theancestorsof theai

• Theancestorsof vertices with a letternot inAn+1

• Inductively solve the problem for these vertices and A1 a1A2 a2 · · · An

Références

Documents relatifs

Ne010Das: On the dieoreteness of the speotrum of nonlinear Sturm-Liou- ville equation of the fourth order (in Russian) Comment. Ne010Das: Fredholm alternative for

Our own proposal is to develop an xml specification of mathematical proof which should be adequate to represent proofs as given by Hardy and Wright ; in a second step, one would have

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

We consider encoding finite automata as least fixed points in a proof- theoretical framework equipped with a general induction scheme, and study au- tomata inclusion in that

We investigate the problem of Gaussian Markov random field selection under a non-analytic constraint: the estimated models must be compatible with a fast inference algorithm, namely

Moreover, the first part of this result can be recovered in the same way as Theorem 0.3, by a Callias-type index formula: we apply the Callias index formula of [2, 5, 17] for

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

However, one difficulty remains: in a topological sort of the rare strings, we can insert elements from the frequent strings at any point in the dynamic algorithm, and the rare