Fall 2009, Advanced Constraint Programming 1 Symmetry Detection in Constraint Satisfaction Problems & Its Application in Databases Berthe Y. Choueiry Constraint Systems Laboratory Department of Computer Science & Engineering University of Nebraska-Lincoln Joint work with Amy Beckwith-Davis, Anagh Lal, and Eugene C. Freuder Supported by NSF CAREER award #0133568
33
Embed
Symmetry Detection in Constraint Satisfaction Problems & Its Application in Databases
Symmetry Detection in Constraint Satisfaction Problems & Its Application in Databases Berthe Y. Choueiry Constraint Systems Laboratory Department of Computer Science & Engineering University of Nebraska-Lincoln Joint work with Amy Beckwith-Davis, Anagh Lal, and Eugene C. Freuder - PowerPoint PPT Presentation
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
Fall 2009, Advanced Constraint Programming
1
Symmetry Detection in Constraint Satisfaction Problems
& Its Application in Databases
Berthe Y. ChoueiryConstraint Systems Laboratory
Department of Computer Science & EngineeringUniversity of Nebraska-Lincoln
Joint work with Amy Beckwith-Davis, Anagh Lal, and Eugene C. Freuder
Supported by NSF CAREER award #0133568
Fall 2009, Advanced Constraint Programming
December 9, 2005 2
Outline
• Definitions– CSP– Interchangeability– Bundling
• Bundling in CSPs
• Bundling for join query computation
• Conclusions
Fall 2009, Advanced Constraint Programming
December 9, 2005 3
Constraint Satisfaction Problem (CSP)
• Given P = (V, D, C)– V : set of variables– D : set of their domains– C : set of constraints (relations) restricting the
acceptable combination of values for variables– Solution is a consistent assignment of values to variables
• Query: find 1 solution, all solutions, etc.• Examples: SAT, scheduling, product configuration• NP-Complete in general
V3
{d}
{a, b, d} {a, b, c}
{c, d, e, f}
V4
V2V1
Fall 2009, Advanced Constraint Programming
December 9, 2005 4
Backtrack search
• DFS + backtracking (linear space) – Variable being instantiated: current variable– Un-instantiated variables: future variables– Instantiated variables: past variables
• Captures the idea of symmetry between solutions • Functional interchangeability
– Any mapping between two solutions– Including permutation of values across variables, equivalent to
graph isomorphism
• Full interchangeability (FI)– Restricted to values of a single variable– Also, likely intractable
V1 V2 {d, e, f}
V3 V4
In every solutionV1 dV2 c
V3 aV4 b
V1 dV2 c
V3 bV4 a
V3
{d}
{a, b, d} {a, b, c}
{ c, d, e, f }
V4
V2V1
Fall 2009, Advanced Constraint Programming
December 9, 2005 6
Value interchangeability [Freuder, 91]
• Full Interchangeability (FI): – d, e, f interchangeable for V2 in any solution
• Neighborhood Interchangeability (NI): – Considers only the neighborhood of the variable – Finds e, f but misses d– Efficiently approximates FI– Discrimination tree DT(V2)
{c, d, e, f }{d}
{a, b, d} {a, b, c} V4
V2V1
V3
Fall 2009, Advanced Constraint Programming
December 9, 2005 7
Outline
• Definitions
• Bundling in CSPs– Static bundling– Dynamic bundling– Dynamic bundling for non-binary CSPs
• Bundling for join query computation
• Conclusions
Fall 2009, Advanced Constraint Programming
December 9, 2005 8
• Static bundling
[Haselböck, 93]
– Before search: compute & store NI sets
– During search: • Future variables: remove bundle of equivalent values • Current variable: assign a bundle of equivalent values
• Advantages– Reduces search space
– Creates bundled solutions
Bundling: using NI in search
Static bundling
c e, f d
dV1
V2
S
V3
{d}
{a, b, d} {a, b, c}
{ c, d, e, f }
V4
V2V1
V4 {b,c}
V1 dV2 {e,f}
V3 aV2
{ c, d, e, f }
{ d, c, e, f }
{ c, d, e, f }
V3
V4
V1
Fall 2009, Advanced Constraint Programming
December 9, 2005 9
<V4,a> <V3,d><V4,a>
<V4,b><V4,c><V4,b>
<V3,b><V3,a>
• Dynamically identifies NI• Using discrimination tree for forward checking:
– is never less efficient than BT & static bundling
Dynamic bundling (DynBndl) [2001]
Static bundling
S
c d, e, f
dV1
V2
Dynamic bundling
c e, f d
dV1
V2
S
V3
{d}
{a, b, d} {a, b, c}
{ c, d, e, f }
V4
V2V1
V2,{d,e,f} V2,{c}
Fall 2009, Advanced Constraint Programming
December 9, 2005 10
Non-binary CSPs
Constraint Variable
C1 C2 C3 C4
V V1 V2 V V3 V2 V3 V4 V1 V4
1 1 3 1 3 1 2 1 1 1
1 3 3 2 3 1 2 2 2 2
2 1 3 3 2 2 2 1 3 1
2 3 3 4 2 2 2 2
3 1 1 4 2 3 1 1
3 2 2 6 1
4 1 1
4 2 2
5 3 2
6 3 2
C4
{1, 2, 3, 4, 5, 6}
{1, 2, 3}
{1, 2, 3}
{1, 2, 3}
{1, 2, 3}
C2
C1
C3 V1
V2
V3
V4
V
• Scope(Cx): the set of variables involved in Cx
• Arity(Cx): size of scope
Computing NI for non-binary CSPs is not a trivial extension from binary CSPs
Fall 2009, Advanced Constraint Programming
December 9, 2005 11
1. Building an nb-DT for each constraint– Determines the NI sets of variable given constraint
2. Intersecting partitions from nb-DTs – Yields NI sets of V (partition of DV)
3. Processing paths in nb-DTs– Gives, for free, updates necessary for forward checking
Analysis: Varying domain size• Increasing a in phase-
transition– FBS increases: More
chances for symmetry– CPU time decreases:
more bundling of no-goods
CR Improv (CPU) %
FBS
a=10 a=15 a=10 a=15
CR1 33.3 34.3 5.5 11.9
CR2 28.6 33.0 5.0 5.5
CR3 29.8 31.7 3.6 5.0
CR4 28.4 31.6 1.2 1.4
Increasing a (n=30)
Because the benefits of DynBndl increase with increasing domain size, DynBndl is particularly interesting for database applications where large domains are typical
Fall 2009, Advanced Constraint Programming
December 9, 2005 19
Outline
• Definitions
• Bundling in CSPs
• Bundling for join query computation– Idea– A CSP model for the query join– Sorting-based bundling algorithm– Dynamic-bundling-based join algorithm