Papers › Learning Variable Ordering Heuristics for Solving Constraint Satisfaction Problems

Learning Variable Ordering Heuristics for Solving Constraint Satisfaction Problems

23 Dec 2019arXiv:1912.10762archive 2025-07-28

Wen Song, Zhiguang Cao, Jie Zhang, Andrew Lim

Backtracking search algorithms are often used to solve the Constraint Satisfaction Problem (CSP). The efficiency of backtracking search depends greatly on the variable ordering heuristics. Currently, the most commonly used heuristics are hand-crafted based on expert knowledge. In this paper, we propose a deep reinforcement learning based approach to automatically discover new variable ordering heuristics that are better adapted for a given class of CSP instances. We show that directly optimizing the search cost is hard for bootstrapping, and propose to optimize the expected cost of reaching a leaf node in the search tree. To capture the complex relations among the variables and constraints, we design a representation scheme based on Graph Neural Network that can process CSP instances with different sizes and constraint arities. Experimental results on random CSP instances show that the learned policies outperform classical hand-crafted heuristics in terms of minimizing the search tree size, and can effectively generalize to instances that are larger than those used in training.

PaperPDFCode

Code

songwenas12/csp-drl officialmentioned in papermentioned on GitHub report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

Deep Reinforcement LearningGraph Neural NetworkReinforcement Learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Graph Neural Network

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections