Infeasible solution for pywraplp

235 views
Skip to first unread message

Eric Yeap

unread,
Apr 8, 2021, 11:10:31 PM4/8/21
to or-tools-discuss
I am using OR-Tools to run a linear programming model (pywraplp) and the solver I am interested in is SCIP.
I notice that, when infeasibility happens, the Spyder will terminate itself as seen in the screenshot below. As a result, the code that follows the OR-Tools model cannot proceed. To run the model again, I have to manually restart the kernel.
Is there any way I can stop this from happening? If the solution is infeasible, I would want it to give me a message and let me continue running the rest of the code.

The OR-Tools version is 8.1.8487.
ortools infeasible.PNG

Laurent Perron

unread,
Apr 9, 2021, 1:11:03 AM4/9/21
to or-tools-discuss
Most likely you are trying to read a solution even if the model is infeasible. 

--
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/6397c6f6-027f-410f-b9b9-c5e31e6f8822n%40googlegroups.com.

Eric Yeap

unread,
Apr 9, 2021, 2:53:05 AM4/9/21
to or-tools-discuss
Thank you Laurent for the quick response.

I think I've found the problem resulting in kernel crash. It was due to this line.

ortools infeasible2.PNG
I removed it and the kernel won't crash anymore, even though the solution is infeasible.

Eric Yeap

unread,
Apr 9, 2021, 3:09:31 AM4/9/21
to or-tools-discuss
I have another question though. Read somewhere that it is highly recommended to include VerifySolution() in model.
Is it true?

Reply all
Reply to author
Forward
0 new messages