The constraint satisfaction problem (CSP) is a popular used paradigm to model a wide spectrum of optimization problems in artificial intelligence. This paper presents a fast metaheuristic for solving binary constraint satisfaction problems. The method can be classified as a variable depth search metaheuristic combining a greedy local search using a selfadaptive weighting strategy on the constraint weights. Several metaheuristics have been developed in the past using various penalty weight mechanisms on the constraints. What distinguishes the proposed metaheuristic from those developed in the past is the update of
Organizations like companies or public institutions are confronted in their daily life with a large number of combinatorial optimization problems which occur in many different application domains such as Operations Research (e.g., scheduling and assignment), hardware design (verification and testing, placement and layout), financial decision making (option trading or portfolio management), or even biology (DNA sequencing). The domain of combinatorial optimization refers to optimization problems where the search space (i.e., the set of all feasible solutions) is discrete. The constraint satisfaction problem (CSP) which can model a wide spectrum of combinatorial optimization problems rising in the field of artificial intelligence has become an important field of study in both theoretical and applied computer science. Constraint technology is making a considerable commercial impact worldwide due to its ability to solve highly complex applications operating in the most difficult environment counting on firstclass technology to perform the job. ILOG and Cosytec are two of the leading companies producing software based on this technology. A large number of systems based on the constraints technology have been developed. Examples include the APACHE system [
The CSP consists of assigning values to variables while satisfying certain constraints. Constraints can be given explicitly, by listing all possible tuples or implicitly, by describing a relation in some mathematical form. As a domain example, consider problems that occur in production scheduling. Scheduling is concerned with the allocation of resources to activities with the goal of optimizing some performance objectives while satisfying certain restrictions or constraints. Depending on the problem posed, resources may refer to machines, humans, and so forth, activities could be manufacturing operations, objectives could be the minimization of the schedule length, and finally constraints may state the precedence relationship among activities as they govern the schedule solution.
A CSP is a tuple
A solution to a CSP requires the assignment of values to each of the variables from their domains such that all the constraints on the variables are satisfied. In this paper, attention is focused on binary CSPs, where all constraints are binary; that is, they are based on the Cartesian product of the domains of two variables. However, any nonbinary CSP can theoretically be converted to a binary CSP [
Systematic search algorithms rely on a systematic way in their exploration of the search space. These methods [
Traditional local search algorithms for solving CSP problems start from an initial solution
Randominitialsolution (): the algorithm starts building an initial solution. The initial solution is simply constructed by assigning to each variable
AssignInitialWeights (): during this step the algorithm assigns a fixed amount of weight equal to 1 across all the constraints (Line 6 of Algorithm
Stopping criterion: the outer loop (Line 7 of Algorithm
Randomselectedvariable (): a starting random variable from which the searching process begins is selected and added to the set
Inner loop: the inner loop (Lines: 12, 13, 14, 15, 16, 17, and 18 of Algorithm
(1)
(2) Let
(3) Let
(4) Let
(5) RandomInitialSolution ();
(6) AssignInitialWeights ();
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17) UpdateScore of Neigh (
(18)
(19)
(20)
(21)
(22) Assign all the variables up to the index
(23)
(24) Assign the variable at the index 1 with its new best value;
(25)
(26)
(27)
(28)
Equations (
Highest cumulative score: an iteration of the algorithm terminates when the set
AdjustWeights: finally, the algorithm proceeds with the weighting process divided into two distinct steps (Line 25 of Algorithm
The performance of the metaheuristic (VNSCSP) has been tested on hard random CSP problems taken from Lecoutres benchmark [
Solvable instances.
Instance  Variables  Values  Constraints  Nogood  Solved 

frb30151.csp  30  15  284  56  Yes 
frb30152.csp  30  15  284  56  Yes 
frb30153.csp  30  15  284  56  Yes 
frb30154.csp  30  15  284  56  Yes 
frb30155.csp  30  15  284  56  Yes 


frb35151.csp  35  17  346  72  Yes 
frb35152.csp  35  17  346  72  Yes 
frb35153.csp  35  17  346  72  Yes 
frb35154.csp  35  15  346  72  Yes 
frb35155.csp  35  15  346  72  Yes 


frb40191.csp  40  19  410  90  Yes 
frb40192.csp  40  19  410  90  Yes 
frb40193.csp  40  19  410  90  Yes 
frb40194.csp  40  19  410  90  Yes 
frb40195.csp  40  19  410  90  Yes 


frb45211.csp  45  21  476  110  Yes 
frb45212.csp  45  21  476  110  Yes 
frb45213.csp  45  21  476  110  Yes 
frb45214.csp  45  21  476  110  Yes 
frb45215.csp  45  21  476  110  Yes 


frb53243.csp  53  24  585  144  Yes 
Benchmark instances: unsolvable instances.
Instance  Variables  Values  Constraints  Nogood  Solved 

frb50231.csp  50  23  544  132 

frb50232.csp  50  23  544  132 

frb50233.csp  50  23  544  132 

frb50234.csp  50  23  544  132 

frb50235.csp  50  23  544  132 



frb53241.csp  53  24  585  144 

frb53242.csp  53  24  585  144 

frb53244.csp  53  24  585  144 

frb53245.csp  53  24  585  144 



frb56251.csp  56  25  627  156 

frb56252.csp  56  25  627  156 

frb56253.csp  56  25  627  156 

frb56254.csp  56  25  627  156 

frb56255.csp  56  25  627  156 



frb59261.csp  59  26  669  169 

frb59262.csp  59  26  669  169 

frb59263.csp  59  26  669  169 

frb59264.csp  59  26  669  169 

frb59265.csp  59  26  669  169 

The plots depicted in Figures
Benchmark instances: all unsolved instances solved.
Execution time and success ratio  

Instances  Min (sec)  Max (sec)  Mean (sec)  Success ratio 
frb30151.csp  0.18  0.20  0.19  100% 
frb30152.csp  0.15  0.17  0.16  100% 
frb30153.csp  0.16  0.17  0.17  100% 
frb30154.csp  0.18  0.19  0.19  100% 
frb30155.csp  0.14  0.23  0.20  100% 
frb35171.csp  0.22  0.27  0.25  100% 
frb35172.csp  0.29  0.42  0.31  100% 
frb35173.csp  0.21  0.25  0.24  100% 
frb35174.csp  0.20  0.23  0.22  100% 
frb35175.csp  0.27  0.30  0.28  100% 
frb40191.csp  0.37  0.42  0.41  100% 
frb40192.csp  0.34  0.38  0.36  100% 
frb40193.csp  0.41  0.43  0.42  100% 
frb40194.csp  0.36  0.42  0.38  100% 
frb40195.csp  0.39  0.41  0.40  100% 
frb45211.csp  0.50  0.54  0.52  100% 
frb45212.csp  0.52  0.55  0.54  100% 
frb45213.csp  0.60  0.66  0.62  100% 
frb45214.csp  0.54  0.56  0.54  100% 
frb45215.csp  0.53  0.58  0.56  100% 
frb50234.csp  0.78  0.86  0.81  100% 
frb53242.csp  0.87  0.92  0.89  100% 



0.72  0.84  0.79  100% 

0.73  0.76  0.75  100% 

0.86  0.93  0.88  100% 

0.77  0.81  0.80  100% 

0.95  1.01  0.98  100% 

0.88  0.95  0.87  100% 

1.05  1.09  1.07  100% 

1.15  1.18  1.17  100% 

1.20  1.22  1.21  100% 

0.99  1.03  1.01  100% 

1.01  1.05  1.02  100% 

0.98  0.99  0.99  100% 

1.09  1.14  1.11  100% 

1.24  1.33  1.30  100% 

1.22  1.26  1.24  100% 

1.31  1.34  1.32  100% 

1.30  1.32  1.31  100% 

1.23  1.27  1.24  100% 
Evolution of the number of satisfied constraints: (a) frb59261 and (b) frb56252.
Evolution of the number of satisfied constraints: (a) frb53244 and (b) frb50231.
Evolution of the number of satisfied constraints and the sum of weights of satisfied constraints for frb59263 during the diversification phase.
Evolution of the number of satisfied constraints and the sum of weights of satisfied constraints for frb59263 during the intensification phase.
Impact of the nonweight mechanism on the algorithm’s convergence for frb50233.
Tables
Comparing various solvers: frb30 instances.
Solver  frb30151  frb30153  frb30154  frb30155 

VNSCSP 




Abscon112v4  0.91  1.41  1.33  1.65 
Abscon 112v4ESAC  0.88  1.36  1.35  1.67 
Bpsolver09  0.67  2.49  2.59  1.3 
Choco2.1.1  1.48  2.21  2.55  1.58 
Choco2.1.1b  1.82  1.14  2.33  0.90 
Concrete  1.89  1.25  2.20  1.75 
Concrete DC  2.59  2.94  3.30  2.41 
Conquer  2.45  2.77  1.00  1.61 
Mistral  0.21  0.22  0.26  0.08 
pcs  3.05  2.51  1.93  1.07 
pcsrestart  4.92  0.55  2.55  0.70 
SAT4JCSP  3.74  4.81  5.50  3.95 
Sugarv1.14.6 + minisat  3.3  1.17  1.97  1.15 
Sugarv1.14.6 + picosat  2.11  1.47  1.81  1.57 
Comparing various solvers: frb35 instances.
Solver  frb35171  frb35172  frb35174 

VNSCSP 



Abscon112v4  4.37  6.71  3.54 
Abscon 112v4ESAC  3.92  6.38  3.87 
Bpsolver09  16.81  67.03  25.30 
Choco2.1.1  4.02  35.90  8.47 
Choco2.1.1b  5.40  16.27  1.70 
Concrete  5.20  10.86  4.49 
Concrete DC  6.68  7.05  5.83 
Conquer  2.74  14.73  5.57 
Mistral  0.64  3.08  0.25 
pcs  42.05  27.39  8.15 
pcsrestart  47.99  27.07  1.94 
SAT4JCSP  51.20  212.57  43.08 
Sugarv1.14.6 + minisat  13.69  25.35  4.17 
Sugarv1.14.6 + picosat  14.89  4.72  14.37 
Comparing various solvers: frb40 instances.
Solver  frb40191  frb40194  frb40195 

VNSCSP 



Abscon112v4  1.30  82.98  37.29 
Abscon112v4ESAC  1.32  79.60  36.6 
Bpsolver09  361.45  137.45  199.04 
Choco2.1.1  25.43  24.33  161.97 
Choco2.1.1b  25.43  24.33  161.97 
Concrete  15.36  87.77  177.15 
Concrete DC  21.27  114.80  89.01 
Conquer  21.66  9.49  94.78 
Mistral  2.15  7.73  63.46 
pcs  1758.00  —  — 
pcsrestart  —  —  1107.76 
SAT4JCSP  272.64  500.71  10.49 
Sugarv1.14.6 + minisat  48.30  186.73  — 
Sugarv1.14.6 + picosat  41.52  364.37  297.49 
Comparing various solvers: frb45 and frb53 instances.
Solver  frb45212  frb45214  frb45215  frb53243 

VNSCSP 




Abscon112v4  275.31  478.01  1228.41  1342 
Abscon112v4ESAC  284.00  441.30  1194.47  245.31 
Bpsolver09  —  —  —  — 
Choco2.1.1  1305.51  65.05  1635.94  — 
Choco2.1.1b  423.62  217.20  89.18  — 
Concrete  394.55  330.23  672.39  — 
Concrete DC  498.34  359.80  1023.49  — 
Conquer  800.71  716.26  878.97  — 
Mistral  224.39  66.05  121.84  — 
pcs  —  —  —  — 
pcsrestart  —  —  —  — 
SAT4JCSP  —  —  —  — 
Sugarv1.14.6 + minisat  56.95  —  1114.95  — 
Sugarv1.14.6 + picosat  795.52  —  —  — 
Comparing VNSCSP with tabu and ACO metaheuristics.
Instances  ACOSSP (vertex)  ACOSSP (clique)  Tabu  VNSCSP 

frb3015  5 ( 
5 ( 
5 ( 
5 ( 
frb3517  5 ( 
5 ( 
5 ( 
5 ( 
frb4019  5 ( 
5 ( 
5 ( 
5 ( 
frb4521  5 ( 
5 ( 
5 ( 
5 ( 
frb5023  3 ( 
3 ( 
4 ( 
5 ( 
frb5324  3 ( 
3 ( 
4 ( 
5 ( 
frb5625  2 ( 
2 ( 
4 ( 
5 ( 
frb5926  1 ( 
0 (—)  4 ( 
5 ( 
This paper proposes a variable depth search algorithm for the CSP problem. The heart of the metaheuristic relies on a combination between an adaptive weighting strategy on the constraint weights and a greedy search. This combination proved to be an excellent mechanism to guide the search in order to achieve a suitable tradeoff between intensification and diversification. The proposed metaheuristic has been experimentally evaluated on hard random CSP problems belonging to RBModel. The difficulty of solving some of these problems by stateoftheart solvers highlights the capabilities of the proposed metaheuristic. Indeed, the experimental results have been very positive, solving all unsolvable instances in very short computational times. Most metaheurirics have a predefined set of parameters that has to be calibrated with respect to the problem at hand. This parameter tuning which becomes a tedious task as the number of parameter increases plays a significant impact on the solving progress and therefore the solution quality. What distinguishes the proposed metaheuristic from stateoftheart techniques is the absence of parameter tuning making it highly suitable in practical scenarios.
The author declares that there is no conflict of interests regarding the publication of this paper.