[SCIP] multiple SCIP solutions in Matlab

Felipe Serrano fserranom5 at gmail.com
Thu Dec 8 08:24:49 CET 2016


Hi Jan

Java interface doesn't support counting.

The Python interface only supports getting the number of feasible solution,
but not accessing them (see https://github.com/SCIP-Interfaces/PySCIPOpt
commit 5384440
<https://github.com/SCIP-Interfaces/PySCIPOpt/commit/5384440d808bdb8767bd934724118ff023ceb2b0>
)

I suspect that it should be simple to implement some functionality that
allows writing the solutions to a file. However, I can imagine it is a
little bit more complicated to access them through the interface. You are
of course welcome to try to support any of these functionalities.

A small example:

from pyscipopt import Model
m = Model()
varx = m.addVar("x", "I", 0, 5)
m.count()
print("found ", m.getNCountedSols(), " solutions")

When ran I got: found  6  solutions

Best
Felipe




On Wed, Dec 7, 2016 at 11:07 PM, Jan Goos <jan.goos at vub.ac.be> wrote:

> Hello Jonathan,
>
> Many thanks for your swift response. For now, I’ll try and use a different
> approach. Nevertheless, I’d rather stay away from C. Do the Java and Python
> interfaces support the collection of multiple solutions?
>
> Keep up the good work!
> Best regards,
> J a n
>
>
> On 7 Dec 2016, at 22:58, Jonathan Currie <jonathan.currie at aut.ac.nz>
> wrote:
>
> Hi Jan,
>
> That functionality does not exist via OPTI at present, but it sounds like
> it should! I’ll have a look this weekend.
>
> Jonathan
>
> *From:* Scip [mailto:scip-bounces at zib.de <scip-bounces at zib.de>] *On
> Behalf Of *Jan Goos
> *Sent:* Thursday, 8 December 2016 10:54 AM
> *To:* scip at zib.de
> *Subject:* [SCIP] multiple SCIP solutions in Matlab
>
> Dear SCIPers,
> I am using SCIP via OPTI Toolbox in Matlab, and I'd like to enumerate
> multiple solutions. After thoroughly reading the documentation, I
> formulated the following example IP:
> opts = scipset('scipopts',{'constraints/countsols/collect',1});
> opts = optiset('solver','scip','solverOpts',opts);
> Opt = opti('f',0,'bounds',0,4,'xtype','I','options',opts)
> x = solve(Opt)
> I would like to get the 5 equally valid solutions [0,1,2,3,4], but I only
> get 1 [0]. Can you please tell me what I'm missing?
> Best regards,
> J a n
>
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20161208/db0bc016/attachment.html>


More information about the Scip mailing list