detecting multiple LP solutions

32 views
Skip to first unread message

hosein.h...@gmail.com

unread,
Oct 17, 2016, 10:07:13 AM10/17/16
to AMPL Modeling Language
hello,
I need to detect multiple solutions of an LP problem with CPLEX. Is there any options in CPLEX for this purpose? 

Robert Fourer

unread,
Oct 18, 2016, 3:04:16 PM10/18/16
to am...@googlegroups.com
To generate multiple optimal solutions to a mixed-integer program, each with different values for some of the integer variables, try something like

option solver cplex, cplex_options 'poolstub=pname poolcapacity=n poolintensity=3 poolgap=0 populate=2';

where n is replaced by the number of solutions that you want, and pname can be replaced by any filename that you like. (See http://ampl.com/products/solvers/solvers-we-sell/cplex/options/ for more information on setting these options.) You will see a message from CPLEX like

Wrote 5 solutions in solution pool
to files pname1.sol ... pname5.sol.

To read and look at a solution, use a command like

solution pname3.sol;

For a continuous linear program there is no feature in CPLEX to generate more than one optimal solution; see also my comments in

https://groups.google.com/d/msg/ampl/ZcO8KUeDBpU/GjwZwGU-CwAJ

Bob Fourer
am...@googlegroups.com

=======

hosein.h...@gmail.com

unread,
Oct 21, 2016, 12:49:57 AM10/21/16
to AMPL Modeling Language, 4...@ampl.com
thanks. Is it possible to treat an LP and an MIP with cplex, to generate such pool of solutions for an LP model? 

Robert Fourer

unread,
Oct 24, 2016, 1:41:19 PM10/24/16
to am...@googlegroups.com
CPLEX only generates pools of solutions that have differing values for the integer variables. If there are no meaningful integer variables in the problem, the solution pool feature will not be useful.
Reply all
Reply to author
Forward
0 new messages