How do I specify an initial feasible solution for a MIP problem in AMPL with Cplex as the solver?

352 views
Skip to first unread message

Feng

unread,
Jul 27, 2011, 5:28:46 PM7/27/11
to AMPL Modeling Language
Is that possible?

Thanks

Robert Fourer

unread,
Jul 28, 2011, 6:52:20 PM7/28/11
to am...@googlegroups.com
If you assign values to the variables before solving with CPLEX, those
values will be passed from AMPL to CPLEX as an initial solution when you
invoke "solve". (The same works with many other solvers, actually.)

You can assign initial values in a variable's definition, as in this
example:

var Buy {j in FOOD} := (buy_min[j] + buy_max[j]) / 2;

Or you can assign initial values in a data file in the same way that you
give values to parameters. Alternatively you can write an AMPL script to
compute initial values and assign them to variables using let statements. A
simple example would be

let {j in FOOD} Buy[j] := (buy_min[j] + buy_max[j]) / 2;

but you can have much more complex logic in a script.

Bob Fourer
4...@ampl.com


> -----Original Message-----
> From: am...@googlegroups.com [mailto:am...@googlegroups.com]
> On Behalf Of Feng
> Sent: Wednesday, July 27, 2011 4:29 PM
> To: AMPL Modeling Language
> Subject: [AMPL 4844] How do I specify an initial feasible solution for a
MIP
> problem in AMPL with Cplex as the solver?
>
> Is that possible?
>
> Thanks
>


Reply all
Reply to author
Forward
0 new messages