Shadow price doesn’t work in AMPL version 20180123 using solver CPLEX 12.7.1

49 views
Skip to first unread message

Chia-Chun Tsai

unread,
May 14, 2018, 2:36:26 PM5/14/18
to am...@googlegroups.com

Hi,

 

In mixed integer programming problem, the shadow price doesn’t work in AMPL version 20180123 using solver CPLEX 12.7.1. I tried to display constraints to get shadow price, but it returns all zero.  In the same problem, I can get some constraints nonzero shadow price in AMPL Version 20140124 using solver 12.6.0. Any advice? Thanks.

 

Best Regards,

Chia-Chun

AMPL Google Group

unread,
May 14, 2018, 6:08:10 PM5/14/18
to Ampl Modeling Language
You are comparing two different version of CPLEX. The CPLEX only guarantees reproducible results when run with the same version and the same options on the same computing platform. You can set the mipdisplay option and look at the log to see the search paths of two CPLEX. It's likely that they take different search paths and assign different values to the variables.

Thanks,
Paras


--
Paras Tiwari
am...@googlegroups.com
{#HS:580730433-7678#}
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



AMPL Google Group

unread,
May 15, 2018, 11:11:14 AM5/15/18
to Chia-Chun Tsai
In our tests, CPLEX 12.7.1 does return non-zero shadow prices for a mixed-integer program when run from a recent version of AMPL. For example, we see this output:

ampl: model multmip3.mod;
ampl: data multmip3.dat;
ampl: option solver cplex1271;
ampl: solve;
CPLEX 12.7.1.0: optimal integer solution; objective 235625
107 MIP simplex iterations
0 branch-and-bound nodes
ampl: display {i in 1.._ncons: _con[i].dual != 0}
ampl?    (_conname[i],_con[i].dual);
:          _conname[i]        _con[i].dual    :=
1    "Supply['GARY','bands']"        7
2    "Supply['GARY','coils']"       12
3    "Supply['GARY','plate']"       13

(and then it continues for more lines). We have attached this example so you can try it on your installation, and let us know what you see.

Note that our example does not set any CPLEX options. If you are setting a cplex_options string then let us know what it is, as that might affect the results.

--
Robert Fourer
am...@googlegroups.com
{#HS:580730433-7678#}
On Mon, May 14, 2018 at 10:07 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
You are comparing two different version of CPLEX. The CPLEX only guarantees reproducible results when run with the same version and the same options on the same computing platform. You can set the mipdisplay option and look at the log to see the search paths of two CPLEX. It's likely that they take different search paths and assign different values to the variables.

Thanks,
Paras


--
Paras Tiwari
am...@googlegroups.com


On Mon, May 14, 2018 at 6:36 PM UTC, Ampl Modeling Language <am...@googlegroups.com> wrote:
multmip3.dat
multmip3.mod

jiaju...@gmail.com

unread,
May 23, 2018, 4:11:59 PM5/23/18
to AMPL Modeling Language

Hi Bob,

 

Thanks for your advice.

 

Our CPLEX option file doesn’t set mipbasis to 1. And we do observe “No basis” at the end of CPLEX run and no shadow price is returned.

 

Here is our investigation in AMPL 20180123  along with CPLEX 12.7.1.0.

 

1. We tried to solve multmip3 problem and ‘no basis’ appear at the end of cplex run, no shadow price is returned.

 

2. We tried to solve multmip3 problem and set cplex option with ‘option cplex_options 'mipbasis =1'.  We can get some constraints with nonzero shadow price.

3. We tried to solve our original problem and set cplex option with ‘option cplex_options 'mipbasis =1'.  We can get some constraints with nonzero shadow price.

 

As you mentioned, mipbasis default setting is 1 but CPLEX behavior might be changed under certain circumstances. We will include CPLEX options setting mipbasis equals 1 in our problem to get shadow price.

 

Best Regards,

Chia-Chun

AMPL Google Group

unread,
May 23, 2018, 5:51:43 PM5/23/18
to Chia-Chun Tsai
Hi Chia-Chun,

We found that the problem with the shadow prices from CPLEX was due to a bug in the AMPL-CPLEX interface, which caused the default to be mipbasis=0 instead of mipbasis=1 as indicated in the documentation. This bug was fixed in some builds of CPLEX 12.7.1, but it appears in some earlier builds, which is why it appears in your tests but not in ours. As long as you set mipbasis=1 in your cplex_option string, however, you should not see any problems.

--
Robert Fourer
am...@googlegroups.com
{#HS:580730433-7678#}
On Mon, May 14, 2018 at 10:07 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
You are comparing two different version of CPLEX. The CPLEX only guarantees reproducible results when run with the same version and the same options on the same computing platform. You can set the mipdisplay option and look at the log to see the search paths of two CPLEX. It's likely that they take different search paths and assign different values to the variables.

Thanks,
Paras


--
Dr. Paras Tiwari
Reply all
Reply to author
Forward
0 new messages