Learning Variable Ordering Heuristics for Solving Constraint Satisfaction Problems

Wen Song, Zhiguang Cao, Jie Zhang, Andrew Lim
12/23/2019
cs.AIcs.LG

Official code: songwenas12/csp-drl (11 stars, C++, Apache-2.0, last commit 2022-02-14).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Implementation of "Learning Variable Ordering Heuristics for Solving Constraint Satisfaction Problems"

113C++, PythonDec 9, 20214 years agoApache-2.0

Similar Papers

Cite this paper

@article{song2019learning,
  title  = {Learning Variable Ordering Heuristics for Solving Constraint Satisfaction Problems},
  author = {Wen Song and Zhiguang Cao and Jie Zhang and Andrew Lim},
  year   = {2019},
  eprint = {1912.10762},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1912.10762}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1912.10762.svg)](https://codeofpaper.com/paper/1912.10762)

Discussion