• Aucun résultat trouvé

Uniform Reliability of Self-Join-Free Conjunctive Queries

N/A
N/A
Protected

Academic year: 2022

Partager "Uniform Reliability of Self-Join-Free Conjunctive Queries"

Copied!
68
0
0

Texte intégral

(1)

Uniform Reliability of Self-Join-Free Conjunctive Queries

Antoine Amarilli1, Benny Kimelfeld2 March 23, 2021

1Télécom Paris

2Technion

(2)

Uniform reliability

We study theuniform reliability(UR) problem for relational databases:

Fix aBoolean Conjunctive Query(CQ)Q

Define thecounting problemUR(Q):

Input: a database instanceI

Output:how manysubinstancesofI(subset of facts) satisfyQ Class

Class Room Date CS 1 101 2021-03-26 CS 2 101 2021-04-02

Lockdown Date 2021-03-26 2021-04-02

Consider the query:

Q:∃c r dClass(c,r,d)∧Lockdown(d) The number of subinstances satisfyingQ is: 0+2+2+3=7

We can always solveUR(Q)by looking atall subinstances(exponential)

→ When can we achieve a better complexity?

(3)

Uniform reliability

We study theuniform reliability(UR) problem for relational databases:

Fix aBoolean Conjunctive Query(CQ)Q

Define thecounting problemUR(Q):

Input: a database instanceI

Output:how manysubinstancesofI(subset of facts) satisfyQ Class

Class Room Date CS 1 101 2021-03-26 CS 2 101 2021-04-02

Lockdown Date 2021-03-26 2021-04-02

Consider the query:

Q:∃c r dClass(c,r,d)∧Lockdown(d) The number of subinstances satisfyingQ is: 0+2+2+3=7

We can always solveUR(Q)by looking atall subinstances(exponential)

→ When can we achieve a better complexity?

(4)

Uniform reliability

We study theuniform reliability(UR) problem for relational databases:

Fix aBoolean Conjunctive Query(CQ)Q

Define thecounting problemUR(Q):

Input: a database instanceI

Output:how manysubinstancesofI(subset of facts) satisfyQ

Class Class Room Date CS 1 101 2021-03-26 CS 2 101 2021-04-02

Lockdown Date 2021-03-26 2021-04-02

Consider the query:

Q:∃c r dClass(c,r,d)∧Lockdown(d) The number of subinstances satisfyingQ is: 0+2+2+3=7

We can always solveUR(Q)by looking atall subinstances(exponential)

→ When can we achieve a better complexity?

(5)

Uniform reliability

We study theuniform reliability(UR) problem for relational databases:

Fix aBoolean Conjunctive Query(CQ)Q

Define thecounting problemUR(Q):

Input: a database instanceI

Output:how manysubinstancesofI(subset of facts) satisfyQ Class

Class Room Date CS 1 101 2021-03-26 CS 2 101 2021-04-02

Lockdown Date 2021-03-26 2021-04-02

Consider the query:

Q:∃c r dClass(c,r,d)∧Lockdown(d)

The number of subinstances satisfyingQ is: 0+2+2+3=7

We can always solveUR(Q)by looking atall subinstances(exponential)

→ When can we achieve a better complexity?

(6)

Uniform reliability

We study theuniform reliability(UR) problem for relational databases:

Fix aBoolean Conjunctive Query(CQ)Q

Define thecounting problemUR(Q):

Input: a database instanceI

Output:how manysubinstancesofI(subset of facts) satisfyQ Class

Class Room Date CS 1 101 2021-03-26 CS 2 101 2021-04-02

Lockdown Date 2021-03-26 2021-04-02

Consider the query:

Q:∃c r dClass(c,r,d)∧Lockdown(d) The number of subinstances satisfyingQ is:

0+2+2+3=7

We can always solveUR(Q)by looking atall subinstances(exponential)

→ When can we achieve a better complexity?

(7)

Uniform reliability

We study theuniform reliability(UR) problem for relational databases:

Fix aBoolean Conjunctive Query(CQ)Q

Define thecounting problemUR(Q):

Input: a database instanceI

Output:how manysubinstancesofI(subset of facts) satisfyQ Class

Class Room Date CS 1 101 2021-03-26 CS 2 101 2021-04-02

Lockdown Date 2021-03-26 2021-04-02

Consider the query:

Q:∃c r dClass(c,r,d)∧Lockdown(d) The number of subinstances satisfyingQ is: 0+2+2+3=7

We can always solveUR(Q)by looking atall subinstances(exponential)

→ When can we achieve a better complexity?

