Next Article in Journal
A Modified Residual Power Series Method for the Approximate Solution of Two-Dimensional Fractional Helmholtz Equations
Previous Article in Journal
Algebraic Structures on Smooth Vector Fields
Previous Article in Special Issue
Symmetric Multi-Scale Residual Network Ensemble with Weighted Evidence Fusion Strategy for Facial Expression Recognition
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Two Improved Constraint-Solving Algorithms Based on lmaxRPC3rm

1
College of Computer Science and Technology, Jilin University, No. 2699 Qianjin Street, Changchun 130012, China
2
Key Laboratory of Symbolic Computation and Knowledge Engineering of Ministry of Education, Jilin University, No. 2699 Qianjin Street, Changchun 130012, China
*
Author to whom correspondence should be addressed.
Symmetry 2023, 15(12), 2151; https://doi.org/10.3390/sym15122151
Submission received: 12 September 2023 / Revised: 17 November 2023 / Accepted: 23 November 2023 / Published: 3 December 2023
(This article belongs to the Special Issue Symmetry/Asymmetry and Fuzzy Systems)

Abstract

:
The Constraint Satisfaction Problem (CSP) is a significant research area in artificial intelligence, and includes a large number of symmetric or asymmetric structures. A backtracking search combined with constraint propagation is considered to be the best CSP-solving algorithm, and the consistency algorithm is the main algorithm used in the process of constraint propagation, which is the key factor in constraint-solving efficiency. Max-restricted path consistency (maxRPC) is a well-known and efficient consistency algorithm, whereas the lmaxRPC3 r m algorithm is a classic lightweight algorithm for maxRPC. In this paper, we leverage the properties of symmetry to devise an improved pruning strategy aimed at efficiently diminishing the problem’s search space, thus enhancing the overall solving efficiency. Firstly, we propose the maxRPC3 s i m algorithm, which abandons the two complex data structures used by lmaxRPC3 r m . We can render the algorithm to be more concise and competitive compared to the original algorithm while ensuring that it maintains the same average performance. Secondly, inspired by the RCP3 algorithm, we propose the maxRPC3 s i m R algorithm, which uses the idea of residual support to cut down the redundant operation of the lmaxRPC3 r m algorithm. Finally, combining the domain/weighted degree (dom/wdeg) heuristic with the activity-based search (ABS) heuristic, a new variable ordering heuristic, ADW, is proposed. Our heuristic prioritizes the selection of variables with symmetry for pruning, further enhancing the algorithm’s pruning capabilities. Experiments were conducted on both random and structural problems separately. The results indicate that our two algorithms generally outperform other algorithms in terms of performance on both problem classes. Moreover, the new heuristic algorithm demonstrates enhanced robustness across different problem types when compared to various existing algorithms.

1. Introduction

The Constraint Satisfaction Problem (CSP), as a classic problem of artificial intelligence [1,2], has garnered significant attention from researchers since it was proposed, and it encompasses numerous symmetric and asymmetric structures [3,4]. Related technologies are widely used in the fields of configuration, scheduling, and combinatorial problem solving. A CSP selects a value from a given finite domain for each variable involved in the problem to satisfy the constraints among variables. Generally, CSPs are NP-hard problems [5]. At present, a backtracking search combined with constraint propagation is a classical algorithm used to solve CSPs [6]. This algorithm aims to reduce the symmetrical structure within the problem and eliminate redundant operations. Identifying and locating these symmetric structures are critical areas of focus. Constraint propagation is a common technique that utilizes local consistency to eliminate a subset of inconsistent ethics. There are several tried-and-tested consistency algorithms, including arc consistency (AC) [7], singleton arc consistency (SAC) [8], path consistency (PC) [9], and maxRPC [10].
Enhancing the efficiency of the maxRPC algorithm has been a major focus of research for decades since the development of the algorithm. MaxRPC was initially presented by Debruyne et al. in 1997 [11], as one of the most important local consistencies, which extends RPC, and a maxRPC algorithm maxRPC1 based on AC6 was proposed [11]. Grandoni et al. proposed the maxRPC2 algorithm in 2003, which reduces the space complexity without increasing the time complexity by not storing the found witness [12]. In 2009, Vion and other scholars proposed a backtracking stable and efficient residual data structure, which can achieve the maximum maxRPC domain filtering consistency with the minimum memory consumption in the search process [13]. On the basis of the AC-3 r m algorithm [14], two algorithms maxRPC r m and lmaxRPC r m were proposed. Compared with the best maxRPC algorithm at that time, they are competitive and easy to implement. In 2010, Balafoutis et al. [15] proposed maxRPC3 and maxRPC3 r m , and their lightweight versions lmaxRPC3 and lmaxRPC3 r m . By reducing some redundant constraint inspections, the existing maxRPC algorithm was further improved. Compared with maxRPC, lmaxRPC achieves a lower consistency level, but it is still stronger than AC. The experiment shows that using lmaxRPC in the search process is more cost-effective than maxRPC. lmaxRPC3 r m competes with or surpasses the maintenance of AC (MAC) [16] on many problems. In recent years, little work has been carried out on maxRPC. In 2017, a new algorithm was proposed by Li et al. that utilizes light symmetry to approximate maxRPC and enhance the residual support. The algorithm also weakens multi-directional use and narrows the search scope [17].
Theoretical and experimental results demonstrate the strong pruning capability of lmaxRPC3 r m . However, the space–time cost does not always meet practical application requirements. Furthermore, designing an effective heuristic function for the pruning strategy is another challenge for the lmaxRPC3 r m algorithm. In our work, we introduce two innovative algorithms to overcome these limitations. This paper primarily leverages the concept of symmetry to prune the variables with a symmetric nature, thereby reducing redundant searches and repeated calculations and enhancing overall solving efficiency. To enhance the selection of symmetrical variables for pruning, we developed an improved variable ranking heuristic to enhance our pruning capabilities. Firstly, we propose the maxRPC3 s i m , a concise maxRPC algorithm, which abandons the complex lastAC and lastPC data structures used in the lmaxRPC3 r m algorithm to store AC support and PC support. In this way, some redundant search operations can be avoided, making the algorithm efficient and easy to implement while reducing time and space costs. The experimental results show that maxRPC3 s i m has certain competitiveness in most problem cases. Secondly, we propose another lmaxRPC algorithm, maxRPC3 s i m R . Inspired by rRPC3 [18], and unlike the lmaxRPC3 r m algorithm that supports storing AC and PC separately, maxRPC3 s i m R uses only one residual support to store AC and PC support. In this way, AC support, PC support, and PC witness are stored and searched, and many redundant residual support accesses are reduced, so that the algorithm can effectively reduce redundant consistent support access and reduce the overhead of time and space. Additionally, we investigate variable ordering heuristics to further enhance search performance. Dom/wdeg and ABS [19], as classic variable sorting heuristics, have been widely used since they were proposed. We propose an improved heuristic ADW (activity + dom/wdeg), which combines dom/wdeg with the ABS heuristic. The improved heuristic can not only bring dom/wdeg into full play but also keep the advantages of ABS. Experiments show that the combination of ADW heuristic and different algorithms has good performance, which further shows that ADW has strong robustness.
The paper is structured into multiple sections. In Section 2, we present an overview of recent related work. Section 3 introduces the preliminaries associated with CSPs. Section 4 and Section 5 present the improvements made to the lmaxRPC3 r m algorithm and the variable ordering heuristic, respectively. The outcomes of experiments conducted on different problem classes are presented in Section 6. Finally, in Section 7, a summary of our work is provided along with suggestions for potential avenues of future research.

2. Related Work

