Uniform Reliability of Self-Join-Free Conjunctive Queries
Antoine Amarilli1, Benny Kimelfeld2 March 23, 2021
1Télécom Paris
2Technion
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?
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?
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?
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?
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?
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?
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
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
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
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
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
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
Uncertain data and tuple-independent databases (TID)
•
We consider data in therelational modelon which we haveuncertainty•
Tuple-independent databases(TID): the simplest probabilistic model ClassClass 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
Uncertain data and tuple-independent databases (TID)
•
We consider data in therelational modelon which we haveuncertainty•
Tuple-independent databases(TID): the simplest probabilistic model ClassClass 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
Uncertain data and tuple-independent databases (TID)
•
We consider data in therelational modelon which we haveuncertainty•
Tuple-independent databases(TID): the simplest probabilistic model ClassClass 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
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?
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?
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?
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?
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?
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?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-hardWhat is this class ofhierarchical CQs?
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-hardHierarchical 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!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!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 patternsExercise: Is our example CQ hierarchical?∃c r dClass(c,r,d)∧Lockdown(d)... Yes!
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!
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!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
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
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
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
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
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
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)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)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)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 onHard 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)
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 setsThis 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)
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)
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
Idea: parameterizing the count u1
u2
u3
v1
v2
For a bipartite graph(U,V,E)and a subsetW ⊆U∪Vof 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⊆U∪V |c(W) =0}|•
Harder problem:computing all the values: Xc,d,d0,e ={W ⊆U∪V |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}
Idea: parameterizing the count u1
u2
u3
v1
v2
For a bipartite graph(U,V,E)and a subsetW ⊆U∪Vof 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⊆U∪V |c(W) =0}|•
Harder problem:computing all the values: Xc,d,d0,e ={W ⊆U∪V |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}
Idea: parameterizing the count u1
u2
u3
v1
v2
For a bipartite graph(U,V,E)and a subsetW ⊆U∪Vof 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⊆U∪V |c(W) =0}|•
Harder problem:computing all the values: Xc,d,d0,e ={W ⊆U∪V |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}
Idea: parameterizing the count u1
u2
u3
v1
v2
For a bipartite graph(U,V,E)and a subsetW ⊆U∪Vof 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⊆U∪V |c(W) =0}|•
Harder problem:computing all the values: Xc,d,d0,e ={W ⊆U∪V |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}
Idea: parameterizing the count u1
u2
u3
v1
v2
For a bipartite graph(U,V,E)and a subsetW ⊆U∪Vof 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⊆U∪V |c(W) =0}|•
Harder problem:computing all the values: Xc,d,d0,e ={W ⊆U∪V |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}
Idea: parameterizing the count u1
u2
u3
v1
v2
For a bipartite graph(U,V,E)and a subsetW ⊆U∪Vof 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⊆U∪V |c(W) =0}|•
Harder problem:computing all the values:X =
{W ⊆U∪V |c(W) =candd(W) =dandd0(W) =d0 ande(W) =e}
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
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
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
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)p (δp0)d0(W)ηpe(W) = X
c,d,d0,e
Xc,d,d0,e×γcpδpd(δp0)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
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)p (δp0)d0(W)ηpe(W) = X
c,d,d0,e
Xc,d,d0,e×γpcδpd(δp0)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
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)p (δp0)d0(W)ηpe(W) = X
c,d,d0,e
Xc,d,d0,e×γpcδpd(δp0)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
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)p (δp0)d0(W)ηpe(W) = X
c,d,d0,e
Xc,d,d0,e×γpcδpd(δp0)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
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)p (δp0)d0(W)ηpe(W) = X
c,d,d0,e
Xc,d,d0,e×γpcδpd(δp0)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
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)p (δ0p)d0(W)ηpe(W)
= X
c,d,d0,e
Xc,d,d0,e×γpcδpd(δp0)d0ηpe
whereNWp is the number of subinstances violatingQ1when fixing theR-facts and T-facts to be precisely onW