(8)

Uniform reliability

We study theuniform reliability(UR) problem for relational databases:

Fix aBoolean Conjunctive Query(CQ)Q

Define thecounting problemUR(Q):

Input: a database instanceI

Output:how manysubinstancesofI(subset of facts) satisfyQ Class

Class Room Date CS 1 101 2021-03-26 CS 2 101 2021-04-02

Lockdown Date 2021-03-26 2021-04-02

Consider the query:

Q:∃c r dClass(c,r,d)∧Lockdown(d) The number of subinstances satisfyingQ is: 0+2+2+3=7

(9)

Motivation and connections

We think that uniform reliability is anatural question

It also connects to other works:

Query explanationsusing measures from computational social choice:

• theShapley value[Livshits et al., 2020]

• thecausal effect[Salimi, 2016]

Probabilistic query evaluationontuple-independent databases[Suciu et al., 2011]

→ Let’s review the line of work onprobabilistic query evaluation

(10)

Motivation and connections

We think that uniform reliability is anatural question

It also connects to other works:

Query explanationsusing measures from computational social choice:

• theShapley value[Livshits et al., 2020]

• thecausal effect[Salimi, 2016]

Probabilistic query evaluationontuple-independent databases[Suciu et al., 2011]

→ Let’s review the line of work onprobabilistic query evaluation

(11)

Motivation and connections

We think that uniform reliability is anatural question

It also connects to other works:

Query explanationsusing measures from computational social choice:

• theShapley value[Livshits et al., 2020]

• thecausal effect[Salimi, 2016]

Probabilistic query evaluationontuple-independent databases[Suciu et al., 2011]

→ Let’s review the line of work onprobabilistic query evaluation

(12)

Motivation and connections

We think that uniform reliability is anatural question

It also connects to other works:

Query explanationsusing measures from computational social choice:

• theShapley value[Livshits et al., 2020]

• thecausal effect[Salimi, 2016]

Probabilistic query evaluationontuple-independent databases[Suciu et al., 2011]

→ Let’s review the line of work onprobabilistic query evaluation

(13)

Motivation and connections

We think that uniform reliability is anatural question

It also connects to other works:

Query explanationsusing measures from computational social choice:

• theShapley value[Livshits et al., 2020]

• thecausal effect[Salimi, 2016]

Probabilistic query evaluationontuple-independent databases[Suciu et al., 2011]

→ Let’s review the line of work onprobabilistic query evaluation

(14)

Uncertain data and tuple-independent databases (TID)

We consider data in therelational modelon which we haveuncertainty

Tuple-independent databases(TID): the simplest probabilistic model Class

Class Room Date

CS 1 101 2021-03-26 80%

CS 2 101 2021-04-02 70%

Lockdown

Date

2021-03-26 20%

2021-04-02 40%

Semantics:

• Every tuple is annotated with aprobability

• We assume that all tuples areindependent

• A TID concisely represents aprobability distributionover thesubinstances

→ Uniform reliabilityamounts to a TID whereall facts have probability 1/2

(15)

Uncertain data and tuple-independent databases (TID)

We consider data in therelational modelon which we haveuncertainty

Tuple-independent databases(TID): the simplest probabilistic model Class

Class Room Date

CS 1 101 2021-03-26 80%

CS 2 101 2021-04-02 70%

Lockdown

Date

2021-03-26 20%

2021-04-02 40%

Semantics:

• Every tuple is annotated with aprobability

• We assume that all tuples areindependent

• A TID concisely represents aprobability distributionover thesubinstances

→ Uniform reliabilityamounts to a TID whereall facts have probability 1/2

(16)

Uncertain data and tuple-independent databases (TID)

We consider data in therelational modelon which we haveuncertainty

Tuple-independent databases(TID): the simplest probabilistic model Class

Class Room Date

CS 1 101 2021-03-26 80%

CS 2 101 2021-04-02 70%

Lockdown

Date

2021-03-26 20%

2021-04-02 40%

Semantics:

• Every tuple is annotated with aprobability

• We assume that all tuples areindependent

(17)

Probabilistic query evaluation (PQE)

We consider againBoolean Conjunctive Queries(CQs)

• e.g.,Q:∃c r dClass(c,r,d)Lockdown(d)

SemanticsofQon a TID: compute theprobabilitythatQis true

Formally, problemPQE(Q)for a fixed CQQ:

Input: a TIDI

Output:the total probability of the subinstances ofIwhereQis true

Again we can solvePQE(Q)by looking at all subinstances (exponential)

→ When can we achieve a better complexity?

(18)