Symmetry in CSP. When solving a problem with a Constraint Satisfaction Problem (CSP) model, it is common to have multiple variables representing multiple instances of the same object. For example, two variables x i and x j can represent two history courses that a class must attend in a week. In the case where x i takes the value Monday at 8 a.m. and x j takes the value Thursday at 9 a.m., or vice versa, it does not affect whether the instantiation solves the problem or not. In such cases, x i and x j are said to be symmetrical. Symmetry detection techniques are employed to prevent the search process from exploring symmetrical subtrees, enabling the pruning of branches in the search tree that contain solutions only if these solutions have a corresponding symmetrical solution elsewhere in the search tree. The issue of symmetry in values was initially addressed by Freuder (1991) [20] through the concept of value interchangeability, which was further extended by Cooper (1997) [21] to include value substitutability. Subsequent studies have extensively investigated various types of symmetries (Benhamou 1994; Gent et al., 2006) [22,23]. Another approach for reducing symmetries when modeling a problem is utilizing set variables instead of integer variables (Gervet and Van Hentenryck 2006) [24,25].
NSCs. Stergiou K. conducted a study to explore the balance between efficiency and ease of implementation in consistency techniques. They focused on neighborhood singleton consistencies (NSCs), which are an extension of the previously proposed neighborhood SAC (NSAC). The study proposes multiple new NSC family members and analyzes them theoretically and experimentally. Theoretical results indicate that the NSCs can provide pruning power ranging between that of RPC and (3,1)-consistency. The study reveals that specific members of the NSC exhibit exceptional competitiveness as versatile propagation techniques for binary constraints, surpassing existing methods in certain problem domains [26].
Interleaved method. The algorithms investigated by Wallace R J employ AC repeatedly under stringent local assumptions to achieve higher levels of consistency. These algorithms establish singleton arc consistency (SAC) in the neighborhood. Most of these algorithms utilize a simple interleaving of AC with the basic SAC procedure. However, the strategy of interleaving weaker and stronger forms of reasoning has not received sufficient attention in its own right. This paper investigates the effects of interleaving and presents novel methods based on this concept. It demonstrates that different problem types exhibit significant variations in their responsiveness to AC interleaving, wherein it proves beneficial in most cases but detrimental for certain algorithms and problem types. Incorporating this feature into SACQ algorithms enhances their consistent and decisive superiority over other SAC algorithms. Additionally, an approach based on AC-4 is considered for interleaving, along with the incorporation of stronger methods than AC [27].
EFCC. Li Z, Yu Z, and their colleagues took a different approach in their research from what had been carried out before. Rather than focusing on strong consistencies, they revisited the effectiveness of weak consistencies. To increase the efficiency of propagation, they proposed algorithms based on bitwise operations. Additionally, they suggested an enhanced version of forward checking consistency (EFCC), which has a stronger pruning ability than FCCs but not as strong as ACs [28].
In recent years, most studies have primarily concentrated on enhancing AC and SAC, while research has seldom been conducted on maxRPC. Nevertheless, maxRPC has demonstrated strong pruning capabilities, as shown in Table 1. Table 1 shows the related work of this paper in order of pruning capabilities (weak to strong) as provided in Reference [29]. Additionally, its lightweight variant, lmaxRPC3 r m , has been proven to possess a strong pruning ability, but there is still a considerable amount of compressible space in terms of the space–time cost. Therefore, we aim to leverage its pruning ability as a foundation for optimization and improvement to enhance solution accuracy while simultaneously reducing the space–time cost.

3. Preliminaries

In this paper, we aim to address the issue of binary constraint satisfaction. A binary CSP is defined as a triple p = X , D , C where X = {x 1 , x 2 , …, x n } represents a set of n variables, D = {D(x 1 ), D(x 2 ), …, D(x n )} represents a set of domains, D(x i ) denotes a discrete finite value domain of variable x i , and C = {c 1 , c 2 , c 3 , …, c e } represents a set of e binary constraints. A binary constraint c i , j is made up of two parts: var(c) and rel(c), where var(c) = {x i , x j } is an ordered set of two variables of X, and rel(c) is a subset of the Cartesian product D(x 1 ) ×…× D(x m ) of the finite value domain of these variables. The tuples in this subset represent the value combination of variables that satisfy the constraint. A binary CSP is typically represented as a constrained graph. The nodes in the graph denote variables, while the edges represent constraints between two adjacent nodes.
Definition 1
(arc consistency, AC). If a value a i belongs to D(x i ), it will be considered an attribute of AC only if it satisfies all constraints c i , j . For each constraint c i , j , there must be a value a j in D(x j ) that satisfies the constraint c i , j when combined with value a i . This value a j is called an AC support of value a i . A variable x i is considered AC if all values in D(x i ) are AC. A problem is attributed to an AC problem if there are no empty domains in D and all variables in X are AC.
Definition 2
(path consistency, PC). In order for a pair of values (a i , a j ) to be attributed to PC, it must be the case that for any third variable x k , there exists a value a k ∈ D(x k ) such that a k is an AC support of both values a i and a j . When these conditions are met, we say that a i is a PC support of the value a i in the variable x j , and that a k is a PC witness for the pair of values (a i , a j ) in the variable x k .
Definition 3
(max-restricted path consistency, maxRPC). To clarify, in a given problem, a value is considered a maxRPC value if it is an AC value and meets the following condition: for every constraint c i , j , there exists a value a j , which is an AC support of the value a i , making the pair (a i , a j ) PC. Similarly, a variable is considered maxRPC if all the values in its domain meet the above criterion. Finally, a problem is considered a maxRPC problem if there are no empty domains in D(x) and all variables in X are maxRPC.
Definition 4
(lightweight max-restricted path consistency, lmaxRPC). The lmaxRPC algorithm is a simplified version of the maxRPC algorithm that only focuses on the loss of AC supports and ignores the loss of PC witnesses. In other words, when removing a variable x j from Q, for each a i ∈ D(x i ), the lmaxRPC algorithm only checks if a i has PC support in D(x j ), without taking into consideration the value in x j as witnesses of the PCs affected by other values. This results in a faster algorithm than AC but slower than maxRPC. lmaxRPC3 and lmaxRPC3 r m are lightweight versions of maxRPC3 and maxRPC3 r m , respectively, that further simplify the process of inspecting missing PC witnesses.

4. New Algorithms for maxRPC

4.1. maxRPC3 s i m

The first improvement algorithm discards the two data structures LastAC and LastPC of the lmaxRPC3 r m algorithm. By selecting symmetric variables for removal at each step, the algorithm’s efficiency and ease of implementation are enhanced by effectively reducing the search space and eliminating redundant operations. We named the new algorithm as maxRPC3 s i m . Algorithm 1 is the main component of maxRPC3 s i m , and the propagation list Q stores the variables of the filtering domain. Adding variables to list Q may occur during initialization or when a PC support is detected. Algorithm 1 goes through every variable in Q. When variable x j is removed from Q (line 2), it is necessary to identify its related variable x i to ensure that they are maxRPC. For every value a i in D(x i ), the function findPCsup (line 5) is called to verify whether each a i value has PC support in D(x j ). Below, we provide a detailed explanation of the function findPCsup. If the function returns FALSE, it means that there is no new PC support in D(x j ) for a i . In such a scenario, Algorithm 1 eliminates a i from D(x i ) (line 6) and adds x i to Q (line 7). After checking all a i values in D(x i ), the algorithm decides whether D(x i ) is empty or not. If it is, the algorithm returns FAILURE.
Algorithm 1 maxRPC3 s i m
1:
while  Q do
2:
     Q Q { x j }
3:
    for each x i ∈ X s.t. c i , j ∈ C do
4:
        for each a i ∈ D(x i ) do
5:
           if ¬ findPCsup(x i , a i , x j ) then
6:
               remove a i
7:
                Q Q { x i }
8:
        if D(x i ) = ∅ then
9:
           return FAILURE
10:
return SUCCESS
The function of Algorithm 2 FindPCsup is used to determine if there is PC support between two variables. The function first checks the arc consistency of (a i , a j ) by calling isTruecon at line 3 for each variable x j and value a j in D(x j ). If isTruecon returns TRUE, then it means that (a i , a j ) satisfies the constraint, indicating that a j supports a i for arc consistency. If the result of isTruecon is TRUE, function 1 then checks whether there is a PC witness a k for (a i , a j ) by calling the findPCwit function. The findPCwit function is explained below. If there is a new PC witness in D(x j ) for a i , then the function returns TRUE, meaning that a j provides a PC support for a i .
Algorithm 2 Function 1 findPCsup(x i , a i , x j )
1:
for each x j X  do
2:
    for each a j ∈ D(x j ) do
