RE: [AMPL 5968] Re: sensitivity analysis with cplex

1,166 views
Skip to first unread message

Robert Fourer

unread,
Jul 6, 2012, 5:06:29 AM7/6/12
to am...@googlegroups.com

The trouble here is that AMPL's presolve phase removes constraints like "chairs" and "tables" that express simple bounds on the variables, and instead incorporates these bounds into the lower-bound and upper-bound information about the variable that is transmitted to the solver.  (LP solvers use a "bounded-variable" version of the simplex method that deals with bounds directly rather than as separate constraints.)  Because these constraints were removed by presolve, CPLEX did not see them and did not compute sensitivity information for them.

 

If you suppress this action of presolve by setting "option presolve 0;" then the bound constraints will be sent to CPLEX as explicit constraints, and you will get the sensitivity information:

 

   ampl: option solver cplex, cplex_options 'sensitivity';

   ampl: option presolve 0;

   ampl: solve;

 

   CPLEX 12.4.0.1: sensitivity

   CPLEX 12.4.0.1: optimal solution; objective 4040

   3 dual simplex iterations (2 in phase I)

 

   suffix up OUT;

   suffix down OUT;

   suffix current OUT;

 

   ampl: display t, tables.up, tables.down;

   t = 320

   tables.up = 320

   tables.down = -1e+20

 

   ampl: display c, chairs.up, chairs.down;

   c = 360

   chairs.up = 1e+20

   chairs.down = 360

 

In this case neither bound is tight at the optimum, so the sensitivity values only tell you that the basis stays the same until the right-hand-side constant is increased or decreased (as appropriate) to equal the value of the variable.

 

Bob Fourer

4...@ampl.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of amigo
Sent: Wednesday, July 04, 2012 12:53 PM
To: am...@googlegroups.com
Subject: [AMPL 5968] Re: sensitivity analysis with cplex

 

A simpler example.

var t >=0;
var c >=0;

maximize profit: 7*t + 5*c;
subject to carpentry: 3*t + 4*c <= 2400;
subject to painting: 2*t + 1*c <= 1000;
subject to chairs: c <= 450;
subject to tables: t>=100;

# == 58 display t, tables.up, tables.down; ========
t = 320
tables.up = 0
tables.down = 0
# == 59 display c, chairs.up, chairs.down; ========
c = 360
chairs.up = 0
chairs.down = 0

Since up and down are zero they dont enclose the optimal value? Surely I can vary the right hand side of t>=100, between t >=0 to t>=320, and still keep the same basis/optimal value. Similarly c <=360 to c <= +Infinity, preserves the same basis/optimal value.

?

 

camil...@gmail.com

unread,
Apr 8, 2014, 7:31:25 PM4/8/14
to am...@googlegroups.com, 4...@ampl.com
Hi,

I understood the concept of sensitivity analysis, but i don't know how to write in my program.
It's already giving me an optimal solution but I can't get the sensitivity analysis.

Can you give me an example of how and where to write?

Thanks,
Camila
Reply all
Reply to author
Forward
0 new messages