On the encoding of constraint satisfaction problems with 0/1 variables (original) (raw)

A Study of Encodings of Constraint Satisfaction Problems with 0/1 Variables

CoLogNet Publications, 2002

Many constraint satisfaction problems (csp's) are formulated with 0/1 variables. Sometimes this is a natural encoding, sometimes it is as a result of a reformulation of the problem, other times 0/1 variables make up only a part of the problem. Frequently we have constraints that restrict the sum of the values of variables. This can be encoded as a simple summation of the variables. However, since variables can only take 0/1 values we can also use an occurrence constraint, e.g. the number of occurrences of 1 must be k. Would this make a difference? Similarly, problems may use channelling constraints and encode these as a biconditional such as P ↔ Q (i.e. P if and only if Q). This can also be encoded in a number of ways. Might this make a difference as well? We attempt to answer these questions, using a variety of problems and two constraint programming toolkits. We show that even minor changes to the formulation of a constraint can have a profound effect on the run time of a constraint program and that these effects are not consistent across constraint programming toolkits. This leads us to a cautionary note for constraint programmers: take note of how you encode constraints, and don't assume computational behaviour is toolkit independent.

Distributing constraints by sampling in non-binary CSPs

2004

Nowadays, many real problems can be modeled as Constraint Satisfaction Problems (CSPs). Generally, these problems are solved by search algorithms, which require an order in which variables and values should be considered. Choosing the right order of variables and values can noticeably improve the efficiency of constraint satisfaction. The order in which constraints are studied can also improve efficiency, particularly in problems with non-binary constraints.

A Study of Encodings of Constraint Satisfaction

Many constraint satisfaction problems (csp's) are formulated with 0/1 variables. Sometimes this is a natural encoding, sometimes it is as a result of a reformulation of the problem, other times 0/1 variables make up only a part of the problem. Frequently we have constraints that restrict the sum of the values of variables. This can be encoded as a simple summation of the variables. However, since variables can only take 0/1 values we can also use an occurrence constraint, e.g. the number of occurrences of 1 must be k. Would this make a difference? Similarly, problems may use channelling constraints and encode these as a biconditional such as P ↔ Q (i.e. P if and only if Q). This can also be encoded in a number of ways. Might this make a difference as well? We attempt to answer these questions, using a variety of problems and two constraint programming toolkits. We show that even minor changes to the formulation of a constraint can have a profound effect on the run time of a constraint program and that these effects are not consistent across constraint programming toolkits. This leads us to a cautionary note for constraint programmers: take note of how you encode constraints, and don't assume computational behaviour is toolkit independent.

Weighted constraint satisfaction with set variables

2006

Abstract Set variables are ubiquitous in modeling (soft) constraint problems, but efforts on practical consistency algorithms for Weighted Constraint Satisfaction Problems (WCSPs) have only been on integer variables. We adapt the classical notion of set bounds consistency for WC-SPs, and propose efficient representation schemes for set variables and common unary, binary, and ternary set constraints, as well as cardinality constraints.

Valued Constraint Satisfaction Problems: Hard and Easy Problems

1995

In order to deal with over-constrained Constraint Satisfaction Problems, various extensions of the CSP framework have been considered by taking into account costs, uncertainties, preferences, priorities...Each extension uses a specific mathematical operator (+, max...) to aggregate constraint violations. In this paper, we consider a simple algebraic framework, related to Partial Constraint Satisfaction, which subsumes most of these proposals and use it to characterize existing proposals in terms of rationality and computational complexity. We exhibit simple relationships between these proposals, try to extend some traditional CSP algorithms and prove that some of these extensions may be computationally expensive.

Binary vs. non-binary constraints☆☆This paper includes results that first appeared in [1,4,23]. This research has been supported in part by the Canadian Government through their NSERC and IRIS programs, and by the EPSRC Advanced Research Fellowship program

Artificial Intelligence, 2002

There are two well known transformations from non-binary constraints to binary constraints applicable to constraint satisfaction problems (CSPs) with finite domains: the dual transformation and the hidden (variable) transformation. We perform a detailed formal comparison of these two transformations. Our comparison focuses on two backtracking algorithms that maintain a local consistency property at each node in their search tree: the forward checking and maintaining arc consistency algorithms. We first compare local consistency techniques such as arc consistency in terms of their inferential power when they are applied to the original (non-binary) formulation and to each of its binary transformations. For example, we prove that enforcing arc consistency on the original formulation is equivalent to enforcing it on the hidden transformation. We then extend these results to the two backtracking algorithms. We are able to give either a theoretical bound on how much one formulation is better than another, or examples that show such a bound does not exist. For example, we prove that the performance of the forward checking algorithm applied to the hidden transformation of a problem is within a polynomial bound of the performance of the same algorithm applied to the dual transformation of the problem. Our results can be used to help decide if applying one of these transformations to all (or part) of a constraint satisfaction model would be beneficial.

Linear programming for constraint satisfaction problems

2023

A novel representation is described that models some important NP-hard problems, such as the propositional satisfiability problem (SAT), the Traveling Salesperson Problem (TSP), and the Minimal Set Covering Problem (MSCP) by means of only two types of constraints:'choiceconstraints'and 'exclusion constraints'. In its main section the paper presents an approach for solving a m-CNF-SAT problem (Conjunctive Normal Form Satisfaction: n variables, p clauses, clause length m) by integer programming. The approach is unconventional, because 2n distinct 0-1 variables are used for each clause of the m-CNF-SAT problem. The constraint matrix A forces that for every clause exactly one 0-1 variable is set equal to 1 (choice constraint), and no two 0/1 variables, representing a literal and its complement, are both set equal to 1 (exclusion constraints). The particular m-CNF-SAT instance is coded in a cost vector, which serves for maximization of the number of satisfied clauses. The paper presents a 0/1 Simplex for solving the obtained integer program. A main theorem of the paper is that this algorithm always finds a 0-1 integer solution. A solution of the integer program corresponds to a solution of the m-CNF-SAT and vice versa. The same modelling technique is then used for the Traveling Salesperson Problem and for the Minimal Set Covering: it is shown that a uniform approach is thus useful. Black A., J.A. De Loera, S. Kafer and Laura Sanità [Bla2021] present new pivot rules for the Simplex method for LP over 0/1 polytopes such as ours, that require only polynomial steps in the number of variables, and give the proof. Thus, based on this result and using these pivot rules for our CNF-SAT solver Simplex algorithm, we find a solution in polynomial time. The complexity of CNF-SAT is NP-complete.

A new model of hard binary constraint Satisfaction Problems

Lecture Notes in Computer Science, 1996

The phase transition for randomly generated binary Constraint Satisfaction Problems (CSPs) has recently been investigated by Smith[10], Smith & Dyer[Ill, and Prosser[8, 9]. It was found that in most cases one can accurately predict where the phase transition occurs using a predictor based on the expected number of solutions. Their results are based on a parameterization of CSPs that has a global constraint tightness value, that is, each constraint has the same tightness. In this paper we generalize their results using a parameterization of CSPs that has local constraint tightness values. We give a refined version of their predictor which incorporates the local graph topology of each individual CSP. It is shown that there is a similar phase transition in which constraint tightness does not have to be a global value and that the refined predictor better predicts the location of this phase transition. We also show that random problems generated with the refined predictor are as hard or harder to search than problems generated with the old predictor. Our results indicate that harder phase transitions can be found for NPcomplete problems by generalizing the parameterizations used to model the problem in appropriate ways to include the structure of an individual problem.

Disjunction of non-binary and numeric Constraint satisfaction Problems

Topics in Artificial Intelligence, 2002

Nowadays, many researchers are working on Constraint Satisfaction Problems (CSPs). Many CSPs can be modelled as non-binary CSPs and, theoretically, they can be transformed into an equivalent binary CSP, using some of the current techniques. However, this transformation may be an inadequate or inefficient way to manage certain types of non-binary constraints. In this paper, we propose an algorithm called DHSA that solves numeric non-binary CSPs with disjunctions in a natural way, as non-binary disjunctive CSP solver. This proposal extends the class of Horn constraint, originally studied by Koubarakis, since DHSA manages disjunctions of linear inequalities and disequations with any number of inequalities per disjunction. This proposal works on a polyhedron whose vertices are also polyhedra that represent the non-disjunctive problems. This non-binary disjunctive CSP solver translates, in a preprocess step, the disjunctive problem into a non-disjunctive one by means of a statistical preprocess step. Furthermore, a Constraint Ordering Algorithm (COA) classifies the resultant constraints from the most restricted to the least restricted one. This preprocess step can be applied to other disjunctive CSP solvers in order to find a solution earlier.

A filtering technique to achieve 2-consistency in constraint satisfaction problems

2012

Arc-Consistency algorithms are the most commonly used filtering techniques to prune the search space in Constraint Satisfaction Problems (CSPs). 2-consistency is a similar technique that guarantees that any instantiation of a value to a variable can be consistently extended to any second variable. Thus, 2-consistency can be stronger than arc-consistency in binary CSPs. In this work we present a new algorithm to achieve 2consistency called 2-C4. This algorithm is a reformulation of AC4 algorithm that is able to reduce unnecessary checking and prune more search space than AC4. The experimental results show that 2-C4 was able to prune more search space than arc-consistency algorithms in non-normalized instances. Furthermore, 2-C4 was more efficient than other 2-consistency algorithms presented in the literature.