3:
        if isTruecon(x i , a i , x j , a j ) then
4:
           if findPCwit(a i , a j ) then
5:
               return TRUE
6:
return FALSE
To verify the existence of a PC witness a k for the pair (a i , a j ), we use the function of Algorithm 3 findPCwit. First, we check whether there exists a value a k on the third variable x k that satisfies the constraints between (x i , x k ) and (x j , x k ) for both (a i , a k ) and (a j , a k ). To do this, we use the isTruecon function. If such a value a k exists, it confirms that there is a PC witness between a i and a j .
Algorithm 3 Function 2 findPCwit(a i , a j )
1:
for each x k ∈ X s.t. c i , k and c j , k ∈ C do
2:
     t h e P C w i t F A L S E
3:
    for each x k ∈ X s.t. c i , k and c j , k ∈ C do
4:
        if isTruecon(x i , a i , x k , a k ) and isTruecon(x j , a j , x k , a k ) then
5:
            t h e P C w i t T R U E
6:
           break
7:
    if ¬ thePCwit then
8:
        return FALSE
9:
return TRUE

4.2. maxRPC3 s i m R

The second improved algorithm is also based on lmaxRPC3 r m . In this enhancement, we use a residual support S to store recently discovered compatibility support. Inspired by the concept of the residual support data structure in the rRPC3 algorithm, we name this new algorithm as maxRPC3 s i m R . The residue is a support used to prove that a given value is PC or AC, located or stored during program execution. Unlike lmaxRPC3 r m , which stores AC and PC support separately, maxRPC3 s i m R only adopts one residual support S to reduce some redundant access. Furthermore, we do not initialize S in the initialization step. Instead, we judge first and then assign values during the algorithm’s propagation process. This targeted assignment strategy effectively minimizes redundant operations.
We omit the detailed introduction of maxRPC3 s i m R in Algorithm 4 because it is the same as Algorithm 1; the only difference is that we use findPCsupR rather than findPCsup.
Algorithm 4 maxRPC3 s i m R
1:
while  Q do
2:
     Q Q { x j }
3:
    for each x i ∈ X s.t. c i , j ∈ C do
4:
        for each a i ∈ D(x i ) do
5:
           if ¬ findPCsupR(x i , a i , x j ) then
6:
               remove a i
7:
                Q Q { x i }
8:
        if D(x i ) = ∅ then
9:
           return FAILURE
10:
return SUCCESS
We also omit the findPCsupR function of Algorithm 5 for maxRPC3 s i m R as it is the same as the findPCsup function with the two differences being that we call it findPCwitR instead of findPCwit and we store the PC support values in the corresponding data structure S to facilitate the subsequent search.
Algorithm 5 Function 3 findPCsupR(x i , a i , x j )
1:
for each x j X  do
2:
    for each a j ∈ D(x j ) do
3:
        if isTruecon(x i , a i , x j , a j ) then
4:
           if findPCwitR(a i , a j ) then
5:
                S ( x i , a i , x j ) ⇐ a j
6:
               return TRUE
7:
return FALSE
Next we explain the findPCwitR function of Algorithm 6 in detail. The findPCwitR function checks each value of x k in two steps. First, it looks for a value S ( x i , a i , x k ) and then checks if the pair (S ( x i , a i , x k ) , a j ) is arc consistent. If the pair is not arc consistent, it moves to the second step. In the second step, it checks for a valued S ( x j , a j , x k ) and verifies whether the pair (S ( x j , a j , x k ) , a i ) is arc consistent. This process is performed at line 2. If a PC witness exists, the above condition returns TRUE and findPCwitR can jump out of this cycle ahead of time. If S does not contain a PC witness for (a i , a j ) that includes a k , then there is no such a k , and then findPCwitR starts a search similar to the findPCwit function and findPCwitR also stores the PC support values into the corresponding data structure S.
Algorithm 6 Function 4 findPCwitR(a i , x j )
1:
for each x k ∈ X s.t. c i , k and c j , k ∈ C do
2:
    if (S ( x i , a i , x k ) and isTruecon(x k , S ( x i , a i , x k ) , x j , a j )) or (S ( x j , a j , x k ) and
3:
      isTruecon(x k , S ( x j , a j , x k ) , x i , a i )) then
4:
         t h e P C w i t T R U E
5:
        continue
6:
    for each a k ∈ D(X k ) do
7:
        if isTruecon(x i , a i , x k , a k ) and isTruecon(x j , a j , x k , a k ) then
8:
            t h e P C w i t T R U E
9:
            S ( x i , a i , x k ) ⇐ a k
10:
          S ( x j , a j , x k ) ⇐ a k
11:
         break
12:
      if ¬ thePCwit then
13:
           return FALSE
14:
return TRUE
Upon analyzing the previously presented pseudocode, it becomes clear that our proposed algorithm as well as the lmaxRPC3 r m and maxRPC3 r m algorithms all have a time complexity of O(n 2 ). However, our algorithms, maxRPC3 s i m and maxRPC3 s i m R , are designed to eliminate redundant structures. maxRPC3 s i m does not use the original algorithm to store AC- and PC-supported LastAC and LastPC data structures, while maxRPC3 s i m R only retains residual support to store compatibility support. We also adjusted the overall data structure of the two new algorithms. As a result, our algorithm has fewer loops and iterations, which makes it less time-consuming. Moreover, the reduction in the number of redundant accesses leads to less space consumption. Furthermore, our experiments show that our algorithm is more efficient in solving the problem as it takes less time.

5. Heuristics for maxRPC Algorithms

Mainstream constraint solvers speed up the solution by using heuristics to order variables or constraint priorities. At present, many AC algorithms use variable ordering heuristics to select the first deleted variables from the propagation list to improve search efficiency [34,35]. The heuristic algorithm used by the AC algorithm can also be applied to the maxRPC algorithm. Although heuristics require extra computation, it is insignificant to the overall cost of the algorithm.
The variable ordering heuristic is responsible for assigning priority to the variables involved, the variables with higher priority are assigned first, while those with lower priority are assigned later. A good variable ordering can often accelerate the process of finding the solution. Classic variable ordering heuristics include dom/ddeg, dom/wdeg, ABS (activity-based Search), etc. After the ABS variable ordering heuristic was proposed, the algorithm-solving efficiency greatly improved. In this section, we employ the concept of symmetry to devise a novel variable ordering heuristic known as ADW (ABS+Dom/wdeg). ADW prioritizes variables with symmetry by sorting them, thereby enhancing the algorithm’s pruning capabilities. Our experimental results demonstrated significant improvements.
(1)
Dom/ddeg heuristic
Dom/ddeg heuristic is a dynamic variable ordering heuristic that combines variable domain size and variable degree. In optimization problems, Dom refers to possible variable values, while ddeg is the number of variable constraints. The dom/ddeg heuristic algorithm works by prioritizing the variable with the smallest ratio of current domain size to dynamic degree in each step. This variable is given the highest priority to be processed next.
(2)
Dom/wdeg heuristic
The Dom/wdeg heuristic is a variable ordering strategy that integrates domain size and weighting, enhancing the professionalism and academic rigor of this research paper in accordance with the requirements of the journal Nature. Wdeg only considers constraints that contain two uninstantiated variables. There is a certain connection between wdeg and ddeg. When the weight counter of all variables is set to 1, wdeg becomes ddeg.
Wdeg maintains a counter for each constraint that indicates the number of constraint failures, i.e., the number of times a value from the domain of a variable has been removed throughout the propagation process. The wdeg expression of variable x i is
α w d e g ( x i ) = c C w e i g h t [ c ] s . t . x i v a r s ( c ) x i | ( F u t V a r s ( c ) ) | > 1
where the expression “FutVar(c)” refers to the set of uninitialized variables that are involved in the constraint “c”. During initialization, the weight counter of all variables is set to 1. If the constraint does not meet the requirement, its weight is incremented by 1. It is worth noting that once restarting, to keep learning all the time, the weight will not reset to one. In each step, the dom/wdeg heuristic selects the variable with the minimum ratio | D ( x i ) | α w d e g ( x i ) as the highest priority.
(3)
ABS heuristic
The ABS heuristic algorithm is a dynamic variable ordering heuristic algorithm, which uses the activities of variables in the process of propagation to guide the search. Inspired by the VSIDS algorithm, ABS gradually forgets the oldest statistics based on a sum of attenuation. Each variable x i is associated with a counter to measure how often the domain of x i is reduced in the propagation process. This measure is initialized by probing the search space, which does not add any space requirements [36].
The variable activity value is initialized to 0 and given a CSP p = X , D , C . After an assignment decision, a constraint propagation algorithm F is applied; F produces a new field D D , continuing to perform compatibly. To define the subset of variables X that are affected, apply F to P. The formulas for the definitions are as follows: Formula (2) represents the domain change of the affected variable, while Formula (3) represents the domain change of the unaffected variable.
x X : D ( x ) D ( x )
x X / X : D ( x ) = D ( x )
The activity of variable x, denoted as A( x i ), updates at each search tree node after constraint propagation. The update rules are shown in Formulas (4) and (5). Formula (4) corresponds to the unpruned variable, and Formula (5) corresponds to the pruned variable.
The activity of x i (represented by A( x i )) is updated as follows:
x X s . t . | D ( x ) | > 1 : A ( x ) = A ( x ) γ
x X : A ( x ) = A ( x ) + 1
where X is the set of the affected variables and γ is the attenuation constant acceptable 0 ≤ γ ≤ 1. Attenuation only affects free variables, thus slowing down the activity of deleting previously marked variables. In each step, the ABS heuristic selects the variable with the highest ratio of A( x i ) to D( x i ) as the highest priority.
(4)
ADW heuristic
dom/wdeg is the variable that picks the smallest value for dom(x)/wdeg(x) and ABS is the variable that picks the largest value for A(x)/D(x). By leveraging the strengths of both dom/wdeg and ABS, we propose a novel variable ordering heuristic called ADW (activity + dom/wdeg), which is expected to achieve better results in more cases. ADW considers the domain size, variable weighting, and activity. ADW maintains a counter for each constraint similar to wdeg, and a counter for each variable similar to ABS. Our proposed ADW heuristic selects the variable that is most likely to cause failure and is most active. In each step, the heuristic sets the variable x i with the highest ratio of (A( x i ) × wdeg ( x i ))/dom( x i ) as the maximum priority. This improved heuristic not only fully utilizes the potential of dom/wdeg but also retains the advantages of ABS. The experimental results demonstrate that the new heuristic exhibits excellent performance and strong robustness.