Probabilistic query evaluation (PQE)

We consider againBoolean Conjunctive Queries(CQs)

• e.g.,Q:∃c r dClass(c,r,d)Lockdown(d)

SemanticsofQon a TID: compute theprobabilitythatQis true

Formally, problemPQE(Q)for a fixed CQQ:

Input: a TIDI

Output:the total probability of the subinstances ofIwhereQis true

Again we can solvePQE(Q)by looking at all subinstances (exponential)

→ When can we achieve a better complexity?

(19)

Probabilistic query evaluation (PQE)

We consider againBoolean Conjunctive Queries(CQs)

• e.g.,Q:∃c r dClass(c,r,d)Lockdown(d)

SemanticsofQon a TID: compute theprobabilitythatQis true

Formally, problemPQE(Q)for a fixed CQQ:

Input: a TIDI

Output:the total probability of the subinstances ofIwhereQis true

Again we can solvePQE(Q)by looking at all subinstances (exponential)

→ When can we achieve a better complexity?

(20)

Probabilistic query evaluation (PQE)

We consider againBoolean Conjunctive Queries(CQs)

• e.g.,Q:∃c r dClass(c,r,d)Lockdown(d)

SemanticsofQon a TID: compute theprobabilitythatQis true

Formally, problemPQE(Q)for a fixed CQQ:

Input: a TIDI

Output:the total probability of the subinstances ofIwhereQis true

Again we can solvePQE(Q)by looking at all subinstances (exponential)

→ When can we achieve a better complexity?

(21)

Probabilistic query evaluation (PQE)

We consider againBoolean Conjunctive Queries(CQs)

• e.g.,Q:∃c r dClass(c,r,d)Lockdown(d)

SemanticsofQon a TID: compute theprobabilitythatQis true

Formally, problemPQE(Q)for a fixed CQQ:

Input: a TIDI

Output:the total probability of the subinstances ofIwhereQis true

Again we can solvePQE(Q)by looking at all subinstances (exponential)

→ When can we achieve a better complexity?

(22)

Existing results

Complexity of PQE shown in [Dalvi and Suciu, 2007] forself-join-free CQs(SJFCQs)

• A CQ isself-join-freeif no relation symbol is repeated

Later extended tounions of conjunctive queries[Dalvi and Suciu, 2012]

In this work we stick to the result on SJFCQs: Theorem [Dalvi and Suciu, 2007]

LetQbe a SJFCQ. Then:

EitherQishierarchicalandPQE(Q)is inPTIME

OrQisnot hierarchicalandPQE(Q)is#P-hard What is this class ofhierarchical CQs?

(23)

Existing results

Complexity of PQE shown in [Dalvi and Suciu, 2007] forself-join-free CQs(SJFCQs)

• A CQ isself-join-freeif no relation symbol is repeated

Later extended tounions of conjunctive queries[Dalvi and Suciu, 2012]

In this work we stick to the result on SJFCQs:

Theorem [Dalvi and Suciu, 2007]

LetQbe a SJFCQ. Then:

EitherQishierarchicalandPQE(Q)is inPTIME

OrQisnot hierarchicalandPQE(Q)is#P-hard

What is this class ofhierarchical CQs?

(24)

Existing results

Complexity of PQE shown in [Dalvi and Suciu, 2007] forself-join-free CQs(SJFCQs)

• A CQ isself-join-freeif no relation symbol is repeated

Later extended tounions of conjunctive queries[Dalvi and Suciu, 2012]

In this work we stick to the result on SJFCQs:

Theorem [Dalvi and Suciu, 2007]

LetQbe a SJFCQ. Then:

EitherQishierarchicalandPQE(Q)is inPTIME

OrQisnot hierarchicalandPQE(Q)is#P-hard

(25)

Hierarchical CQs

For a CQQ, writeatoms(x)for the set of atoms wherexappears

A CQ ishierarchicalif for every variablesxandy

• Eitheratoms(x)andatoms(y)aredisjoint

• Or one isincludedin the other

A CQ isnon-hierarchicalif there are two variablesxandysuch that

• Some atom containsbothxandy

• Some atom containsxbut noty

• Some atom containsybut notx

Simplest example: theR-S-Tquery:Q1 :∃x y R(x),S(x,y),T(y)

Intuitionfor arity-2 queries: the hierarchical CQs areunions of star-shaped patterns Exercise: Is our example CQ hierarchical?∃c r dClass(c,r,d)∧Lockdown(d)... Yes!

(26)

Hierarchical CQs

For a CQQ, writeatoms(x)for the set of atoms wherexappears

