Not solved because of time limit: Differentiating between feasible solution found and not found

1,316 views
Skip to first unread message

Varghese Kurian

unread,
Mar 27, 2017, 5:23:59 AM3/27/17
to pulp-or-discuss
Hello

I have an optimization problem that I am trying to solve using CBC which at times stops on time limit.
prob.status returns 'Not Solved' is such situations. But I wish to obtain the best feasible solution it has found (only) in case a feasible solution has been found.
Is there a way I can identify if a feasible solution has been found or not? If there is a way, and I identify that the problem has found a feasible solution, can I expect the variable values to correspond to the best feasible solution?

Thanks

Varghese

Melvin Saab

unread,
Apr 22, 2017, 2:26:30 AM4/22/17
to pulp-or-discuss
Hi Varghese,

I have the same question. How did you set the time limit for CBC using Pulp?
Message has been deleted

Franco Peschiera

unread,
Mar 2, 2018, 11:39:11 AM3/2/18
to pulp-or-discuss

Good day!

I have just arrived to this issue.

Apparently, the readsol_MPS method only searches for the first word on the solution file. If it matches ‘Stopped’, it returns there was no solution (status=0).

But if it would continue to read the whole first line, it could detect if the wording “Stopped on time - objective value {some number}” appears. This would differentiate between the cases “I did not find a solution after the time limit” and “I found a solution although it may be non-optimal”.

I believe this happens in both methods: readsol_LP and readsol_MPS from the COIN_CMD class.

Not sure what Stuart thinks about this. I’d gladly make a pull request with this change if needed.

Franco

Stuart Mitchell

unread,
Mar 4, 2018, 4:39:00 PM3/4/18
to pulp-or...@googlegroups.com
yeah that is true certain solvers can return other status

but there is not a way for pulp to return these statuses to the user


When I last looked at this I didn't add additional status values as this would break code that is expecting the previous behaviour.

But I'll gladly look at a pull request if you have any ideas

Stu

Stuart Mitchell
PhD Engineering Science
Extraordinary Freelance Programmer and Optimisation Guru

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

Sam Mathew

unread,
Feb 6, 2019, 7:47:27 AM2/6/19
to pulp-or-discuss
Hi Stuart,

As I see Franco already posted a solution on his fork of PuLP here, after discussing it here.

I found it quite useful since now I get an optimal solution, as long as there is a feasible solution when a restriction on the solution time is imposed.

Would you consider it?

Thanks,

Sam
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discu...@googlegroups.com.
To post to this group, send email to pulp-or...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages