Solving Difficult Csps with Relational Neighborhood Inverse Consistency
Total Page:16
File Type:pdf, Size:1020Kb
Proceedings of the Twenty-Fifth AAAI Conference on Artificial Intelligence Solving Difficult CSPs with Relational Neighborhood Inverse Consistency Robert J. Woodward1 Shant Karakashian1 Berthe Y. Choueiry1 Christian Bessiere2 1Constraint Systems Laboratory, University of Nebraska-Lincoln, USA {rwoodwar|shantk|choueiry}@cse.unl.edu 2LIRMM-CNRS, University of Montpellier, France [email protected] Abstract 1. Enforcing it is light in terms of space requirements (in- verse consistency is enforced by filtering the variables do- Freuder and Elfe (1996) introduced Neighborhood In- mains), and verse Consistency (NIC) as a strong local consistency property for binary CSPs. While enforcing NIC can 2. It focuses the attention on where a variable’s value most significantly filter the variables domains, the proposed tightly interacts with the problem, namely its neighbor- algorithm is too costly to be used on dense graphs or hood. for lookahead during search. In this paper, we intro- Despite its promise and filtering effectiveness, NIC remains duce and characterize Relational Neighborhood Inverse relatively unexploited because the algorithm for enforcing it Consistency (RNIC) as a local consistency property that operates on the dual graph of a non-binary CSP. We de- is too costly in terms of processing time, which prevented scribe and characterize a practical algorithm for enforc- its use on dense networks or in a lookahead scheme during ing it. We argue that defining RNIC on the dual graph backtrack search. unveils unsuspected opportunities to reduce the compu- In this paper, we revisit NIC and generalize it to Re- tational cost of our algorithm and increase its filtering lational Neighborhood Consistency (RNIC) for non-binary effectiveness. We show how to achieve those effects CSPs. We characterize RNIC and describe an effective al- by modifying the topology of the dual graph, yielding gorithm for enforcing it that operates on the dual encoding new variations the RNIC property. We also introduce of the CSP. We also introduce weakened and strengthened an adaptive strategy to automatically select the appro- variations of this property to cope with the difficulties raised priate property to enforce given the connectivity of the by the topology of the dual graph, and propose a strategy dual graph. We integrate the resulting techniques as full lookahead strategies in a backtrack search procedure for for automatically choosing the property to enforce. We in- solving CSPs, and demonstrate the effectiveness of our tegrate our algorithm as a full lookahead strategy in a back- approach for solving known difficult benchmark prob- track search procedure for solving CSPs. We compare its lems. performance, on difficult benchmark problems, with that of GAC2001 (Bessiere` et al. 2005) and the recently intro- duced algorithms for m-wise consistency (i.e., wR(∗,m)C 1 Introduction for m =2, 3, 4 of (Karakashian et al. 2010)). We conclude that the proposed techniques for enforcing RNIC Solving difficult Constraint Satisfaction Problems (CSPs) 1. Achieve strong local consistency on non-binary CSPs and remains a challenge today despite the dramatic advances of can be effectively used in a full lookahead scheme during hardware technology. To counter the exponential growth of search. the size of the search space of CSPs, consistency properties and algorithms for enforcing them have been proposed since 2. Enjoy the low space requirements of domain-filtering al- the inception of Constraint Programming (CP). Lower lev- gorithms, such as GAC, and the pruning effectiveness of els of consistency, such as Arc Consistency (AC) for binary relation-filtering algorithms, such as R(∗,m)C. constraints and Generalized Arc Consistency (GAC) for 3. Unlike R(∗,m)C, they are not hampered by the difficulty non-binary constraints, are commonly and advantageously of choosing the appropriate consistency level to enforce; used. However, solving difficult problems often requires en- and, finally. forcing higher orders consistency, which typically requires the use of more costly algorithms in time and/or in space. 4. Locally adjust the consistency level enforced to the con- Freuder and Elfe (1996) introduced Neighborhood Inverse nectivity of each vertex in the dual graph. Consistency (NIC) for binary CSPs as a particularly promis- This paper is structured as follows. Section 2 reviews ing consistency property because: background information about CSPs. Section 3 introduces RNIC and an algorithm for enforcing it on the dual encod- Copyright c 2011, Association for the Advancement of Artificial ing of the CSP. Section 4 discusses three variations of RNIC Intelligence (www.aaai.org). All rights reserved. obtained by removing redundant edges in the dual graph 112 and/or triangulating the considered graph, and a strategy for A A R R R deciding which of the four properties to enforce. The goal 1 4 3 B G of this deliberation is to reduce computational cost and/or E C F G D strengthen propagation depending on the topology of the B D E C dual graph. Section 5 reviews the state of the art in relational R R consistency. Section 6 discusses our experimental results. 2 5 F Finally, Section 7 discusses the extension of our approach to Figure 1: Hypergraph. Figure 2: Primal graph. relations specified as conflicts or in intension and concludes R R R R this paper with directions for future research. 1 ABD B BCF 2 R 1 ABD B BCF 2 R CF 5 CF 5 AD A C AD 2 Background CG CFG CG CFG AE AE A Constraint Satisfaction Problem (CSP) is defined by P = R4 ADE ACEG R3 R4 ADE ACEG R3 (V, D, C) where V is a set of variables, D is a set of domains, Figure 3: Dual graph. Figure 4: No redundant edges. and C is a set of constraints. Each variable Vi ∈Vhas a finite domain Di ∈D, and is constrained by a subset of the constraints in C. Each constraint Ci ∈Cis specified R Consistency (NIC) introduced, for binary CSPs, in (Freuder by a relation i defined on a subset of the variables, called and Elfe 1996). NIC ensures that every value in the domain scope(Ri) the scope of the relation and denoted . Given a of a variable can be extended to a solution of the subprob- relation Ri, a tuple τi ∈ Ri is a vector of allowed values for R lem induced by the variable and the variables in its neigh- the variables in the scope of i. Solving a CSP corresponds borhood. Algorithms for enforcing GAC and NIC typically to finding an assignment of a value to each variable such that operate by filtering the domains of the variables. In (2010), all the constraints are satisfied. Karakashian et al. introduced the property R(∗,m)C with A binary CSP is represented by its constraint graph where m ≥ 2, which ensures that every tuple in every relation can the vertices are the variables of the CSP and the edges rep- be extended in a consistent assignment to every combination resent the constraints. A non-binary CSP is similarly repre- of m−1 relations in the problem. Using the terminology in- sented by its hypergraph where the hyperedges represent the troduced in (Debruyne and Bessiere` 1997), we say that a non-binary constraints. Another graphical representation of consistency property p is stronger than another one p if, in a non-binary CSP is the primal graph where the vertices are any CSP where p holds, p also holds. Further, we say that the CSP variables and edges connect every two vertices cor- p is strictly stronger than p if p is stronger than p and there responding to variables in the scope of a relation (Dechter exists at least one CSP in which p holds but p does not. We 2003). Neigh(Vi) denotes the set of variables that are ad- p p p p V say that and are equivalent when is stronger than jacent to i the constraint graph of a binary CSP and the and vice versa. Finally, we say that that p and p are in- primal graph of a non-binary CSP. The dual encoding of a comparable when there exists at least one CSP in which p CSP P is a binary CSP whose variables are the relations of p P holds but does not, and vice versa. In practice, when a , their domains are the tuples of those relations, and the consistency property is stronger (respectively, weaker) than constraints enforce equalities over the shared variables. The another, enforcing the former never yields less (respectively, representation as a graph of this encoding is the dual graph more) pruning than enforcing the latter on the same problem. of the CSP. Neigh(Ri) denotes the set of relations adjacent to a relation Ri in the dual graph. Janssen et al. (1989) and Dechter (2003) observed that, in the dual graph, an edge be- 3 Relational NIC tween two vertices is redundant if there exists an alternate The algorithm for enforcing NIC on binary CSPs of (Freuder path between the two vertices such that the shared variables and Elfe 1996) was tested in a preprocessing step to back- appear in every vertex in the path. Redundant edges can be track search on instances whose constraint density1 did not removed without affecting the set of solutions. Janssen et al. exceed 4.25%. Despite its pruning power and light space (1989) introduced an efficient algorithm for computing the overhead, NIC received relatively little attention in the liter- minimal dual graph by removing redundant edges. Many ature, likely because of the prohibitive cost of the algorithm minimal graphs may exist, but all are guaranteed to have the for enforcing it. Below, we introduce RNIC, a generaliza- same number of edges. Figures 1, 2, 3, and 4 illustrate the tion of NIC to non-binary CSPs, and characterize it.