6. Experiments and Analysis

All experiments were carried out in the environment of the Ubuntu 17.04 system, Intel i7-6700 processor, and 8 g RAM. We evaluated our proposed algorithms and heuristics on structured and stochastic CSP problems selected from C. Lecoutre’s XCSP repository. A lot of the details of the problems can be found at https://www.movingai.com/benchmarks/ (accessed on 6 April 2023).
In this paper, the branching scheme of our algorithms is two-way (also known as binary). The two-way branching technique involves creating two branches: one where a variable is assigned a value and propagation is triggered, and another where the variable is left unassigned and propagation is triggered. In another branch, a value is removed from the variable’s domain, triggering propagation again. If the left branch propagation fails, the right branch propagation succeeds, and the next variable can be selected. Algorithm backtracking occurs when both branches fail to propagate [18].
In all the tables below, the number of instances tested in the problem is shown in parentheses after the problem. The solution result is expressed as the average solution time of multiple instances. The best-performing algorithms are highlighted in bold and underlined. Timeout is set to 600 s, indicated by the symbol “**”.

6.1. Performance Comparison of Improved Algorithms

In this section, all algorithms use dom/wdeg heuristics to order variables. For example, for Algorithm 1 maxRPC3 s i m described in Section 4, when a value a i is deleted due to a constraint, the heuristic changes the weight of the constraint c i , j .
Table 2 and Table 3 present the experimental outcomes of algorithm enhancement. The algorithms tested include maxRPC3 s i m , maxRPC3 s i m R , lmaxRPC3 r m , and maxRPC3 r m . The “time” column represents the duration in seconds taken to solve the problems, while the “node” column indicates the number of nodes. Table 2 displays the test results on 23 problems, which altogether amount to 244 structured problems. On the other hand, Table 3 illustrates the test results of 8 problem categories, summing 71 random problem instances.
From Table 2, we can see that among the 23 structured problems, a total of 10 problems took maxRPC3 s i m the shortest time on average, maxRPC3 s i m R took the shortest time for 5 problems, and lmaxRPC3 r m and maxRPC3 r m both took the shortest time for 3 problems. However, due to the limitation of the initialization cost of the data structure, all algorithms had a high cost in large instances. Specifically, all algorithms timed out on the qcp-25 and qwh-25 (4) problem class; that is, the data items in the table with the “**” symbol in the table. In particular, lmaxRPC3 r m timed out on the qcp-20 problem class. In contrast, the new algorithms maxRPC3 s i m and maxRPC3 s i m R can be used without timeout, indicating that our new algorithms perform slightly better in large instance problems. Overall, the average performance of algorithms maxRPC3 s i m and maxRPC3 s i m R is better than that of algorithm lmaxRPC3 r m on 76.2% and 66.7% of problem classes, respectively.
maxRPC3 s i m has approximately three times the number of problems with the shortest time spent on them compared to maxRPC3 r m and lmaxRPC3 r m . maxRPC3 s i m algorithms takes the shortest time on average in the qcp-10, qwh-10, rlfapgraphs, rlfapscens, rlfapGraphsMod, rlfapScens11, hos, bqwh-15-106, queens, and largequeens problems. Among them, the lmaxRPC3 r m and maxRPC3 r m algorithms spend on average more than twice and four times as long as maxRPC3 s i m on the qcp-10 problem, respectively. maxRPC3 s i m has almost absolute dominance in the rlfap problem, and has the shortest time spent in rlfapgraphs, the rlfapscens, rlfapGraphsMod, and rlfapScens11, which are the four best problems, while lmaxRPC3 r m takes about twice as long as maxRPC3 s i m in these problems. In the bqwh-15-106 problem, lmaxRPC3 r m and maxRPC3 r m take about two and five times as long as maxRPC3 s i m , respectively. lmaxRPC3 r m takes about two times as long as maxRPC3 s i m on average in the Queens problem, and in the largequeens problem, lmaxRPC3 r m and maxRPC3 r m take about three and two times as long as maxRPC3 s i m .
In the problems qcp-15, qwh-15, qwh-20, coloring, and queenAttacking, maxRPC3 s i m takes the shortest time except for maxRPC3 s i m R . In the qwh-15 problem, maxRPC3 r m and lmaxRPC3 r m take about twice as long as maxRPC3 s i m . In the coloring problem, maxRPC3 r m and lmaxRPC3 r m take about three and two times as long as maxRPC3 s i m R . In the queenAttacking problem, the lmaxRPC3 r m algorithm takes about twice as long as maxRPC3 s i m . Overall, the maxRPC3 s i m algorithm has the best results in most problems.
The number of problems where maxRPC3 s i m R works best compared to maxRPC3 r m and lmaxRPC3 r m is close to twice the number of problems of maxRPC3 r m and lmaxRPC3 r m . The maxRPC3 s i m R algorithm takes the least amount of time on average in the qcp-15, qwh-15, qwh-20, coloring, and queenAttacking problems. In the qwh-15 problem, the lmaxRPC3 r m and maxRPC3 r m algorithms take about twice as long as the maxRPC3 s i m R algorithm on average. In qwh-20, the maxRPC3 r m algorithm takes about 1.5 times as long as maxRPC3 s i m R . In the coloring problem, the maxRPC3 r m algorithm and the lmaxRPC3 r m algorithm take on average more than two and three times as long as maxRPC3 s i m R , respectively.
The maxRPC3 s i m R algorithm is the most effective algorithm except for the maxRPC3 s i m algorithm in the qcp-10, qwh-10, and bqwh-15-106 problems. In the qcp-10 problem, the lmaxRPC3 r m and maxRPC3 r m algorithms take about two and four times as long as the maxRPC3 s i m R algorithm. In problem qwh-10, the lmaxRPC3 r m and maxRPC3 r m algorithms take on average nearly twice and three times as long as maxRPC3 s i m R , respectively. On the bqwh-15-106 problem, the lmaxRPC3 r m algorithm and the maxRPC3 r m algorithm take approximately two and five times as long as the maxRPC3 s i m R algorithm. Moreover, we can also see that in the qcp-10, subs, myciel, bqwh-18-141_glb, jobShop-e0ddr1, and queensKnights problems, lmaxRPC3 r m and maxRPC3 r m perform better. We speculate that it is because our algorithm is modified based on the symmetry property, and these problems have fewer symmetric structures and are more dependent on the redundant data structures we abandoned. However, the solving time is actually quite similar, and our algorithm saves more storage space because of the reduction in redundant operations.
In the rlfap problem, the maxRPC3 s i m algorithm is absolutely dominant, the maxRPC3 s i m R algorithm is not dominant, and the number of nodes is close. The maxRPC3 s i m algorithm has the best result in the Hos problem, and in qcp-15, qwh-20, and coloring, the maxRPC3 s i m R algorithm has outstanding performance. Side by side, the maxRPC3 s i m algorithm has an advantage in solving smaller-scale problems, while maxRPC3 s i m R has an advantage in many large-scale problems. It can be seen that out of the seven problems with an average time of more than 1 s, the maxRPC3 s i m R algorithm has the least amount of time spent in four problems, while there are two problems where all four algorithms time out, and one problem where the best performer is the maxRPC3 r m algorithm. It shows that our proposed maxRPC3 s i m R algorithm has good pruning ability, and at the same time, saves time with simplicity and efficiency.
Table 3 shows the average performance of the algorithms for random instances from the geometric, Ehi-85, composed, random, and frb problems. The average performance of algorithms maxRPC3 s i m and maxRPC3 s i m R are both better than that of lmaxRPC3 r m , except for the Ehi-85 problem. That is, the new algorithms are better than lmaxRPC3 r m in 85% of problem classes. Moreover, the maxRPC3 r m algorithm times out in the rand-2-23 and rand-2-24 problems, while none of the other three algorithms time out. Thus, the algorithm maxRPC3 s i m R works best on the randomized problem.
Comparing the maxRPC3 s i m , lmaxRPC3 r m , and maxRPC3 r m algorithms, the number of best-performing problems in the maxRPC3 s i m algorithm is two, while there are none for lmaxRPC3 r m and only one for maxRPC3 r m . In the composed-25-1-2 and composed-25-10-20 problems, maxRPC3 s i m took the least time. In the composed-25-1-2 problem, the lmaxRPC3 r m and maxRPC3 r m algorithms took twice and nearly seven times as long as the maxRPC3 s i m algorithm, respectively. In the composed-25-10-20 problem, the lmaxRPC3 r m algorithm and the maxRPC3 r m algorithm took three and five times longer than the maxRPC3 s i m algorithm, respectively.
The maxRPC3 s i m algorithm is the most effective algorithm except for the maxRPC3 s i m R algorithm in the geom, rand-2-23, rand-2-24, frb30-15, and frb35-17 problems. In particular, the lmaxRPC3 r m algorithm and the maxRPC3 r m algorithm took about three times as long as the maxRPC3 r m algorithm in problem frb30-15. In problem frb35-17, the lmaxRPC3 r m algorithm and the maxRPC3 r m algorithm took about twice as long as the maxRPC3 s i m algorithm and about three times as long as the maxRPC3 s i m algorithm, respectively. Algorithm maxRPC3 s i m works much better than the maxRPC3 r m algorithm and the lmaxRPC3 r m algorithm.
Comparing the maxRPC3 s i m R , lmaxRPC3 r m , and maxRPC3 r m algorithms, the maxRPC3 s i m R algorithm works best on all five problems, whereas the maxRPC3 r m algorithm works well on only one problem and the lmaxRPC3 r m algorithm does not. The maxRPC3 s i m R algorithm works best in the geom, rand-2-23, rand-2-24, frb30-15, and frb35-17 problems. In the frb30-15 problem, the lmaxRPC3 r m algorithm and the maxRPC3 r m algorithm took more than three and four times as long as the maxRPC3 s i m R algorithm, respectively. In the frb35-17 algorithm, the lmaxRPC3 r m algorithm and the maxRPC3 r m algorithm took more than twice and three times as long as the maxRPC3 s i m R algorithm, respectively.
The maxRPC3 s i m R algorithm is the most effective algorithm except for the maxRPC3 s i m algorithm in both problem classes of the composed problem. In particular, the maxRPC3 r m algorithm takes approximately four times longer than the maxRPC3 s i m R algorithm in the composed-25-1-2 problem, and in the composed-25-10-20 algorithm, the lmaxRPC3 r m algorithm and the maxRPC3 r m algorithm take about two and four times longer than the maxRPC3 s i m R algorithm, respectively. Overall, the maxRPC3 s i m R algorithm has the best results in stochastic problems. We can see from the time that is similar to the structured problems, the maxRPC3 s i m algorithm works well for small-scale problems, and the maxRPC3 s i m R algorithm works well for larger-scale problems.
In recent years, very little work has been conducted on the maxRPC algorithm. In Reference [17], only 15 kinds of problems were tested, while we carried out experiments on 31 kinds of structured problems and random problems. In addition, Reference [17] showed that the best average performance improved by 65%, while the average performance of algorithm maxRPC3 s i m improved by 82.5% on problem bqwh-15-106, and the average performance of algorithm maxRPC3 s i m R improved by 74.4% on problem frb30-15.

