3 ms·
Personally, I would not choose to solve a constraint programming problem in Prolog, unless I really needed to use a specific global constraint that is only avai
by mzl 5y ago
Personally, I would not choose to solve a constraint programming problem in Prolog, unless I really needed to use a specific global constraint that is only available in some Prolog engine (such as the geost constraint in SICStus Prolog).
When I need to solve a CP problem, I typically do one of the following
* Write a simple model in MiniZinc. This is great for experimentation and testing different solvers to see which kind of solver might be suitable (different CP solvers, MIP solvers, etc)
* For some cases or if I need to integrate with a larger system I write my code using a library directly, such as Gecode, Choco, or or-tools. Using a system directly has the benefit that it is possible to program a custom search heuristic, which I find is often very useful for solving problems in practice.
* Write a custom algorithm. Sometimes the right answer is to just write some code solving the problem directly.
I find models written in a modeling language such as MiniZinc or in a traditional
Programming language such as C++, Java, or Python to be easier to read and reason about than Prolog programs that solve constraint problems. That is a personal preference, and varies depending on familiarity.