If you do a "solve" in AMPL and then another "solve", then normally AMPL will send the solution from the first solve to CPLEX to use, if possible, in starting the second solve. [You do need to be sure that there is no "reset" command between the solves, that no other values were assigned to the variables between the solves (using "let" statements, for instance), and that there wasn't an "option reset_initial_guesses 1;" command which suppresses sending the solution to the second solve.]
Can you be more specific as to why you think that "it didn't work"? If CPLEX was able to use the first solution in starting on the second solve, you should see messages about "MIP starts", such as
1 of 1 MIP starts provided solutions.
MIP start 'm1' defined initial solution with objective 233975.0000.
However, if you only see a message like
Retaining values of one MIP start for possible repair.
then your solution from the first problem may not have been feasible for the second, and CPLEX may not have been able to use it.
Also, AMPL's presolve phase may change the problem in ways that make it hard to send a feasible solution, so you may want to try your runs with "option presolve 0;". And finally, it is important to keep in mind that initial solutions are of only limited value to CPLEX when solving MIPs. So even if you give CPLEX a feasible solution, the time to reach a 1% mipgap may not be reduced very much.
Bob Fourer
am...@googlegroups.com
=======
From:
am...@googlegroups.com [mailto:
am...@googlegroups.com] On Behalf Of Guillaume Marois
Sent: Wednesday, June 17, 2015 2:02 PM
To:
am...@googlegroups.com
Subject: [AMPL 10079] Using previous solution to solve faster
I'm currently working on a MIP problem with cplex on AMPL.
And right now I need it to solve faster.
I know it's possible to use a previous solution of the problem to help cplex find an initial solution.
I've been trying to do so for quite a long time now and I haven't find the right way so far.
I tried solving both problems one after the other in a run file, so that the results of the first one would be kept in memory but it didn't work.
The options I use with cplex are : ' time 180 mipdisplay 2 mipgap 0.01 mipemphasis 1'
Is there an option I should add? Or am I just doing this all wrong?