A CQ ishierarchicalif for every variablesxandy

• Eitheratoms(x)andatoms(y)aredisjoint

• Or one isincludedin the other

A CQ isnon-hierarchicalif there are two variablesxandysuch that

• Some atom containsbothxandy

• Some atom containsxbut noty

• Some atom containsybut notx

Simplest example: theR-S-Tquery:Q1 :∃x y R(x),S(x,y),T(y)

Intuitionfor arity-2 queries: the hierarchical CQs areunions of star-shaped patterns Exercise: Is our example CQ hierarchical?∃c r dClass(c,r,d)∧Lockdown(d)... Yes!

(27)

Hierarchical CQs

For a CQQ, writeatoms(x)for the set of atoms wherexappears

A CQ ishierarchicalif for every variablesxandy

• Eitheratoms(x)andatoms(y)aredisjoint

• Or one isincludedin the other

A CQ isnon-hierarchicalif there are two variablesxandysuch that

• Some atom containsbothxandy

• Some atom containsxbut noty

• Some atom containsybut notx

Simplest example: theR-S-Tquery:Q1 :∃x y R(x),S(x,y),T(y)

Intuitionfor arity-2 queries: the hierarchical CQs areunions of star-shaped patterns

Exercise: Is our example CQ hierarchical?∃c r dClass(c,r,d)∧Lockdown(d)... Yes!

(28)

Hierarchical CQs

For a CQQ, writeatoms(x)for the set of atoms wherexappears

A CQ ishierarchicalif for every variablesxandy

• Eitheratoms(x)andatoms(y)aredisjoint

• Or one isincludedin the other

A CQ isnon-hierarchicalif there are two variablesxandysuch that

• Some atom containsbothxandy

• Some atom containsxbut noty

• Some atom containsybut notx

Simplest example: theR-S-Tquery:Q1 :∃x y R(x),S(x,y),T(y)

Intuitionfor arity-2 queries: the hierarchical CQs areunions of star-shaped patterns

... Yes!

(29)

Hierarchical CQs

For a CQQ, writeatoms(x)for the set of atoms wherexappears

A CQ ishierarchicalif for every variablesxandy

• Eitheratoms(x)andatoms(y)aredisjoint

• Or one isincludedin the other

A CQ isnon-hierarchicalif there are two variablesxandysuch that

• Some atom containsbothxandy

• Some atom containsxbut noty

• Some atom containsybut notx

Simplest example: theR-S-Tquery:Q1 :∃x y R(x),S(x,y),T(y)

Intuitionfor arity-2 queries: the hierarchical CQs areunions of star-shaped patterns Exercise: Is our example CQ hierarchical?∃c r dClass(c,r,d)∧Lockdown(d)... Yes!

(30)

Our results on uniform reliability

Let us return to our problem ofuniform reliability(UR):

We only study the problem onSJFCQs(see future work)

Forhierarchical SJFCQs, UR is tractable because PQE is tractable

Fornon-hierarchical SJFCQs, the complexity of UR isunknown

• Thehardness proofof PQE (see later) crucially uses probabilities1/2and1 We settle the complexity of UR for SJFCQs by showing:

Theorem

LetQbe a non-hierarchical SJFCQ. ThenUR(Q)is#P-hard. Rest of the talk: proof sketch of this result

(31)

Our results on uniform reliability

Let us return to our problem ofuniform reliability(UR):

We only study the problem onSJFCQs(see future work)

Forhierarchical SJFCQs, UR is tractable because PQE is tractable

Fornon-hierarchical SJFCQs, the complexity of UR isunknown

• Thehardness proofof PQE (see later) crucially uses probabilities1/2and1 We settle the complexity of UR for SJFCQs by showing:

Theorem

LetQbe a non-hierarchical SJFCQ. ThenUR(Q)is#P-hard. Rest of the talk: proof sketch of this result

(32)

Our results on uniform reliability

Let us return to our problem ofuniform reliability(UR):

We only study the problem onSJFCQs(see future work)

Forhierarchical SJFCQs, UR is tractable because PQE is tractable

Fornon-hierarchical SJFCQs, the complexity of UR isunknown

• Thehardness proofof PQE (see later) crucially uses probabilities1/2and1 We settle the complexity of UR for SJFCQs by showing:

Theorem

LetQbe a non-hierarchical SJFCQ. ThenUR(Q)is#P-hard. Rest of the talk: proof sketch of this result

(33)

Our results on uniform reliability

Let us return to our problem ofuniform reliability(UR):

We only study the problem onSJFCQs(see future work)