6.2. Performance Comparison of Improved Algorithms with Heuristics

Table 4 and Table 5 compare the performance of algorithms maxRPC3 s i m , maxRPC3 s i m R , lmaxRPC3 r m , and AC3 using different heuristics on nine problem classes, which are randomly selected examples of structured and randomized problems. We include results from dom/ddeg, dom/wdeg, ABS, and our proposed ADW heuristic.
From Table 4 we can conclude that the ADW heuristic performs best in the structured problems qcp-10 and qcp-20, and the stochastic problem composed-25-10-20 under the execution of the maxRPC3 s i m algorithm. In the qcp-10 problem, the algorithm takes hundreds of times longer to apply dom/ddeg than to apply the ADW heuristic, dom/wdeg takes close to twice as long as ADW, and ABS takes tens of times longer than ADW. In the qcp-20 problem, only the dom/wdeg heuristic and the ADW heuristic did not time out, whereas the other two heuristics did. In the COMPOSED problem, dom/wdeg timed out, while dom/wdeg took about four times as long as ADW. Dom/wdeg worked best in the qwh-15, queens, rlfapgraphs, rlfapScens, coloring, and frb30-15 problems, and dom/ddeg worked best in the rand-2-24 and geom problems, which shows that applying the ADW heuristic to the maxRPC3 s i m algorithm has a good bootstrap ordering of the algorithmic variables, and works better than applying the dom/wdeg heuristic in some problems, and better than applying the dom/ddeg and ABS heuristics in many problems.
In the maxRPC3 s i m R algorithm, the application of the ADW heuristic works best in the qcp-10, qcp-20, and composed-25-10-20 problems, the application of the dom/wdeg heuristic works best in the qwh-15, coloring, and frb30-15 problems, the application of the ABS heuristic works best in the queens, rlfapGraphs, and rlfapScens problems, and the Dom/Wdeg heuristic yields the best results in stochastic problems Rand-2-24 and Geom. Taken together, applying dom/wdeg, ABS and ADW can have the best results in a larger number of problems, while applying dom/ddeg has the best results in the stochastic problems rand and geom. Therefore, the application of the improved variable ordering heuristic ADW also works well for variable ordering of the maxRPC3 s i m R algorithm and is more efficient than using other heuristics in many problems.
Table 5 shows the results of applying the four heuristics on the lmaxRPC3 r m algorithm and the AC3 algorithm. When using the lmaxRPC3 r m algorithm, applying the ADW heuristic worked best in the qcp-10, queens, rlfapGraphs, and composed-25-10-20 problems, the dom/wdeg heuristic was best when applied to the qwh-15, coloring, rand-2-24, and frb30-15 problems, the ABS heuristic was best when applied to the rlfapScens problem, and the dom/wdeg application was best when applied to the geom stochastic problem. Therefore applying the ADW heuristic and dom/wdeg heuristic works best.
When utilizing the AC3 algorithm, the application of the ADW heuristic yielded optimal results in solving the qcp-10, rlfapGraphs, rlfapScens, frb30-15, geom, and composed-25-10-20 problems. Conversely, employing the dom/wdeg heuristic proved to be most effective in addressing the rand-2-24 problem. Furthermore, for resolving the qcp-20, qwh-15, and coloring problems, implementing the dom/wdeg heuristic produced superior outcomes. Notably, when dealing with the queens as well as the rlfapGraphs and rlfapScens problems that required equal time allocation between ADW and ABS heuristics, applying the ABS heuristic demonstrated better performance. In summary, ADW exhibited optimal efficacy when combined with the AC3 algorithm, while both dom/wdeg and ADW heuristics showcased promising results when employed alongside lmaxRPC3 r m .
The overall results show that the total time of algorithms maxRPC3 s i m and AC3 using ADW heuristics is the best, and algorithms maxRPC3 s i m R and lmaxRPC3 r m using ADW heuristics are in second place, but compared with other heuristics, ADW is close to the first heuristics, which means that ADW heuristics have strong robustness. This advantage makes ADW very useful in the case of uncertainty and many kinds of problems. From the industrial point of view, it has great practical significance in practical problems.

