Global%20Constraints - PowerPoint PPT Presentation

About This Presentation
Title:

Global%20Constraints

Description:

Since it is polynomial to propagate this decomposition ... k = O(n), GAC is NP-hard even when C is polynomial to test. Meta-constraints ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 28
Provided by: cseUn
Category:

less

Transcript and Presenter's Notes

Title: Global%20Constraints


1
Global Constraints
  • Toby Walsh
  • National ICT Australia and
  • University of New South Wales
  • www.cse.unsw.edu.au/tw

2
Course outline
  • Introduction
  • All Different
  • Lex ordering
  • Value precedence
  • Complexity
  • GAC-Schema
  • Soft Global Constraints
  • Global Grammar Constraints
  • Roots Constraint
  • Range Constraint
  • Slide Constraint
  • Global Constraints on Sets

3
Global constraints
  • Hardcore algorithms
  • Data structures
  • Graph theory
  • Flow theory
  • Combinatorics
  • Computational complexity
  • Global constraints are often balanced on the
    limits of tractability!

4
Global constraints are NP-hard
  • Can solve 3SAT using a single global constraint!
  • Given 3SAT problem in N vars and M clauses
  • 3SAT(X1,Xn) where nN3M2
  • Constraint holds iff X1N, X2M,
  • X_2i is 0/1 representing value assigned to xi
  • X_2N3j, X_2N3j1 and X_2N3j2 represents
  • jth clause

5
Our hammer
  • Use tools of computational complexity to study
    global constraints

6
Limits of Global Constraints
  • Enforce lesser consistency
  • Constraints cannot be combined
  • Constraints cannot be generalized
  • Decomposition will hurt pruning

Also study limits of reasoning with symmetries,
nogoods, meta-constraints like cardinality
7
Questions to ask?
  • GACSupport? is NP-complete
  • Does this value have support?
  • Basic question asked within many propagators
  • MaxGAC? is DP-complete
  • Are these domains the maximal generalized
    arc-consistent domains?
  • Termination test for a propagator
  • DP NP u coNP
  • Propagation harder than solving the problem!

8
Questions to ask?
  • IsItGAC? is NP-complete
  • Are the domains GAC?
  • Wakeup test for a propagator
  • NoGACWipeOut? is NP-complete
  • If we enforce GAC, do we not get a wipeout?
  • Used in many reductions
  • GACDomain? is NP-hard
  • Return the maximal GAC domains
  • What a propagator actually does!

9
Relationships between questions
  • NoGACWipeOut GACSupport GACDomain
  • NoGACWipeOut in P lt-gt GACDomain in P
  • NoGACWipeOut in NP lt-gt GACDomain in NP
  • GACDomain in P gt MaxGAC in P gt IsItGAC in P
  • IsItGAC in NP gt MaxGAC in NP gt GACDomain in NP
  • Open if arrows cannot be reversed!

10
Constraints in practice
  • Some constraints proposed in the past are
    intractable
  • NValues(N,X1,..Xn)
  • AtMost1(S1,..,Sn)
  • Card(C1,..,Cn,N)
  • CardPath(N,X1,..,Xn,C)

11
NValues
  • NValues(N,X1,..,Xm)
  • N values used in X1,,Xm
  • Useful for resource allocation

12
NValues
  • NValues(Y,X1,..,Xn)
  • Reduction of 3SAT to NValues
  • 3SAT problem in N vars, M clauses
  • Xi in i,-i for 1 i N
  • XNs in i,-j,k if s-th clause is (i or -j or
    k)
  • Y N
  • Hence 3SAT has a solution gt NoGACWipeOut answers
    yes

13
NValues
  • NValues(N,X1,..,Xm)
  • Reduction of 3SAT to NValues
  • 3SAT problem in n vars, l clauses
  • Xi in i,-i for 1 i n
  • Xns in i,-j,k if s-th clause is (i or -j or
    k)
  • N n
  • Hence 3SAT has a solution ltgt NoGACWipeOut
    answers yes
  • Enforce lesser level of local consistency (e.g.
    BC)

14
Composing constraints
  • Take some tractable constraints
  • E.g. Intersect(S1,,Sn,k), S1c, ,Snc
  • Could we combine them?
  • E.g. FixedCardIntersect(S1,,Sn,k,c)
  • No, NP-hard to enforce BC!
  • AtMost1 with cardinality bounds on set variables
    is FixedCardIntersect
  • Used in social golfers problem

15
Generalizing constraints
  • Take a tractable constraint
  • GCC(X1,..,Xn,l1,..,lm,u1,..,um)
  • Value j occurs between lj and uj times in
    X1,..,Xn
  • Generalize some constants to variables
  • E.g. GCC(X1,..,Xn,O1,..,Om)
  • NP-hard to enforce GAC!