Forhierarchical SJFCQs, UR is tractable because PQE is tractable

Fornon-hierarchical SJFCQs, the complexity of UR is unknown

• Thehardness proofof PQE (see later) crucially uses probabilities1/2and1

We settle the complexity of UR for SJFCQs by showing: Theorem

LetQbe a non-hierarchical SJFCQ. ThenUR(Q)is#P-hard. Rest of the talk: proof sketch of this result

(34)

Our results on uniform reliability

Let us return to our problem ofuniform reliability(UR):

We only study the problem onSJFCQs(see future work)

Forhierarchical SJFCQs, UR is tractable because PQE is tractable

Fornon-hierarchical SJFCQs, the complexity of UR is unknown

• Thehardness proofof PQE (see later) crucially uses probabilities1/2and1 We settle the complexity of UR for SJFCQs by showing:

Theorem

LetQbe a non-hierarchical SJFCQ. ThenUR(Q)is#P-hard.

Rest of the talk: proof sketch of this result

(35)

Our results on uniform reliability

Let us return to our problem ofuniform reliability(UR):

We only study the problem onSJFCQs(see future work)

Forhierarchical SJFCQs, UR is tractable because PQE is tractable

Fornon-hierarchical SJFCQs, the complexity of UR is unknown

• Thehardness proofof PQE (see later) crucially uses probabilities1/2and1 We settle the complexity of UR for SJFCQs by showing:

Theorem

LetQbe a non-hierarchical SJFCQ. ThenUR(Q)is#P-hard.

Rest of the talk: proof sketch of this result

(36)

Reducing toR-S-T-type queries

AnR-S-T-type queryis a non-hierarchical SJFCQ of the form:

R1(x), . . . ,Rr(x),S1(x,y), . . . ,Ss(x,y),T1(y), . . . ,Tt(y) for some integersr,s,t>0

Lemma:for any non-hierarchical SJFCQQ, there is anR-S-T-type queryQ0 such that UR(Q0)reduces toUR(Q)

atoms(x) atoms(x)∩atoms(y) atoms(y)

r s t

So it suffices to show thatUR(Q0)is#P-hardfor theR-S-T-type queriesQ0

In this talk:we focus for simplicity onQ1 :∃x y R(x),S(x,y),T(y)

(37)

Reducing toR-S-T-type queries

AnR-S-T-type queryis a non-hierarchical SJFCQ of the form:

R1(x), . . . ,Rr(x),S1(x,y), . . . ,Ss(x,y),T1(y), . . . ,Tt(y) for some integersr,s,t>0

Lemma:for any non-hierarchical SJFCQQ, there is anR-S-T-type queryQ0 such that UR(Q0)reduces toUR(Q)

atoms(x) atoms(x)∩atoms(y) atoms(y)

r s t

So it suffices to show thatUR(Q0)is#P-hardfor theR-S-T-type queriesQ0

In this talk:we focus for simplicity onQ1 :∃x y R(x),S(x,y),T(y)

(38)

Reducing toR-S-T-type queries

AnR-S-T-type queryis a non-hierarchical SJFCQ of the form:

R1(x), . . . ,Rr(x),S1(x,y), . . . ,Ss(x,y),T1(y), . . . ,Tt(y) for some integersr,s,t>0

Lemma:for any non-hierarchical SJFCQQ, there is anR-S-T-type queryQ0 such that UR(Q0)reduces toUR(Q)

atoms(x) atoms(x)∩atoms(y) atoms(y)

r s t

In this talk:we focus for simplicity onQ1 :∃x y R(x),S(x,y),T(y)

(39)

Reducing toR-S-T-type queries

AnR-S-T-type queryis a non-hierarchical SJFCQ of the form:

R1(x), . . . ,Rr(x),S1(x,y), . . . ,Ss(x,y),T1(y), . . . ,Tt(y) for some integersr,s,t>0

Lemma:for any non-hierarchical SJFCQQ, there is anR-S-T-type queryQ0 such that UR(Q0)reduces toUR(Q)

atoms(x) atoms(x)∩atoms(y) atoms(y)

r s t

So it suffices to show thatUR(Q0)is#P-hardfor theR-S-T-type queriesQ0

we focus for simplicity on

(40)

Hard problem: counting independent sets of bipartite graphs u1

u2 u3

v1

v2

Independent setof a bipartite graph: subset of its vertices that contains no edge

Example:{u2,v1}

It is#P-hard, given a bipartite graph, to count its independent sets This easily shows the#P-hardnessof PQE (but not UR!) forQ1:∃x yR(x),S(x,y),T(y):