7. Conclusions

Symmetrical structures are ubiquitous in the CSP. It is crucial to identify and characterize these structures to apply effective pruning strategies, thus reducing redundant searches and improving solving efficiency. In light of this, we propose a simplified and more efficient pruning strategy based on lmaxRPC3 r m , which minimizes symmetry and eliminates redundant operations with less space–time cost. The paper presents the following main contributions: Firstly, we focus on the recent classic algorithm, lmaxRPC3 r m , and enhance its performance through simplification and optimization of the data structure. This leads to the development of two new maxRPC algorithms: maxRPC3 s i m and maxRPC3 s i m R . These algorithms demonstrate improved performance compared to the original lmaxRPC3 r m . Additionally, we introduce an enhanced variable ordering heuristic called ADW. This heuristic aids in the selection of more appropriate variables, optimizing the pruning strategy.
The algorithm maxRPC3 s i m does not use residual records, discards the LastAC and LastPC data structures in lmaxRPC3 r m , and starts each search for support from the minimum value. The maxRPC3 s i m R changes the way the two data structures are used to store residual support in the lmaxRPC3 r m algorithm, respectively, and uses one data structure to store support. Thus the two improved algorithms avoid some redundant compatibility support and PC witness access, making the algorithms more efficient. Experimental results show that the new algorithm outperforms the original maxRPC algorithm in a large number of arithmetic cases. Specifically, the maxRPC3 s i m R algorithm shows superior performance in stochastic problems, while the maxRPC3 s i m algorithm shows superior performance in structured problems. Additionally, from the experimental data, we found that the maxRPC3 s i m R algorithm generally works better for problems with larger problem sizes, while the maxRPC3 s i m algorithm works better for problems with smaller problem sizes. In the timeout case, the maxRPC3 s i m R algorithm has the least number of timeout problems, and the maxRPC3 s i m algorithm is second only to the maxRPC3 s i m R algorithm. Our two proposed algorithms demonstrate outstanding performance in the majority of stochastic and structural problems.
In addition, incorporating variable ranking heuristics into algorithms can serve as a valuable guide for variable selection during the algorithmic process. We combine the classic efficient dom/wdeg heuristic and ABS heuristic to generate the improved heuristic ADW. We apply several classic heuristics and our ADW heuristic in our proposed algorithms as well as in the comparison algorithm, and evaluate their effectiveness through experimental analysis. The experimental results show that the ADW heuristic’s overall performance is in the top two, which is highly significant for practical problem solving. This implies that we can use ADW in the case of unknown or complex problem types without artificial prediction.
Although our algorithm performs well in most problems, there are still some limitations in the research. For example, the proposed pruning strategy is very effective in eliminating symmetric structures and reducing redundant searches, but it is not necessarily suitable for all types of constraint satisfaction problems. In addition, there is still room for improving algorithm optimization and combining technologies to enhance problem-solving efficiency. Additionally, the performance of the algorithm seems to be affected by the problem’s size, and it is observed that maxRPC3 s i m R performs better on larger problems, while maxRPC3 s i m is more effective on smaller problems, which indicates that the scalability of the algorithm is limited.
In future work, we will consider the study of a bitwise version of the maxRPC3 s i m and maxRPC3 s i m R algorithms. The process of finding AC support, PC support, and PC witness is performed frequently and consumes a substantial amount of time in the algorithm. To address this, we aim to leverage bit operations to accelerate the process of identifying and storing AC support, PC support, and PC witness. This enhancement is expected to significantly improve the efficiency of lmaxRPC3 r m . Additionally, we intend to explore the integration of machine learning techniques into our algorithm [37]. The objective is to train constraint networks capable of solving more complex and diverse problems, thereby enhancing the algorithm’s generalization ability. Furthermore, to better identify and eliminate symmetric structures in CSPs, we are investigating the potential of combining the symmetry-breaking group-theoretic representation [38].

Author Contributions

The conceptualization and design of the study were contributed to by all authors, with X.P. and Z.C. playing important roles. X.P. and Z.C. conducted the experiments and X.P. drafted the first draft. All authors critically reviewed and provided constructive feedback on earlier versions of the manuscript. Y.Z. secured the necessary funding for this research effort. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the National Natural Science Foundation of China (62076108, 61872159), and the Natural Science Foundation of Jilin Province, China (20210101172JC).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Acknowledgments

The authors would like to express their gratitude to the editors and reviewers for handling and reviewing our paper.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
ABSactivity-based search heuristic
ACarc consistency
CSPConstraint Satisfaction Problem
dom/wdegdomain/weighted degree heuristic
RPCrestricted path consistency
lmaxRPC3 r m classic lightweight algorithm for maxRPC
maxRPCMax-restricted path consistency
PCpath consistency
SACsingleton arc consistency
PICpath inverse consistency
NICneighborhood inverse consistency
NSCsneighborhood singleton consistencies
EFCCenhanced forward checking consistency

