Best way to solve polyominoes packing with OR-Tools (MiniZinc Challenge problem in 2021) #4142
Unanswered
zayenz
asked this question in
CP-SAT questions
Replies: 3 comments 3 replies
-
https://github.com/MrBenGriffin/or-tools-fun?tab=readme-ov-file#polyomino-puzzle-solver ? |
Beta Was this translation helpful? Give feedback.
1 reply
-
you are mistaking pentominoes and polyominoes. |
Beta Was this translation helpful? Give feedback.
1 reply
-
I have just added a simple cover approach https://github.com/google/or-tools/blob/main/examples/python/pentominoes_sat.py |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am wondering what the best way would be to solve a polyominoes packing problem using OR-Tools.
The background is that I am thinking about solving problems like the packing problem that was used in the MiniZinc Challenge 2021 which was a subset of the problems in minizinc-pentominoes-generator. That model uses an encoding of packing polyominoes into a set of regular language constraints.
Unfortunately, it seems like this model is not very efficient when used with OR-Tools, and I am guessing that the problem is that OR-Tools decomposes the regular constraints into a lot of smaller constraints. For example, in the instance
size_10_tiles_10_seed_17_strategy_target
with MiniZInc 2.8.3 Gecode (6.3.0) has 110 variables and 10 propagators, while OR-Tools (9.8) has 6.3k Boolean variables and around 15k constraints, and solve time with 10 threads and free search on a M1 Max is around 8.7s for OR-Tools and 0.2s for Gecode. In addition, the regular decomposition is only available for the FlatZinc interface and not if the C++/Python OR-Tools CP-SAT modelling.What would be a good way to solve polyominos-like packing problems in OR-Tools in a way that works well with OR-Tools?
Beta Was this translation helpful? Give feedback.
All reactions