R(u1): 1/2

R(u2): 1/2 R(u3): 1/2

T(v1): 1/2

T(v2): 1/2 S: 1

S: 1 S: 1

S: 1 S: 1

We will show how to reduce from counting independent sets toUR(Q1)

(41)

Hard problem: counting independent sets of bipartite graphs u1

u2 u3

v1

v2

Independent setof a bipartite graph: subset of its vertices that contains no edge

Example:{u2,v1}

It is#P-hard, given a bipartite graph, to count its independent sets

This easily shows the#P-hardnessof PQE (but not UR!) forQ1:∃x yR(x),S(x,y),T(y): R(u1): 1/2

R(u2): 1/2 R(u3): 1/2

T(v1): 1/2

T(v2): 1/2 S: 1

S: 1 S: 1

S: 1 S: 1

We will show how to reduce from counting independent sets toUR(Q1)

(42)

Hard problem: counting independent sets of bipartite graphs u1

u2 u3

v1

v2

Independent setof a bipartite graph: subset of its vertices that contains no edge

Example:{u2,v1}

It is#P-hard, given a bipartite graph, to count its independent sets This easily shows the#P-hardnessof PQE (but not UR!) forQ1:∃x yR(x),S(x,y),T(y):

R(u1): 1/2 R(u2): 1/2 R(u3): 1/2

T(v1): 1/2

T(v2): 1/2 S: 1

S: 1 S: 1

S: 1 S: 1

We will show how to reduce from counting independent sets toUR(Q1)

(43)

Hard problem: counting independent sets of bipartite graphs u1

u2 u3

v1

v2

Independent setof a bipartite graph: subset of its vertices that contains no edge

Example:{u2,v1}

It is#P-hard, given a bipartite graph, to count its independent sets This easily shows the#P-hardnessof PQE (but not UR!) forQ1:∃x yR(x),S(x,y),T(y):

R(u1): 1/2 R(u2): 1/2 R(u3): 1/2

T(v1): 1/2

T(v2): 1/2 S: 1

S: 1 S: 1

S: 1 S: 1

We will show how to reduce from counting independent sets to

(44)

Idea: parameterizing the count u1

u2

u3

v1

v2

For a bipartite graph(U,V,E)and a subsetWUVof vertices, write:

c(W)the number of edgescontainedinW

Here,c(W) =1

d(W)(resp.,d0(W)) the number of edges having exactly their left (resp., right) endpoint inW

Here,d(W) =2andd0(W) =1

e(W)the number of edgesexcluded fromW

Here,e(W) =1

Hard problem:counting independent setsX=|{W⊆UV |c(W) =0}|

Harder problem:computing all the values: Xc,d,d0,e =

{W ⊆UV |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}

(45)

Idea: parameterizing the count u1

u2

u3

v1

v2

For a bipartite graph(U,V,E)and a subsetWUVof vertices, write:

c(W)the number of edgescontainedinW

Here,c(W) =1

d(W)(resp.,d0(W)) the number of edges having exactly their left (resp., right) endpoint inW

Here,d(W) =2andd0(W) =1

e(W)the number of edgesexcluded fromW

Here,e(W) =1

Hard problem:counting independent setsX=|{W⊆UV |c(W) =0}|

Harder problem:computing all the values: Xc,d,d0,e =

{W ⊆UV |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}

(46)

Idea: parameterizing the count u1

u2

u3

v1

v2

For a bipartite graph(U,V,E)and a subsetWUVof vertices, write:

c(W)the number of edgescontainedinW

Here,c(W) =1

d(W)(resp.,d0(W)) the number of edges having exactly their left (resp., right) endpoint inW

Here,d(W) =2andd0(W) =1

e(W)the number of edgesexcluded fromW

Here,e(W) =1

Hard problem:counting independent setsX=|{W⊆UV |c(W) =0}|

Harder problem:computing all the values: Xc,d,d0,e =

{W ⊆UV |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}

(47)

Idea: parameterizing the count u1

u2

u3

v1

v2

For a bipartite graph(U,V,E)and a subsetWUVof vertices, write:

c(W)the number of edgescontainedinW

Here,c(W) =1

d(W)(resp.,d0(W)) the number of edges having exactly their left (resp., right) endpoint inW

Here,d(W) =2andd0(W) =1

e(W)the number of edgesexcluded fromW

Here,e(W) =1

Hard problem:counting independent setsX=|{W⊆UV |c(W) =0}|

Harder problem:computing all the values: Xc,d,d0,e =

{W ⊆UV |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}

