Solving time

1,029 views
Skip to first unread message

Andrea Rufini

unread,
Feb 24, 2019, 2:13:10 PM2/24/19
to or-tools-discuss
Hello,

Is there a way in the cp-sat solver to measure the solving time (apart from using the python time I mean)?

Moreover, what if I want to give a time limit after at least one solution has been found?

Thanks

Laurent Perron

unread,
Feb 24, 2019, 3:51:44 PM2/24/19
to or-tools...@googlegroups.com
1) print(solver.ResponseStats())

2) Not trivial. Look at:
https://github.com/google/or-tools/blob/master/ortools/sat/doc/solver.md.
I am not sure you can do it, as there is not much you can do from the
solution callback. What I would do it so solve without an objective.
Store the solution, then solve with the objective, the time limit, and
maybe solution hinting if this is needed.


2019-02-24 20:13 UTC+01:00, Andrea Rufini <a.ru...@gmail.com>:
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>


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

Andrea Rufini

unread,
Feb 25, 2019, 5:35:07 AM2/25/19
to or-tools-discuss
Thanks!

About 1, what should I use? walltime, usertime or deterministic time? (I know it may be a stupid question, but anyway...)

About 2, I'll investigate a bit, although for now is not an absolute need.

Laurent Perron

unread,
Feb 25, 2019, 5:36:45 AM2/25/19
to or-tools-discuss
Walltime. Deterministic time is not fully implemented for all CP constraints. So it is not reliable, even it if is deterministic :-)

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


Andrea Rufini

unread,
Mar 14, 2019, 1:17:49 PM3/14/19
to or-tools-discuss
Sorry for re-opening this question. The solving time I need is to measure the solution space exploration: walltime is too unreliable for this and as you said I can't use deterministic time. Are 'Integer propagations' and 'propagations' good for this?

Laurent Perron

unread,
Mar 14, 2019, 3:12:36 PM3/14/19
to or-tools-discuss
Yes, look at the CpSolverResponse message in cp_model.proto.

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


Le jeu. 14 mars 2019 à 18:17, Andrea Rufini <a.ru...@gmail.com> a écrit :
Sorry for re-opening this question. The solving time I need is to measure the solution space exploration: walltime is too unreliable for this and as you said I can't use deterministic time. Are 'Integer propagations' and 'propagations' good for this?

--
Reply all
Reply to author
Forward
0 new messages