References

  1. Tang, Y.; Pan, Z.; Pedrycz, W.; Ren, F.; Song, X. Viewpoint-based kernel fuzzy clustering with weight information granules. IEEE Trans. Emerg. Top. Comput. Intell. 2023, 7, 342–356. [Google Scholar] [CrossRef]
  2. Tang, Y.; Huang, J.; Pedrycz, W.; Li, B.; Ren, F. A fuzzy cluster validity index induced by triple center relation. IEEE Trans. Cybern. 2023, 53, 5024–5036. [Google Scholar] [CrossRef] [PubMed]
  3. Zhou, W.; Zhou, P.; Zheng, Y.; Xie, Z. A Heuristic Integrated Scheduling Algorithm via Processing Characteristics of Various Machines. Symmetry 2022, 14, 2150. [Google Scholar] [CrossRef]
  4. Han, B.; Hu, M.; Wang, X.; Ren, F. A Triple-Structure Network Model Based upon MobileNet V1 and Multi-Loss Function for Facial Expression Recognition. Symmetry 2022, 14, 2055. [Google Scholar] [CrossRef]
  5. Freuder, E.C.; Mackworth, A.K. Constraint satisfaction: An emerging paradigm. Found. Artif. Intell. 2006, 2, 13–27. [Google Scholar]
  6. Dlask, T.; Werner, T. Bounding Linear Programs by Constraint Propagation: Application to Max-SAT. In Proceedings of the CP: International Conference on Principles and Practice of Constraint Programming, Louvain-la-Neuve, Belgium, 7–11 September 2020; pp. 177–193. [Google Scholar]
  7. Yap, R.H.C.; Xia, W.; Wang, R. Generalized arc consistency algorithms for table constraints: A summary of algorithmic ideas. Proc. AAAI Conf. Artif. Intell. 2020, 34, 13590–13597. [Google Scholar] [CrossRef]
  8. Carbonnel, C.; Cohen, D.A.; Cooper, M.C. On singleton arc consistency for CSPs defined by monotone patterns. Algorithmica 2019, 81, 1699–1727. [Google Scholar] [CrossRef] [PubMed]
  9. Kong, S.; Li, S.; Michael, S. Exploring directional path-consistency for solving constraint networks. Comput. J. 2018, 61, 1338–1350. [Google Scholar] [CrossRef]
  10. Guo, J.; Li, Z.; Li, H. Partial Max-restricted Path Consistency. In Proceedings of the ICTAI: International Conference on Tools with Artificial Intelligence, Athens, Greece, 7–9 November 2012; pp. 186–190. [Google Scholar]
  11. Debruyne, R.; Bessiere, C. From restricted path consistency to max-restricted path consistency. In Proceedings of the CP: International Conference on Principles and Practice of Constraint Programming, Linz, Austria, 29 October–1 November 1997; pp. 312–326. [Google Scholar]
  12. Grandoni, F.; Italiano, G. Improved algorithms for max-restricted path consistency. In Proceedings of the CP: International Conference on Principles and Practice of Constraint Programming, Kinsale, Ireland, 29 September–3 October 2003; pp. 858–862. [Google Scholar]
  13. Vion, J.; Debruyne, R. Light algorithms for maintaining Max-RPC during search. In Proceedings of the SARA-2009 Eighth Symposium on Abstraction, Reformulation, and Approximation, Lake Arrowhead, CA, USA, 8–10 August 2009; pp. 167–174. [Google Scholar]
  14. Lecoutre, C.; Hemery, F. A study of residual supports in arc consistency. In Proceedings of the IJCAI: International Joint Conference on Artificial Intelligence, Hyderabad, India, 6–12 January 2007; pp. 125–130. [Google Scholar]
  15. Balafoutis, T.; Paparrizou, A.; Stergiou, K.; Walsh, T. Improving the performance of maxRPC. In Proceedings of the CP: International Conference on Principles and Practice of Constraint Programming, St. Andrews, UK, 6–10 September 2010; pp. 69–83. [Google Scholar]
  16. Wahbi, M. Maintaining arc consistency asynchronously in synchronous distributed search. In Proceedings of the ICTAI: International Conference on Tools with Artificial Intelligence, Athens, Greece, 7–9 November 2012; pp. 33–40. [Google Scholar]
  17. Xu, Z.; Song, S. lmaxRPC (ls): An Algorithm Utilizing Light Symmetry for Approximating maxRPC in Constraint Programming. In Proceedings of the CAAI: Chinese Association for Artificial Intelligence, Sanya, China, 25–26 June 2018; pp. 382–385. [Google Scholar]
  18. Stergiou, K. Revisiting restricted path consistency. Constraints 2017, 22, 377–402. [Google Scholar] [CrossRef]
  19. Michel, L.; Hentenryck, P.V. Activity-Based Search for Black-Box Constraint Programming Solvers. In Proceedings of the CPAIOR: International Conference on the Integration of Constraint Programming, Artificial Intelligence, and Operations Research, Nantes, France, 28 May–1 June 2012; pp. 228–243. [Google Scholar]
  20. Freuder, E.C. Eliminating interchangeable values in constraint satisfaction problems. In Proceedings of the AAAI’91, Anaheim, CA, USA, 14–19 July 1991; pp. 227–233. [Google Scholar]
  21. Cooper, M. Fundamental properties of neighbourhood substitution in constraint satisfaction problems. Artif. Intell. 1997, 90, 1–24. [Google Scholar] [CrossRef]
  22. Benhamou, B. Study of symmetry in constraint satisfaction problems. In Proceedings of the PPCP’94, Seattle, WA, USA, 2–4 May 1994; pp. 249–257. [Google Scholar]
  23. Gent, I.; Petrie, K.; Puget, J. Symmetry in constraint programming. In Handbook of Constraint Programming; Rossi, F., van Beek, P., Walsh, T., Eds.; Elsevier: Amsterdam, The Netherland, 2006; Chapter 10. [Google Scholar]
  24. Gervet, C.; Van Hentenryck, P. Length-lex ordering for set CSPs. In Proceedings of the AAAI’06, Boston, MA, USA, 16–20 July 2006; pp. 48–53. [Google Scholar]
  25. Marquis, P.; Papini, O.; Prade, H. A Guided Tour of Artificial Intelligence Research: Volume II: AI Algorithms; Springer Nature: Berlin/Heidelberg, Germany, 2020; pp. 174–176. [Google Scholar]
  26. Stergiou, K. Neighborhood singleton consistencies. Constraints 2019, 24, 94–131. [Google Scholar] [CrossRef]
  27. Wallace, R.J. Interleaving levels of consistency enforcement for singleton arc consistency in CSPs, with a new best (N) SAC algorithm. In Proceedings of the International Conference of the Italian Association for Artificial Intelligence, Online, 25–27 November 2020; pp. 301–317. [Google Scholar]
  28. Li, Z.; Yu, Z.; Li, H.; Guo, J.; Li, Z. Revisiting the efficacy of weak consistencies: A study of forward checking. Sci. China Inf. Sci. 2021, 64, 179102. [Google Scholar] [CrossRef]
  29. Rossi, F.; Van Beek, P.; Walsh, T. Handbook of Constraint Programming; Elsevier: Amsterdam, The Netherlands, 2006; pp. 57–61. [Google Scholar]
  30. Lecoutre, C. A greedy approach to establish singleton arc consistency. In Proceedings of the International Joint Conference on Artificial Intelligence, Edinburgh, UK, 30 July–5 August 2005; Morgan Kaufmann Publishers: San Francisco, CA, USA, 2005; pp. 199–204. [Google Scholar]
  31. Berlandier, P. Improving domain filtering using restricted path consistency. In Proceedings of the Artificial Intelligence for Applications, Los Angeles, CA, USA, 20–23 February 1995; pp. 32–37. [Google Scholar]
  32. Debruyne, R. A property of path inverse consistency leading to an optimal PIC algorithm. In Proceedings of the European Conference on Artificial Intelligence, Berlin, Germany, 20–25 August 2000; IOS Press: Amsterdam, The Netherland, 2000; pp. 88–92. [Google Scholar]
  33. Freuder, E.C.; Elfe, C.D. Neighborhood Inverse Consistency Preprocessing. In Proceedings of the AAAI-96, Portland, OR, USA, 4–8 August 1996; pp. 202–208. [Google Scholar]
  34. Yong, K.W.; Mouhoub, M. Using conflict and support counts for variable and value ordering in CSPs. Appl. Intell. 2018, 48, 2487–2500. [Google Scholar] [CrossRef]
  35. Narodytska, N.; Walsh, T. Constraint and Variable Ordering Heuristics for Compiling Configuration Problems. In Proceedings of the IJCAI: International Joint Conference on Artificial Intelligence, Hyderabad, India, 6–12 January 2007; pp. 149–154. [Google Scholar]
  36. Boussemart, F.; Hemery, F.; Lecoutre, C.; Sais, L. Boosting systematic search by weighting constraints. In Proceedings of the ECAI: European Conference on Artificial Intelligence, Valencia, Spain, 22–27 August 2004; pp. 146–150. [Google Scholar]
  37. Bessiere, C.; Carbonnel, C.; Dries, A.; Hebrard, E.; Katsirelos, G.; Narodytska, N.; Quimper, C.G.; Stergiou, K.; Tsouros, D.C.; Walsh, T. Learning constraints through partial queries. Artif. Intell. 2023, 319, 103896. [Google Scholar] [CrossRef]
  38. Bachtis, D.; Aarts, G.; Lucini, B. Adding machine learning within Hamiltonians: Renormalization group transformations, symmetry breaking and restoration. Phys. Rev. Res. 2021, 3, 013134. [Google Scholar] [CrossRef]