(48)

Idea: parameterizing the count u1

u2

u3

v1

v2

For a bipartite graph(U,V,E)and a subsetWUVof vertices, write:

c(W)the number of edgescontainedinW

Here,c(W) =1

d(W)(resp.,d0(W)) the number of edges having exactly their left (resp., right) endpoint inW

Here,d(W) =2andd0(W) =1

e(W)the number of edgesexcluded fromW

Here,e(W) =1

Hard problem:counting independent setsX=|{W⊆UV |c(W) =0}|

Harder problem:computing all the values: Xc,d,d0,e =

{W ⊆UV |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}

(49)

Idea: parameterizing the count u1

u2

u3

v1

v2

For a bipartite graph(U,V,E)and a subsetWUVof vertices, write:

c(W)the number of edgescontainedinW

Here,c(W) =1

d(W)(resp.,d0(W)) the number of edges having exactly their left (resp., right) endpoint inW

Here,d(W) =2andd0(W) =1

e(W)the number of edgesexcluded fromW

Here,e(W) =1

Hard problem:counting independent setsX=|{W⊆UV |c(W) =0}|

Harder problem:computing all the values:

X =

{W ⊆UV |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}

(50)

Idea: coding to several copies

We want to design areduction:

• We reducefrom(we want): given a bipartite graphG, compute theXc,d,d0,e

• We reduceto(we have): given a database instanceD, computeUR(Q1)

Idea:codeGto afamilyof instancesDpindexedbyp>0

Fix aboxBp(a,b)for indexp>0: an instance with two distinguished elements(a,b)

CodeGfor indexp>0to an instance by:

• putting anR-fact on eachU-vertex and aT-fact on eachV-vertex

• coding every edge(u,v)by acopy of the boxBp(u,v) u1

u2

u3

v1

v2

R(u1) R(u2) R(u3)

T(v1)

T(v2) Bp

Bp Bp

Bp

Bp

(51)

Idea: coding to several copies

We want to design areduction:

• We reducefrom(we want): given a bipartite graphG, compute theXc,d,d0,e

• We reduceto(we have): given a database instanceD, computeUR(Q1)

Idea:codeGto afamilyof instancesDpindexedbyp>0

Fix aboxBp(a,b)for indexp>0: an instance with two distinguished elements(a,b)

CodeGfor indexp>0to an instance by:

• putting anR-fact on eachU-vertex and aT-fact on eachV-vertex

• coding every edge(u,v)by acopy of the boxBp(u,v) u1

u2

u3

v1

v2

R(u1) R(u2) R(u3)

T(v1)

T(v2) Bp

Bp Bp

Bp

Bp

(52)

Idea: coding to several copies

We want to design areduction:

• We reducefrom(we want): given a bipartite graphG, compute theXc,d,d0,e

• We reduceto(we have): given a database instanceD, computeUR(Q1)

Idea:codeGto afamilyof instancesDpindexedbyp>0

Fix aboxBp(a,b)for indexp>0: an instance with two distinguished elements(a,b)

CodeGfor indexp>0to an instance by:

• putting anR-fact on eachU-vertex and aT-fact on eachV-vertex

• coding every edge(u,v)by acopy of the boxBp(u,v) u1

u2

v1 R(u1)

R(u2)

T(v1) Bp

Bp Bp

(53)

Getting an equation system

Take the coding ofGfor indexp, and compute the numberNpof subinstancesviolatingQ1 R(u1)

R(u2) R(u3)

T(v1)

T(v2) Bp

Bp

Bp Bp Bp

We have:

Np= X

W⊆V

NWp

= X

W⊆V

γpc(W)δd(W)pp0)d0(W)ηpe(W) = X

c,d,d0,e

Xc,d,d0,e×γcpδpdp0)d0ηpe

whereNWp is the number of subinstances violatingQ1when fixing theR-facts and T-facts to be precisely onW

NowNWp only depends on:

• The numbersc(W),d(W),d0(W),e(W)of edgescontained,dangling, orexcludedfromW

• The numbersγp,δp,δ0p,ηpof subinstances of the boxBpthat violateQ1 when fixingR-facts onaand/orT-facts onb

(54)

Getting an equation system

Take the coding ofGfor indexp, and compute the numberNpof subinstancesviolatingQ1 R(u1)

R(u2) R(u3)

T(v1)

T(v2) Bp

Bp

Bp Bp

Bp

We have:

Np= X

W⊆V

NWp

= X

W⊆V

γpc(W)δd(W)pp0)d0(W)ηpe(W) = X

c,d,d0,e

