multiple solutions in MIP CBC

182 views
Skip to first unread message

Alessandro Zanarini

unread,
Nov 19, 2016, 10:19:29 AM11/19/16
to or-tools...@googlegroups.com
Hi all -

I have a pure feasibility problem that I have implemented with a simple CP model (python). I need to list all the feasible solutions.

For the sake of comparison, I would like to create a MIP model that does the same (CBC). How can I retrieve multiple solution from the solver?

Thanks
Alessandro 

Driss Lahlou

unread,
Nov 21, 2016, 8:14:40 AM11/21/16
to or-tools...@googlegroups.com
Hello Alessandro,

As for your first question, you can use MakeAllSolutionCollector(), it will return a SolutionCollector that has the method Solution, you can use it to get the nth found solution.

I hope this helps.

Regards,

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



--

driss

Driss Lahlou

unread,
Nov 21, 2016, 8:51:18 AM11/21/16
to or-tools...@googlegroups.com
Addendum :

Returning multiple solutions from solvers like CBC is not supported. You can retrieve only the best solution.

--

driss

Alessandro Zanarini

unread,
Nov 22, 2016, 1:13:19 AM11/22/16
to or-tools...@googlegroups.com
Hi,

thanks for the reply. I was actually referring to the enumeration of the MIP solutions.
For reference, I ended up adding a cut after each solution has been found, and solve again (though it might not be the most efficient way to do it...)

Best,
Alessandro

Laurent Perron

unread,
Nov 22, 2016, 4:34:19 AM11/22/16
to or-tools...@googlegroups.com
I do not know of any other portable way.
I know cplex supports enumerating solutions (and maybe other solvers do), but we do not support it. 

Thanks



Le mar. 22 nov. 2016 à 07:13, Alessandro Zanarini <alessandr...@gmail.com> a écrit :
Hi,

thanks for the reply. I was actually referring to the enumeration of the MIP solutions.
For reference, I ended up adding a cut after each solution has been found, and solve again (though it might not be the most efficient way to do it...)

Best,
Alessandro
On Mon, Nov 21, 2016 at 2:51 PM, 'Driss Lahlou' via or-tools-discuss <or-tools...@googlegroups.com> wrote:
Addendum :

Returning multiple solutions from solvers like CBC is not supported. You can retrieve only the best solution.

On Mon, Nov 21, 2016 at 2:14 PM, Driss Lahlou <dla...@google.com> wrote:
Hello Alessandro,

As for your first question, you can use MakeAllSolutionCollector(), it will return a SolutionCollector that has the method Solution, you can use it to get the nth found solution.

I hope this helps.

Regards,
On Sat, Nov 19, 2016 at 4:19 PM, Alessandro Zanarini <alessandr...@gmail.com> wrote:
Hi all -

I have a pure feasibility problem that I have implemented with a simple CP model (python). I need to list all the feasible solutions.

For the sake of comparison, I would like to create a MIP model that does the same (CBC). How can I retrieve multiple solution from the solver?

Thanks
Alessandro 

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



--

driss



--

driss

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

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

Alessandro Zanarini

unread,
Nov 23, 2016, 1:26:43 PM11/23/16
to or-tools...@googlegroups.com
Hi Laurent,

thanks for the feedback.

Ciao,
Alessandro

On Tue, Nov 22, 2016 at 10:34 AM, Laurent Perron <laurent...@gmail.com> wrote:
I do not know of any other portable way.
I know cplex supports enumerating solutions (and maybe other solvers do), but we do not support it. 

Thanks


Le mar. 22 nov. 2016 à 07:13, Alessandro Zanarini <alessandr...@gmail.com> a écrit :
Hi,

thanks for the reply. I was actually referring to the enumeration of the MIP solutions.
For reference, I ended up adding a cut after each solution has been found, and solve again (though it might not be the most efficient way to do it...)

Best,
Alessandro
On Mon, Nov 21, 2016 at 2:51 PM, 'Driss Lahlou' via or-tools-discuss <or-tools-discuss@googlegroups.com> wrote:
Addendum :

Returning multiple solutions from solvers like CBC is not supported. You can retrieve only the best solution.

On Mon, Nov 21, 2016 at 2:14 PM, Driss Lahlou <dla...@google.com> wrote:
Hello Alessandro,

As for your first question, you can use MakeAllSolutionCollector(), it will return a SolutionCollector that has the method Solution, you can use it to get the nth found solution.

I hope this helps.

Regards,
On Sat, Nov 19, 2016 at 4:19 PM, Alessandro Zanarini <alessandr...@gmail.com> wrote:
Hi all -

I have a pure feasibility problem that I have implemented with a simple CP model (python). I need to list all the feasible solutions.

For the sake of comparison, I would like to create a MIP model that does the same (CBC). How can I retrieve multiple solution from the solver?

Thanks
Alessandro 

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



--

driss



--

driss

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

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

--
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.
Reply all
Reply to author
Forward
0 new messages