[Scip] More solutions

Tobias Achterberg achterberg at zib.de
Thu Nov 19 15:55:07 MET 2009


First, SCIP does not have a "populate" feature like CPLEX. That means, if the model is 
solved to optimality, you cannot get more solutions (alternative optima or inferior 
solutions).

SCIP collects all solutions that it finds during the solving process. With the "write 
solution" command, you can only write the current incumbent (i.e., best known solution).

Using the callable library, you could also access the other solutions, but I think that 
this is not possible with the interactive version of SCIP.

If you are not afraid of implementing stuff on your own, it is very easy to extend SCIP to 
do what you want, i.e., to add an interactive command like "write allsolutions". You just 
need to write a dialog handler plugin (look at src/scip/dialog_default.c how to do this). 
The SCIP team can certainly help you with this if you have any questions.


Tobias


Julio Rojas wrote:
> Maybe I'm doing something wrong. Let me write the commands I'm issuing:
>
> read problem.lp
> set limits solutions 1
> optimize
> write solution sol1.txt
> read problem.lp
> set limits solution 2
> optimize
> write solution sol2.txt
>
> sol1.txt and sol2.txt should be different, as the optimizer is telling
> me it have found two solutions, but that's not the case as both
> solutions are the same (diff sol1.txt sol2.txt).
>
> If I do this:
>
> read problem.lp
> set limits solutions 1
> optimize
> write solution sol1.txt
> set limits solution 2
> optimize
>
> Then the solver tells me the model is already solved and the same
> solution appears.
>
> So, maybe there is just one solution even if the solver says there are
> two? Or I'm not doing the correct procedure to get the second solution.
>
> Thank you so much for your time and patience.
> -------------------------------------------------
> Julio Rojas
> jcredberry at gmail.com <mailto:jcredberry at gmail.com>
>
>
> On Thu, Nov 19, 2009 at 2:45 PM, Stefan Vigerske
> <stefan at math.hu-berlin.de <mailto:stefan at math.hu-berlin.de>> wrote:
>
>     Hi,
>
>     I think the idea was to set the limit to one before starting
>     optimization. Then it should stop when the limit is reached, and so
>     on...
>
>     Stefan
>
>     Am 19.11.2009 14:22, schrieb Julio Rojas:
>      > I tried to do what you suggest me. In one problem, after
>     optimization, the
>      > report is the following:
>      >
>      > SCIP Status        : problem is solved [optimal solution found]
>      > Solving Time (sec) : 0.07
>      > Solving Nodes      : 1
>      > Primal Bound       : +5.20000000000000e+01 (2 solutions)
>      > Dual Bound         : +5.20000000000000e+01
>      > Gap                : 0.00 %
>      >
>      > So, in theory, I have two solutions. If I check the value of the
>     solution
>      > limit it shows:
>      > SCIP> set limits solution
>      > current value: -1, new value [-1,2147483647]: 2
>      > parameter <limits/solutions> set to 2
>      >
>      > It doesn't matter if I do it before or after optimization, when I run
>      > optimize again it tells me the problem has already been solved
>     and no new
>      > solution is presented.
>      >
>      > Thanks for your kind help.
>      > -------------------------------------------------
>      > Julio Rojas
>      > jcredberry at gmail.com <mailto:jcredberry at gmail.com>
>      >
>      >
>      >
>      >
>      > _______________________________________________
>      > Scip mailing list
>      > Scip at zib.de <mailto:Scip at zib.de>
>      > http://listserv.zib.de/mailman/listinfo/scip
>
>
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip


More information about the Scip mailing list