
Constrained Decision Diagrams Kenil C.K. Cheng and Roland H.C. Yap National University of Singapore 3 Science Drive 2, Singapore {chengchi,ryap}@comp.nus.edu.sg Abstract site approach is to use an explicit representation where data structures are used to compress the solution set directly, i.e. A general n-ary constraint is usually represented explicitly as a set of its solution tuples, which may need exponential suffix or prefix sharing. These might not be practical when space. In this paper, we introduce a new representation for the solution set is huge (since its explicit) or difficult to com- general n-ary constraints called Constrained Decision Di- press. agram (CDD). CDD generalizes BDD-style representations In this paper, we introduce a new representation for so- and the main feature is that it combines constraint reason- lution sets and general n-ary constraints, called Constrained ing/consistency techniques with a compact data structure. We Decision Diagram (CDD). CDD is a hybrid which combines present an application of CDD for recording all solutions of the strengths of implicit and explicit approaches. On the one a conjunction of constraints. Instead of an explicit represen- hand, it can be explicit and generalizes BDD-style repre- tation, we can implicitly encode the solutions by means of sentations. It is also implicit, combining constraint reason- constraint propagation. Our experiments confirm the scala- bility and demonstrate that CDDs can drastically reduce the ing/consistency techniques with a compact data structure. space needed over explicit and ZBDD representations. Binary decision diagram (BDD) (Bryant 1986) is the state of the art representation for propositional logic, and CAD. Unlike BDD which only allows propositional variables (i.e. Introduction the only available constraints are x = 1 and x = 0), a CDD Many real-life combinatorial problems such as scheduling can use arbitrary constraints. We show how CDDs can be can be modeled as a constraint satisfaction problem (CSP). used to represent all solutions of a CSP where space savings Despite the vast improvements on search strategies and con- come because of the implicit representation and use of con- sistency algorithms for binary and specific constraints, rel- straint propagation. Our experiments show that CDDs can atively less efforts have been put into issues with general give 1-2 orders of magnitude space savings over explicit and n-ary constraints. In particular, this paper looks at the issue ZBDDs (Okuno, Minato, & Isozaki 1998) representations. of efficient representations of the solution space. This is im- We remark that for large solution spaces, memory usage can portant when we want to record all solutions to a CSP or as be the primary consideration. efficient representations of n-ary constraints which can be used with consistency algorithms. Preliminaries An efficient representation of all solutions is useful for some applications. For example, a configuration system A constraint satisfaction problem (CSP) is a triple P = may be interactive where real-time response is necessary. So hX, D, Ci, where X = {x1,...,xn} is a set of variables, finding the solutions of the CSP in advance and filtering that D = {D1,...,Dn} is a set of domains, and C is a set 1 against the user’s requirements is more efficient than solv- of constraints Each variable xi can only take values from ing from scratch. In this paper, we are interested in efficient its domain Di, which is a set of integers. A valuation and compact representations which can be used to represent θ is a mapping of variables to integer values, written as vars solution spaces during search. Moreover, we show how var- {x1 7→ d1,...,xn 7→ dn}. Let be the function that ious local consistencies and the constraint solver can be ex- returns the set of (free) variables appearing in a constraint ploited in the representation to get more compactness. or valuation. A k-ary constraint c ∈ C on an ordered set To represent the solutions of a CSP or a general n-ary con- of k distinct variables, sometimes written as c(x1,...,xk), straint compactly, one approach is an implicit representation is a subset of the Cartesian product D1 × · · · × Dk that re- using a symbolic relation, e.g. a logical formula involving stricts the values the variables in c can take simultaneously. arithmetic. While the implicit form can be very compact, A valuation θ satisfies c, a.k.a. a solution of c, if and only they can be difficult expensive to use and discover, espe- if θ ∈ c. Solving a CSP requires finding a value for each cially when constraints are dynamically created. The oppo- variable from its domain so that all constraints are satisfied. Copyright c 2005, American Association for Artificial Intelli- 1In this paper we use the terms “a set of constraints” and “a gence (www.aaai.org). All rights reserved. conjunction of constraints” interchangeably. AAAI-05 / 366 Let Γ be a set of constraints. Two constraints c1 and c2 are x1 ≤ 5, c12 ≡ x1 ∈ {7, 9}, c2 ≡ x2 < x1, c3 ≡ x3 < x1 equivalent w.r.t. Γ, denoted by c1 ≡Γ c2, if and only if for and c4 ≡ x2 + x3 >x4. The constraint represented by G is any valuation θ, we have θ ∈ (Γ∧c1) ⇐⇒ θ ∈ (Γ∧c2). In Γ ∧ [[v1]] particular, when Γ is true, c1 and c2 are equivalent, written ≡ Γ ∧ (c11 ∧ [[v2]]) ∨ (c12 ∧ [[v3]]) as c1 ≡ c2, if and only if they define the same relation. ≡ Γ ∧ (c11 ∧ c2 ∧ [[v4]]) ∨ (c12 ∧ c3 ∧ [[v4]]) ≡ Γ ∧ (c11 ∧ c2 ∧ c4 ∧ [[1]]) ∨ (c12 ∧ c3 ∧ c4 ∧ [[1]]) Constrained Decision Diagrams ≡ Γ ∧ ((c11 ∧ c2) ∨ (c12 ∧ c3)) ∧ c4. A constrained decision diagram (CDD) G = hΓ, Gi con- A CDD G = hΓ, Gi rooted at the CDD node v = sists of a set of constraints Γ (named CDD constraints) and {(c1,u1),..., (cm,um)} is reduced if and only if each CDD a rooted, directed acyclic graph (DAG) G = (V ∪ T, E) ′ graph Gj rooted at uj is either a terminal or reduced, and (named CDD graph). We call a node v ∈ V ∪ T a CDD c ∧ c ≡Γ false (1) node (or simply node). The 0-terminal (0 ∈ T ) represents i j false and the 1-terminal (1 ∈ T ) represents true. G has ui 6≡Γ uj (2) at least one terminal. Every non-terminal node v ∈ V con- for all 1 ≤ i<j ≤ m. In this paper, we are only interested nects to a subset of nodes U ⊆ V ∪ T − {v}. Each u ∈ U in reduced CDDs. is a successor of v, i.e., there exists a directed edge vu ∈ E Example 2 A box constraint collection (BCC) (Cheng, Lee, from v to u. A non-terminal node v denotes a non-empty & Stuckey 2003) set {(c1,u1),..., (cm,um)}. Each branch (cj ,uj ) consists n m c x ,...,x u v of a constraint j( 1 k) and a successor j of . Fig- (c ∧ a ≤ x ≤ b ) ure 1 gives the graphical representation of v. Each outgoing _ i ^ ij i ij i=1 j=1 where a and b are integers, is a (non-reduced) CDD B = Γ ij ij htrue, Gi whose root v = {(c1,u11),..., (cn,un1)} and all v c1 · · · cm other nodes uij = {(aij ≤ xi ≤ bij,uij+1)}. Example 3 A multi-valued decision diagram (MDD) (Srini- u1 · · · um vasan et al. 1990) over variables x1,...,xn is a CDD M = htrue, Gi in which every CDD node v is of the form Figure 1: Graphical representation of a CDD node v {(xk = d, u) : d ∈ Dk} where Dk is the domain of xk and u is the corresponding successor. In particular, if all variables have a Boolean domain {0, 1}, the MDD reduces arrow from cj points to the corresponding successor uj of v. If G = hΓ, Gi is a CDD and v is the root node of G we to a binary decision diagram (BDD) (Bryant 1986). will explicitly draw an incoming arrow to v and label it with Given a fixed variable ordering, a multi-valued function is Γ. Hereafter, when we say “a CDD rooted at a node v”, we uniquely represented by a MDD. This strong property makes actually mean its CDD graph is rooted at v. equivalence checking of two MDDs efficient, which is crit- A CDD G = hΓ, Gi rooted at a CDD node v represents ical for their traditional use. For CDD, however, as a repre- the constraint Γ ∧ [[v]] where sentation for general n-ary constraints, we argue flexibility (e.g. being able to make use of global constraints at ease) is true : v = 1 more important, while keeping a canonical form is optional. [[v]] ≡ false : v = 0 m m Example 4 Consider a CSP P with three variables x1, x2 (cj ∧ [[uj]]) : v = {(cj ,uj )} j=1 j=1 and x3. All variables have a domain {1, 2, 3}. The con- W S Let Γ be a set of constraints. In an abuse of notation, straint is that the variables must take distinct values, i.e., we define two CDD nodes u and v are equivalent w.r.t. Γ, C = {x1 6= x2,x2 6= x3,x1 6= x3}. Figure 3 depicts three possible CDDs for C. The left one (a) is a MDD rep- written as u ≡Γ v, if and only if [[u]] ≡Γ [[v]]. resentation. The integer d in a node means the valuation Example 1 Figure 2 shows a CDD G = hΓ, Gi. Let c11 ≡ xi 7→ d. We draw out-going edges to the 0-terminal as dashed arrows. The middle one (b) shows a CDD based Γ ≡ x2 6= x3 on a set of disequality constraints xi 6= xj.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-