16
Generalizing constraints
  • GCC(X1,..,Xn,O1,..,Om)
  • Reduction from 1in3SAT on positive clauses
  • If jth clause is (x or y or z) then Xj in x,y,z
  • If x occurs k times in all clauses then Ox in
    0,k
  • Hence 1in3SAT has a solution iff NoGACWipeOut
    answers yes
  • Thus enforcing GAC is NP-hard

17
Decomposing constraints
  • Consider a global constraint that is NP-hard to
    propagate
  • E.g. AtMost1(S1,,Sn) with cardinality constraint
    on sets
  • Decompose into polynomial number of constraints
  • Si intersect Sj 1 for all iltj
  • Since it is polynomial to propagate this
    decomposition
  • Decomposition hinders propagation (assuming P?NP)

18
Decomposing constraints
  • Consider a global constraint that is NP-hard
  • E.g. AtMost1(S1,,Sn)
  • BC on sets GAC on characteristic function
  • Reduction from 3SAT
  • Sets have cardinality 2
  • If jth clause is x or -y or z, introduce
  • mj subseteq Sj subseteq mj, xj, -yj,
    zj
  • Sj mj, xj if x satisfied jth clause
  • Suppose kth clause contains -x, introduce two set
    vars
  • mj subseteq Tjk subseteq mj, xj, -xk
  • -xk subseteq Ujk subseteq mj, mk, -xk

19
Decomposing constraints
  • Consider a global constraint that is NP-hard
  • E.g. AtMost1(S1,,Sn)
  • BC on sets GAC on characteristic function
  • Reduction from 3SAT
  • Sets have cardinality 2
  • If jth clause is x or -y or z, introduce
  • mj subseteq Sj subseteq mj, xj, -yj,
    zj
  • Sj mj, xj if x satisfied jth clause
  • Suppose kth clause contains -x, introduce two set
    vars
  • mj subseteq Tjk subseteq mj, xj, -xk
  • -xk subseteq Ujk subseteq mj, mk, -xk
  • Tjkmj,-xk, Ujkmk,-xk and
    Sk/mk,xk

20
Symmetry breaking
  • Symmetry is a major problem
  • Symmetric machines, symmetric orders
  • Often matrix of decision vars
  • Row and Cols symmetric

21
Symmetry breaking
  • Add (global) constraints to eliminate symmetries
  • Prune symmetric branches of search tree
  • E.g. lex order rows, lex order cols
  • Can we break all row col symmetry this way?

22
Symmetry breaking
  • Add (global) constraints to eliminate symmetries
  • Prune symmetric branches of search tree
  • E.g. lex order rows, lex order cols
  • Can we break all row col symmetry this way?
  • Suppose we had a global constraint that broke all
    row and column symmetry
  • Enforcing GAC on such a constraint is NP-hard
  • Actually coNP-hard

23
Meta-constraints
  • Put together existing constraints
  • Card(N,C1,,Cm) iff N of C1,..Cm are satisfied
  • implements conjunction, disjunction, negation
  • conjunction is Nm
  • disjunction is Ngt0
  • negation is N0 and m1
  • But NP-hard to propagate
  • Typically delayed in most solvers

24
Meta-constraints
  • Special case of Card is CardPath
  • Useful for sequencing problems
  • CardPath(C,X1,..Xn,N) iff C(Xi,..Xik) holds N
    times
  • E.g. number of changes is CardPath(/,X1,..Xn,N
    )
  • Fixed parameter tractable
  • k fixed, GAC takes O(ndk) time
  • k O(n), GAC is NP-hard even when C is
    polynomial to test

25
Meta-constraints
  • CardPath(C,X1,..Xn,N) iff C(Xi,..Xik) holds N
    times
  • Reduce 3SAT in N variables and M clauses to
    CardPath where kN2
  • NM vars Xi to represent repeated truth assignment
  • M vars Yj to represent jth clause
  • C(X1,..,XN,Yj,X1) iff Yjk and Xk1 and X1X1
  • or Yj-k and Xk0 and X1X1
  • C(X2,..,XM.Yj,X1,X2) iff X2X2
  • ..

26
Learning
  • Arc-consistency is essentially learning (unary)
    nogoods
  • Same tools apply to learning
  • NoGood? is coNP-complete
  • MinimalNoGood? is DP-complete

27
Conclusions
  • Computational complexity is a useful hammer to
    study global constraints
  • Uncovers fundamental limits of reasoning with
    global constraints
  • Lesser consistency needs to be enforced
  • Decomposition hurts pruning
  • Composition intractable
  • Generalization intractable
  • ..
Write a Comment
User Comments (0)
About PowerShow.com