Table 1. Related work in this paper order by algorithms’ pruning capability (weak to strong).
Table 1. Related work in this paper order by algorithms’ pruning capability (weak to strong).
No.AuthorsCompatibility TechnologyAlgorithmsEffectiveness Analyses
1Alan K. et al. [25]ACArc ConsistencyPropagating constraints using AC is the most widely and traditional method.
2Lecoutre C. et al. (2005) [30]SACSingleton Arc ConsistencySAC is the most promising strong compatibility algorithm capable of replacing AC.
3Douglass C. et al. [25]PCPath ConsistencyThe idea of PC is to further eliminate illegitimate values by checking the constraint paths.
4Berlandier P. (1995) [31]RPCRestricted Path ConsistencyThe RPC algorithm determines whether or not to prune by the constraint relationship between the three variables.
5Debruyne R. et al. (1997) [11]maxRPCmax-Restricted Path ConsistencyThe maxRPC algorithm is more compatible than the RPC algorithm and has better pruning capabilities.
6Debruyne R. et al. (2000) [32]PICPath Inverse ConsistencyThe PIC algorithm focuses on inverse constraint relationships to better understand constraints between variables.
7Freuder E C. et al. (1996) [33]NICNeighborhood Inverse ConsistencyThe NIC algorithm focuses on regional constraints, i.e., constraint relationships within local neighborhoods.
8Stergiou, K. et al. (2019) [26]NSCsNeighborhood Singleton ConsistenciesNSC aims to eliminate values that are inconsistent with individual constraints by focusing on them.
9Li Z, Yu Z. et al. (2021) [27]EFCCEnhanced Forward Checking ConsistencyEFCC strategically selects variables and values and uses advanced techniques such as domain segmentation.
Table 2. Mean standalone performance in structured problems.
Table 2. Mean standalone performance in structured problems.
Problem Class/AlgorithmsmaxRPC3 sim maxRPC3 simR lmaxRPC3 rm maxRPC3 rm
TimeNodeTimeNodeTimeNodeTimeNode
qcp-10 (14)0.112990.135990.291990.496103
qcp-15 (15)123.38817,076107.42521,044147.17512,752142.9997021
qcp-20 (4)588.88421,436545.68834710****471.5377303
qcp-25 (4)****************
qwh-10 (10)0.0661070.08141070.1431060.261108
qwh-15 (10)2.9485892.1925894.455895.252419
qwh-20 (10)348.21115,348305.71220,604372.4249390454.3385765
qwh-25 (4)****************
rlfapgraphs (14)0.1155480.1925480.185480.122548
rlfapscens (11)0.1185590.1995590.1865590.132559
rlfapGraphsMod (12)0.1377510.2347510.2427510.144751
rlfapScens11 (12)0.1346800.2326730.2496800.165680
subs (9)0.0026350.0032350.00189350.0018135
coloring (19)12.129118,68611.401118,68624.063118,68634.343115,067
hos (14)0.0812480.1312480.14712480.0861248
myciel (16)0.00333970.00354970.00215970.0026897
bqwh-15-106 (10)0.172300.1962300.4782670.975224
bqwh-18-141_glb (10)0.00261060.007111410.00241410.00181106
jobShop-e0ddr1 (10)0.00523500.00607500.00405500.0045850
queens (14)0.011700.0188700.0226700.01470
largequeens (2)0.2753500.5553500.9633500.457350
queensKnights (10)0.00183180.00151180.00097180.0010618
queenAttacking (10)0.00705660.00669660.014660.0083666
CPU times (in secs) and nodes for the two different branching schemes. The best-performing algorithms are highlighted in bold and underlined. Timeout is set to 600 s, indicated by the symbol “**”.
Table 3. Mean standalone performance in random problems.
Table 3. Mean standalone performance in random problems.
Problem Class/AlgorithmsmaxRPC3 sim maxRPC3 simR lmaxRPC3 rm maxRPC3 rm
TimeNodeTimeNodeTimeNodeTimeNode
geom (15)121.87310,811104.60411,205144.8217415145.8324478
ehi-85 (10)0.081900.097500.03700.02720
composed-25-1-2 (10)0.0131104.6040.02100.028900.08824478
composed-25-10-20 (10)0.1892470.2672470.5472470.959276
rand-2-23 (3)515.31883,494497.49396,784538.52746,365**52,126
rand-2-24 (3)465.90566,527434.95274,865557.842,295**25,947
frb30-15 (10)5.14212554.392117914.325169017.1721148
frb35-17 (10)47.966890230.74634882.1168078119.0226722
CPU times (in secs) and nodes for the two different branching schemes. The best-performing algorithms are highlighted in bold and underlined. Timeout is set to 600 s, indicated by the symbol “**”.
Table 4. Algorithms maxRPC3 s i m and maxRPC3 s i m R use different heuristic results.
Table 4. Algorithms maxRPC3 s i m and maxRPC3 s i m R use different heuristic results.
Problem Class/AlgorithmsmaxRPC3 sim maxRPC3 simR
dom/ddegdom/wdegABSADWdom/ddegdom/wdegABSADW
qcp-10 (12)47.0560.1225.1450.07296.3390.155.4370.079
qcp-20 (2)600577.768600484.339600491.376600433.382
qwh-15 (10)5.4580.0665.5782.1814.0340.08143.9681.551
queens (14)0.3030.0110.2980.2970.0190.01880.0120.013
rlfapGraphs (11)0.1290.0790.0820.1160.1280.130.0520.099
rlfapScens (11)0.1280.1180.1630.1780.2010.1990.0790.137
coloring (11)18.8330.02361.8320.02523.6440.02262.8830.025
rand-2-24 (3)346.82465.905549.067569.309319.769434.952522.267536.487
frb30-15 (10)5.4985.14213.7776.5695.2094.39214.2466.55
geom (9)15.40662.51450.02832.08416.06546.90942.62728.967
composed-25-10-20 (4)6000.2160.0620.0566000.2770.070.063
total time1639.6311111.9641286.0321095.2261665.408978.50721251.6411007.353
CPU times (in secs) and nodes for the two different branching schemes. The best-performing algorithms are highlighted in bold and underlined.
Table 5. Algorithms lmaxRPC3 r m and AC3 use different heuristic results.
Table 5. Algorithms lmaxRPC3 r m and AC3 use different heuristic results.
Problem Class/AlgorithmslmaxRPC3 rm AC3
dom/ddegdom/wdegABSADWdom/ddegdom/wdegABSADW
qcp-10 (12)68.8090.32819.1380.25822.380.0140.5660.004
qcp-20 (2)********600168.203600308.703
qwh-15 (10)12.8610.14315.2665.2690.7440.01150.280.088
queens (14)0.0180.02260.0150.00558.430.001360.00080.005
rlfapGraphs (11)0.1730.1280.0940.0860.0070.0070.0040.004
rlfapScens (11)0.1990.1860.1330.1910.0080.009250.0050.005
coloring (11)54.6140.03785.920.1975.5590.00556.7320.007
rand-2-24 (3)580.35529.66660060015.15129.13921.56221.866
frb30-15 (10)22.31514.32580.08325.5040.2030.2090.3310.154
geom (9)58.9196.63790.744147.3260.661.8570.8240.603
composed-25-10-20 (4)6000.6520.3270.2816000.0290.0120.005
total time1398.249642.1246891.72779.117703.14231.28211680.316822.732
CPU times (in secs) and nodes for the two different branching schemes. The best-performing algorithms are highlighted in bold and underlined. Timeout is set to 600 s, indicated by the symbol “**”.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Pan, X.; Cheng, Z.; Zhang, Y. Two Improved Constraint-Solving Algorithms Based on lmaxRPC3rm. Symmetry 2023, 15, 2151. https://doi.org/10.3390/sym15122151

AMA Style

Pan X, Cheng Z, Zhang Y. Two Improved Constraint-Solving Algorithms Based on lmaxRPC3rm. Symmetry. 2023; 15(12):2151. https://doi.org/10.3390/sym15122151

Chicago/Turabian Style

Pan, Xirui, Zhuyuan Cheng, and Yonggang Zhang. 2023. "Two Improved Constraint-Solving Algorithms Based on lmaxRPC3rm" Symmetry 15, no. 12: 2151. https://doi.org/10.3390/sym15122151

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop