Learn Google or-tools

2,148 views
Skip to first unread message

kee...@cityswifter.com

unread,
Jul 31, 2018, 5:39:35 AM7/31/18
to or-tools-discuss
I've recently started a job that requires use of constraint programming, and we have decided to use Google or-tools (in Python) as our main library. I just want to know does anyone have any recommendations for how best to learn how to use the or-tools constraint programmer from a practical point of view? I have not been able to find much documentation/tutorials on how to use it. The only real resource I found that goes beyond the most basic options is here http://www.lia.disi.unibo.it/Staff/MicheleLombardi/or-tools-doc/documentation_hub.html .
Unfortunately this documentation is a bit too technical for me (I come more from a maths background than computer science, with limited knowledge of C++, which any code in that documentation is written in), as I (initially at least) just want to see how to implement different kinds of constraints, and change the way the program explores the search tree etc. Additionally, that document, as far as I can tell, only deals with the original CP solver, rather than the newer, and recommended CP-SAT solver. Are there any courses or tutorials that explain how to use this from a practical point of view in Python?

Jon Orwant

unread,
Jul 31, 2018, 7:25:25 AM7/31/18
to or-tools-discuss
The CP-SAT solver is new enough that not a whole lot of documentation exists -- but we're working to fix that!

https://developers.google.com/optimization/cp/cp_solver#cp-sat_example is where to start. If you have questions, post them here and we'll answer them.

Jon

On Tue, Jul 31, 2018 at 5:39 AM, <kee...@cityswifter.com> wrote:
I've recently started a job that requires use of constraint programming, and we have decided to use Google or-tools (in Python) as our main library. I just want to know does anyone have any recommendations for how best to learn how to use the or-tools constraint programmer from a practical point of view? I have not been able to find much documentation/tutorials on how to use it. The only real resource I found that goes beyond the most basic options is here http://www.lia.disi.unibo.it/Staff/MicheleLombardi/or-tools-doc/documentation_hub.html .
Unfortunately this documentation is a bit too technical for me (I come more from a maths background than computer science, with limited knowledge of C++, which any code in that documentation is written in), as I (initially at least) just want to see how to implement different kinds of constraints, and change the way the program explores the search tree etc. Additionally, that document, as far as I can tell, only deals with the original CP solver, rather than the newer, and recommended CP-SAT solver. Are there any courses or tutorials that explain how to use this from a practical point of view in Python?

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Laurent Perron

unread,
Jul 31, 2018, 10:30:19 AM7/31/18
to or-tools-discuss
And https://github.com/google/or-tools/blob/master/ortools/sat/doc/index.md is a set of small recipes to implement specific features.
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.

kee...@cityswifter.com

unread,
Aug 1, 2018, 11:53:42 AM8/1/18
to or-tools-discuss
Ok, no problem, thanks very much. First I'm wondering what the difference is between calling solver.Solver(), and solver.NewSearch(solver.Phase(...))?
And secondly, how do I use IntervalVar's? My understanding was that I could add these to my problem using solver.IntervalVar(min_start, max_start, min_duration, max_duration, min_end, max_end, "name"), but when I do this solver.NewSearch(...) no longer seems to work, while it works fine for IntVar's.
Reply all
Reply to author
Forward
0 new messages