Xc,d,d0,e×γpcδpdp0)d0ηpe

whereNWp is the number of subinstances violatingQ1when fixing theR-facts and T-facts to be precisely onW

NowNWp only depends on:

• The numbersc(W),d(W),d0(W),e(W)of edgescontained,dangling, orexcludedfromW

• The numbersγp,δp,δ0p,ηpof subinstances of the boxBpthat violateQ1 when fixingR-facts onaand/orT-facts onb

(55)

Getting an equation system

Take the coding ofGfor indexp, and compute the numberNpof subinstancesviolatingQ1 R(u1)

R(u2) R(u3)

T(v1)

T(v2) Bp

Bp

Bp Bp

Bp

We have:

Np= X

W⊆V

NWp

= X

W⊆V

γpc(W)δd(W)pp0)d0(W)ηpe(W) = X

c,d,d0,e

Xc,d,d0,e×γpcδpdp0)d0ηpe

whereNWp is the number of subinstances violatingQ1when fixing theR-facts and T-facts to be precisely onW

NowNWp only depends on:

• The numbersc(W),d(W),d0(W),e(W)of edgescontained,dangling, orexcludedfromW

• The numbersγp,δp,δ0p,ηpof subinstances of the boxBpthat violateQ1 when fixingR-facts onaand/orT-facts onb

(56)

Getting an equation system

Take the coding ofGfor indexp, and compute the numberNpof subinstancesviolatingQ1 R(u1)

R(u2) R(u3)

T(v1)

T(v2) Bp

Bp

Bp Bp

Bp

We have:

Np= X

W⊆V

NWp

= X

W⊆V

γpc(W)δd(W)pp0)d0(W)ηpe(W) = X

c,d,d0,e

Xc,d,d0,e×γpcδpdp0)d0ηpe

whereNWp is the number of subinstances violatingQ1when fixing theR-facts and T-facts to be precisely onW

NowNW only depends on:

• The numbersγp,δp,δ0p,ηpof subinstances of the boxBpthat violateQ1 when fixingR-facts onaand/orT-facts onb

(57)

Getting an equation system

Take the coding ofGfor indexp, and compute the numberNpof subinstancesviolatingQ1 R(u1)

R(u2) R(u3)

T(v1)

T(v2) Bp

Bp

Bp Bp

Bp

We have:

Np= X

W⊆V

NWp

= X

W⊆V

γpc(W)δd(W)pp0)d0(W)ηpe(W) = X

c,d,d0,e

Xc,d,d0,e×γpcδpdp0)d0ηpe

whereNWp is the number of subinstances violatingQ1when fixing theR-facts and T-facts to be precisely onW

NowNWp only depends on:

• The numbersc(W),d(W),d0(W),e(W)of edgescontained,dangling, orexcludedfromW

• The numbers , , 0, of subinstances of the boxB that violateQ

(58)

Getting an equation system

Take the coding ofGfor indexp, and compute the numberNpof subinstancesviolatingQ1 R(u1)

R(u2) R(u3)

T(v1)

T(v2) Bp

Bp

Bp Bp

Bp

We have:

Np= X

W⊆V

NWp = X

W⊆V

γpc(W)δd(W)p0p)d0(W)ηpe(W)

= X

c,d,d0,e

Xc,d,d0,e×γpcδpdp0)d0ηpe

whereNWp is the number of subinstances violatingQ1when fixing theR-facts and T-facts to be precisely onW

NowNW only depends on:

Références

Documents relatifs

We have discussed that though the complexity of theory queries is unknown, the fact that we simulate every theory query individually allows us to assume that the required effort is

However, while for acyclic and bounded hypertreewidth queries we have shown a number of examples of interesting approximations, for queries of bounded treewidth the study had

For instance, the #P- completeness of the combined complexity of the counting problem of ACQs al- lows us an easy #P-completeness proof for the counting problem of unions of ACQs

After finding mappings from the subgoals in the query to view, a major part of a rewriting process is spent in performing the cartesian products of a set of large buckets that

The automaton itself is closely related to the reasoning algorithm given in [8], but the representation of entailments via nondeterministic finite automata (NFA) will be essential

While the complexity of DLs has been studied extensively, data complexity in expressive DLs has been characterized only for answering atomic queries, and was still open for

One of the obstacles for showing hardness (which is required for the cases (3) and (5)) is that the set of all triple patterns occurring in the query has to be acyclic and of

In this paper, we consider a 3-shock wave, because a 1-shock wave can be handled by the same method.. For general hyperbolic system with relaxation, the existence of the shock