arXiv:2611.04637cs.AINov 2026

Manuscript Offprint

arXiv:2611.04637

SAT Encoding for Set of At-Most-K Cardinality Constraints with Ladder Shape

Hieu Truong Xuan, Tuyen Kieu Van, Khanh To Van

Abstract

This paper presents a novel SAT encoding designed to represent a sequence of At-Most-K (AMK) cardinality constraints arranged in a ladder-like structure, referred to as the Ladder AMK constraint. These AMK constraints feature a ladder-like arrangement, with shared common variables in the center and two variables differing at the beginning and the end. The proposed encoding first decomposes the sequence of AMK constraints into separated blocks, then encodes each block as a whole rather than encoding each AMK constraint individually. This approach improves the efficiency of constraint solving in SAT solvers by significantly reducing the size of the encoding, precisely the number of variables, and the generated clauses required. To achieve this, the encoding employs Sequential Counter to encode each block and constructs clauses that link adjacent blocks, ensuring equivalence with the input constraints. Compared to the previously proposed encoding that uses Binary Decision Diagrams for Ladder AMO constraint (k = 1), our encoding requires fewer variables and clauses. Our study is the first study that develops SAT encoding for Ladder AMK constraints with k > 1. Experimental results on single Ladder AMO and Ladder AMK constraints indicate that our encoding significantly enhances both the size of the encoding and the efficiency of solving time compared to existing encodings. Furthermore, by evaluating on the two real-world combinatorial problems, namely Anti-bandwidth Problem and Nurse Rostering Problem, we found that the proposed encoding surpasses alternative encodings, as well as more advanced Constraint Programming (CP) and Mixed Integer Programming (MIP) solvers. In summary, the SAT encoding technique presented in this paper provides a more efficient method for encoding sequence constraint, specifically Ladder AMK constraint, which could enhance the effectiveness of SAT solving for various problems involving this type of constraint.

Keywords: SAT encoding, Cardinality constraints, Sequence constraints, Sequential Counter encoding, At-Most-K constraints, Anti-bandwidth

1 Introduction

Sequence constraint is a type of constraint that frequently appears in combinatorial optimization problems, such as production line scheduling, employee scheduling, Nurse Rostering Problem, Crew Rostering Problem, sports timetabling, and OR problems. For instance, in the Car Sequencing Problem [1, 2], sequence constraints restrict the maximum number of cars with a specific option to no more than two in any sequence of five consecutive cars on a production line. In the Nurse Rostering Problem [3, 4], sequence constraints may limit a nurse to working at most four night shifts and eight evening shifts, while also requiring at least four off-days within any sequence of fourteen consecutive days [5]. These constraints help ensure proper rest and recovery by preventing excessively intense work schedules. Similarly, in the Crew Rostering Problem, an employee may be allowed to work a maximum of five days in any seven consecutive days [6] to comply with labor regulations. In the taxi driver shift scheduling problem at an airport for a car rental company [7], sequence constraints are used to ensure a balanced distribution of morning and afternoon shifts among drivers. In the RobinX sports timetabling problem [8], sequence constraints limit the maximum number of home or away games a team can play within any fixed-length sequence of consecutive matches. Sequence constraints limit the number of occurrences of certain specific values in a sequence of kk variables and are often referred to as AmongSeq [9] and AtMostSeq [1]. Certain problems, such as the Anti-bandwidth Problem (ABP) [10], can be reformulated to incorporate sequence constraints. This problem has applications in scheduling, radio frequency assignment, obnoxious facility location, and map coloring.

The impressive progress of SAT solvers has initiated what is now referred to as the SAT revolution [11]. These solvers are capable of addressing enormous formulas that contain millions of variables and clauses. In the near future, they are expected to handle formulas with significantly more than just millions of variables and clauses. Today, SAT solving has become a serious alternative to Integer Linear Programming (ILP) solvers for addressing NP-complete problems. Due to substantial improvements in the performance of SAT solvers, SAT solving is increasingly being used in various real-world applications. However, when applying SAT encoding to combinatorial problems, a significant number of clauses can be generated. To mitigate this issue, several encoding techniques have been proposed to reduce the overwhelming number of clauses [12, 13].

Sequence constraints have been extensively studied in the field of Constraint Programming (CP) to develop efficient solutions, as highlighted in the work of Bergman et al. [5] and Siala et al. [2]. However, effective SAT encodings for sequence constraints, such as AmongSeq [9] and AtMostSeq [1], remain largely unexamined. A notable exception is Duplex encoding [14], which is specifically designed for sequences of At-Most-One (AMO) constraints. In our research, we propose a block-based encoding method for a sequence of At-Most-K (AMK) constraints, which encodes them as a whole rather than handling each AMK constraint independently. In particular, we leverage shared variables among neighboring AMK constraints to decompose the input sequence constraint into blocks. Then, we encode these blocks using an encoding inspired by the Sequential Counter [15] encoding. Auxiliary variables generated from the block encoding are used to connect adjacent blocks, thereby reformulating the original constraint. This approach not only demonstrates greater efficiency for sequences of AMO constraints compared to the Duplex encoding, as reported by Hieu et al. [16], but also proves to be effective for sequences of AMK constraints with k>1k > 1.

  • We propose a novel SAT encoding for a set of AMK cardinality constraints arranged in a ladder shape. Our approach leverages shared variables among neighboring AMK constraints, allowing us to organize them into blocks for encoding rather than encoding each constraint independently. To the best of our knowledge, this is the first SAT encoding method for the sequence of AMK cardinality constraints with a ladder shape where k>1k > 1.

  • Additionally, we present solutions to the Anti-bandwidth Problem and Nurse Rostering Problem, using our new SAT encoding for the sequence of At-Most-One and At-Most-K cardinality constraints, respectively. Experimental results show that our approach outperforms existing SAT encodings, as well as Constraint Programming (CP) and Mixed Integer Programming (MIP) methods that utilize powerful solvers such as CPLEX, CP-SAT, and Gurobi.

This paper extends our previously published research [16] in the following ways: First, we generalize the encoding from AMO constraints to AMK constraints with k≥1k \geq 1 for sequences of cardinality constraints in a ladder shape, whereas the previous work focused solely on AMO constraints. Second, we also include an experiment on the Nurse Rostering Problem to evaluate the performance of the proposed encoding on combinatorial problems that include sequences of AMK constraints. Third, for the Anti-bandwidth Problem, we develop a parallel search implementation, leading to improved performance. We also expanded our experiment to include comparisons and evaluations with Adder Network encoding [17] and powerful CP and MIP solvers, namely Gurobi and CP-SAT. This comparison highlights the effectiveness of our proposed SAT encoding in solving the Anti-bandwidth Problem and Nurse Rostering Problem when compared to CP and MIP solvers.

The paper is organized as follows: Section 1 introduces the research problem and summarizes the contributions of this study. Section 2 presents the basic definitions of the Ladder AMK constraint and discusses how to represent one AMK constraint using two sub-AMK constraints. Section 3 details the block encoding for the Ladder AMK constraint and includes a comparative evaluation against existing SAT encodings. Section 4 introduces the encoding for the Ladder AMO constraint, which is a specific case of the Ladder AMK constraint with k=1k = 1. Sections 5 and 6 sequentially explain the approach to solving the Anti-bandwidth Problem and Nurse Rostering Problem using SAT solving. Section 7 provides experimental results that compare our proposed encoding with existing SAT encodings, as well as state-of-the-art CP and MIP solvers. Finally, Section 8 concludes the paper.

References (31)