MIP Initialization

564 views
Skip to first unread message

Armand Quenum

unread,
Sep 26, 2019, 9:58:37 AM9/26/19
to or-tools-discuss
Hey Laurent -

I am trying to construct an optimization model in python using OR-Tools pywraplp module. I have a working model but I would like to insert the ability to initialize the model with a feasible solution as a starting point. However, I am having trouble finding documentation demonstrating how to include this in python. Can you provide assistance or point me in the right direction?

Thank you in advance and any help would be greatly appreciated!

Armand Quenum

Laurent Perron

unread,
Sep 26, 2019, 10:16:28 AM9/26/19
to or-tools-discuss

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/358d5206-3f39-4ea6-9bbc-49bd9f276493%40googlegroups.com.


--
--Laurent

marianne....@gmail.com

unread,
Aug 6, 2021, 11:52:59 AM8/6/21
to or-tools-discuss
I am refactoring someone's code (using pywraplp with 'CP-SAT' solver) where they used SetHint inside a for loop to feed individual hints, like so:
for var, val in zip(variables, hint_values):
    solver.SetHint([var], [val])

They mentioned the hints not necessarily helping find a feasible solution.

My questions are:
1. Is this because they should really assign all hints in one go, as in
solver.SetHint(variables, hint_values)

2. Is there documentation on what happens when you call SetHint multiple times? Or if you set a hint for only a partial solution?

3. Is there documentation on which solvers apply hints, or should I hunt down documentation of the solvers themselves?

4. If the hint is a feasible solution, and the particular solver used does apply hints, are you guaranteed a feasible solution?

Thank you in advance!

Laurent Perron

unread,
Aug 6, 2021, 12:18:08 PM8/6/21
to or-tools-discuss
1) each time you call SetHint, it clears the previous hints.
2) the code
3) CP-SAT, SCIP and Gurobi support hints
4) No.
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



blind.lin...@gmail.com

unread,
Aug 6, 2021, 12:44:27 PM8/6/21
to 'Laurent Perron' via or-tools-discuss
On Fri, Aug 06, 2021 at 06:17:53PM +0200, or-tools wrote:
> 1) each time you call SetHint, it clears the previous hints.

Oh my!

Looks like I have some work to do this weekend.
> >>> <https://groups.google.com/d/msgid/or-tools-discuss/358d5206-3f39-4ea6-9bbc-49bd9f276493%40googlegroups.com?utm_medium=email&utm_source=footer>
> >>> .
> >>>
> >>
> >>
> >> --
> >> --Laurent
> >>
> >> --
> > 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.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/or-tools-discuss/d09ea6e9-9800-441e-98e8-a256601641a0n%40googlegroups.com
> > <https://groups.google.com/d/msgid/or-tools-discuss/d09ea6e9-9800-441e-98e8-a256601641a0n%40googlegroups.com?utm_medium=email&utm_source=footer>
> > .
> >
>
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/CABcmEeZHntHfHBDdvz%2B%3DQREcbv2gAUYUpmzoYWxixYQ%2BCaBcmQ%40mail.gmail.com.

--

James E. Marca
Activimetrics LLC
Reply all
Reply to author
Forward
0 new messages