Repository navigation
π§© Constraint Solving POTD:Problem of the Day: Constraint Programming Meets AutoML β Learning Heuristics for Search #72076
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem Statement
The Meta-Problem: Given a family of constraint satisfaction problems (CSPs), can we use machine learning to automatically discover effective variable-ordering and value-ordering heuristics that outperform hand-crafted rules?
Concrete Instance
Consider a simple 9-variable Sudoku puzzle:
Without learned heuristics: A solver might branch on
x_1(arbitrary order), explore thousands of nodes.With a learned heuristic: The ML model predicts that
x_5(the cell with fewest initial candidates) should be solved first, reducing search dramatically.The Learning Task
Why It Matters
Industry Applications:
Scheduling & Planning β Solvers for nurse rosters, job scheduling, and project management spend 80% of time searching. Learning-guided branching cuts search time by 40β60% on industrial instances.
Configuration & Product Design β E-commerce and manufacturing systems must satisfy hundreds of product constraints in real-time. Learned heuristics reduce configuration time from seconds to milliseconds.
Circuit Design & Verification β Modern chip design involves millions of constraints. ML-guided SAT/SMT solvers prioritize variable assignments that quickly discover conflicts, accelerating verification workflows.
Combinatorial Optimization at Scale β Delivery routing, warehouse optimization, and supply chain problems grow too large for classical heuristics. Adaptive, learned orderings handle new problem distributions without re-tuning.
Modeling Approaches
Approach 1: Imitation Learning (Behavioral Cloning)
Paradigm: Machine Learning (supervised learning)
Idea: Train a neural network to mimic the decisions made by an expert solver (e.g., greedy "most constrained variable" heuristic).
Key Variables:
Ο(x_i) β [0, 1]β predicted "priority score" of variablex_i(from a trained neural net)features(i)β extracted features (domain size, neighbors in constraint graph, propagation estimate, etc.)High-Level Model:
Trade-offs:
Approach 2: Reinforcement Learning with Solver-in-the-Loop
Paradigm: Hybrid CP + Machine Learning
Idea: Use reinforcement learning to directly optimize solver performance. The solver runs; the RL agent observes search state and chooses the next variable to branch on.
Key Variables:
s_t = (constraint graph, remaining domains, propagation status at time t)a_t = x_jβ choose variablex_jto branch onr_t = -nodes_explored - wall_time(negative: we want to minimize)Algorithm Sketch (Policy Gradient):
Trade-offs:
Approach 3: Symbolic Regression + Constraint Theory
Paradigm: Hybrid Symbolic Learning + Classical CP
Idea: Use symbolic regression (e.g., genetic programming) to discover a mathematical formula for variable ordering.
Example Formula Discovered:
Trade-offs:
Example: Pseudocode for Learning-Guided Search
Key Techniques
1. Graph Neural Networks (GNNs) for Structure Learning
CSPs naturally encode as graphs: variables are nodes, constraints are hyperedges. A GNN processes this structure directly, learning to embed variables based on their neighborhood context.
2. Progressive Sharpening via Self-Play and Curriculum Learning
Train the heuristic on progressively harder instances:
The solver converges faster when it doesn't see worst-case instances from day one.
3. Exploiting Symmetry in Search Trajectories
Many CSPs have inherent symmetries (e.g., permuting rows/columns in Sudoku doesn't change satisfiability). A learned heuristic that respects symmetry needs only be trained once; it applies to all symmetric variants.
Challenge Corner
π₯ Open Questions for You:
Transfer Learning: If you train a heuristic on Sudoku instances, how much does it transfer to graph coloring problems? Can you design a problem-agnostic feature representation that works across CSP families?
Explainability: A trained neural network's variable-ordering decisions are often opaque. Can you extract and validate a symbolic formula from a learned heuristic that is both interpretable and nearly as effective?
Online Learning: Suppose you don't have time to pre-train on thousands of instances. How can you use online / lifelong learning to improve the heuristic as the solver encounters new instances during deployment?
Hybrid Backbone: What if you combined learned heuristics with classical bounds (e.g., constraint propagation, LP relaxations)? Can you design a solver that seamlessly switches between symbolic reasoning and neural predictions based on problem size?
References
Liang, Y., Verse, C., & Dilkina, B. (2022). "Learning Variable Ordering Heuristics for Constraint Satisfaction Problems." IJCAI. A foundational paper on using ML to predict variable order in CSPs.
Bengio, Y., Lodi, A., & Prouvost, A. (2021). "Machine Learning for Combinatorial Optimization: A Methodological Survey." European Journal of Operational Research. Comprehensive overview bridging ML and combinatorial solvers.
Li, Y., Choi, D., Tarlow, D., & Urtasun, R. (2019). "Graph Neural Networks for Learning Approximate Subgraph Isomorphism." NeurIPS. Shows how GNNs learn graph matching heuristics; principles apply to constraint graphs.
Khalil, E. B., Dilkina, B., Nemhauser, G. L., Ahmed, S., & Shao, Y. (2017). "Learning Combinatorial Optimization Algorithms over Graphs." NeurIPS. RL framework for learning branching strategies in branch-and-cut.
Solver Documentation: [Google OR-Tools ML Integration]((developers.google.com/redacted), Chuffed CP Solver β both explore ML-guided search.
Next Steps: Experiment with graph neural networks on a small CSP benchmark. Train a GNN to predict domain-size-based variable order on random graph-coloring instances, and measure how much faster your solver runs compared to the greedy baseline!
All reactions