getting the top n solutions for a MIP using CBC

373 views
Skip to first unread message

Paulien

unread,
Feb 25, 2015, 4:47:49 AM2/25/15
to ai...@googlegroups.com
Good morning,

I would like to ask if it is possible to get more than one solution from aimms. Specifically, something like the 3 or 5 best solutions. I have a MIP model that works the way I want it to, and I am using the CBC solver (the only MIP solver I have right now). Is this possible, and if so how do I do it?
If not, what are the solvers that could do it? Since the company I work for has limited resources, a free or cheaper solver would be preferred.
Thanks for any pointers you could give me.

Paulien

Franco Peschiera

unread,
Feb 25, 2015, 7:00:24 AM2/25/15
to ai...@googlegroups.com
Good day,

The simplest way to get the intermediate solutions in AIMMS would be to use a callback that is executed everytime the solver finds a solution and stores the information.

As far as I know, the CBC solver (or at least the CBC interface with AIMMS) has no callback functionality (GUROBI and CPLEX do have this in AIMMS).

I would recommend looking into the CBC documentation to see if this if it is at least able to report intermediate solutions (via a text file like a log). If this is possible you could then try to import this somehow into AIMMS.

regards,


Franco Peschiera
Jefe de proyectos
baobab soluciones

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aimms+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcel Hunting

unread,
Feb 25, 2015, 7:19:05 AM2/25/15
to
Hi,

CBC cannot give you the best 5 solutions directly. Neither can CPLEX or Gurobi but they offer more possibilities to get multiple solutions, like the solution pool.

What you can do is solve your MIP problem 5 times, whereby each run adds constraints that eliminate the optimal solution found during the previous solve. AIMMS offers functionality to automatically add these solution-elimination-constraints, as demonstrated in the Dice example from the list of AIMMS Practical Examples. See the procedure EliminationRows. (Note that this example also demonstrates other ways to obtain multiple solutions, like the aforementioned solution pool.)

A disadvantage of this approach is that the total solving time will be about 5 times longer.

Best regards,

Marcel Hunting
AIMMS Optimization Specialist

Paulien

unread,
Feb 26, 2015, 5:51:51 AM2/26/15
to ai...@googlegroups.com
Hi Marcel,

Thank you. I will try the "run 5 times" solution. Longer solution time is not really a problem, as it is about 2 seconds right now.

Paulien



On Wednesday, February 25, 2015 at 1:19:05 PM UTC+1, Marcel Hunting wrote:
Hi,

CBC cannot give you the best 5 solutions directly. Neither can CPLEX or Gurobi but they offer more possibilities to get multiple solutions, like the solution pool.

What you can do is solve your MIP problem 5 times, whereby each run adds constraints that eliminate the optimal solution found during the previous solve. AIMMS offers functionality to automatically add these solution-elimination-constraints, as demonstrated in the Dice example from the list of AIMMS Practical Examples. See the procedure EliminationRows. (Note that this example also demonstrates other ways to obtain multiple solutions, like the aforementioned solution pool.)

A disadvantage of this approach is that the total solving time will be about 5 times longer.

Best regards,

Marcel Hunting
AIMMS Optimization Specialist

On Wednesday, February 25, 2015 at 10:47:49 AM UTC+1, Paulien wrote:
Reply all
Reply to author
Forward
0 new messages