Python documentation?

346 views
Skip to first unread message

AJ

unread,
Mar 11, 2018, 7:28:04 PM3/11/18
to or-tools-discuss
I'm confused. I am looking for documentation, but all I find is the C++ documentation. Since they don't give examples or even how the Python equivalent works, how are we supposed to know how to use solver?

Is it purely by looking at examples and trying to extract out the functions?

Laurent Perron

unread,
Mar 12, 2018, 6:56:21 AM3/12/18
to or-tools-discuss
Hi, 

I know, this is a recurring problem as SWIG does not import C++ documentation.

This being said, it depends on which solver you are using:
  - constraint_solver: This is deprecated, see CP/SAT below.
  - routing: The Python API is very close to the C++ routing.h API. See ortools/constraint_solver/routing.h and the python examples.
  - linear_solver: The API is minimal, and completely exposed in integer_programming.py and linear_programming.py
  - CP/SAT: The (rough) doc is is ortools/sat/python/cp_model.py. You can run pydoc on it and look at ortools/sat/cp_model.proto.

I hope this helps.

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


2018-03-12 0:28 GMT+01:00 AJ <codet...@gmail.com>:
I'm confused. I am looking for documentation, but all I find is the C++ documentation. Since they don't give examples or even how the Python equivalent works, how are we supposed to know how to use solver?

Is it purely by looking at examples and trying to extract out the functions?

--
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.

Message has been deleted

AJ

unread,
Mar 13, 2018, 12:44:57 AM3/13/18
to or-tools-discuss
wow I was actually using the constraint solver. Just to verify, this means that this is deprecated...

from ortools.constraint_solver import pywrapcp

in favor of this 

from ortools.sat.python import cp_model

correct? The nurse_roster.py is still outdated with the old constraint_solver. Will you guys updating it with the new sat model?
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.

Laurent Perron

unread,
Mar 13, 2018, 2:18:57 AM3/13/18
to or-tools...@googlegroups.com
There should be a nurses_sat.py example in examples/python.
Message has been deleted

AJ

unread,
Mar 19, 2018, 6:30:29 AM3/19/18
to or-tools-discuss
I been looking it over and still confused on how to update nurse rostering example to SAT (specifically the DFA portion). The example is done on the deprecated constraint package. Is anyone going to update this to the SAT version? I love what this does, just can't make sense of it without documentation.

Laurent Perron

unread,
Mar 19, 2018, 7:32:44 AM3/19/18
to or-tools...@googlegroups.com
I am looking at the nurse_roaterinf examples. In the meantime, you can have a look at all python examples with a _sat prefix.
Reply all
Reply to author
Forward
0 new messages