shadow price when CPLEX fixes binary variables

220 views
Skip to first unread message

Kong Chyong

unread,
Aug 23, 2018, 12:57:22 PM8/23/18
to AIMMS - The Modeling System
Hi, could you anyone help me to find out how/where in AIMMS to find shadow prices for the binary variables when they've been fixed to their optimal level after solving MIP? i understood that in order for CPLEX to derive sensitivity parameters such as shadow prices for constraints for MIP problems it needs to solve the MIP and then fix the binary variables at their optimal values and then re-solve the resultant LP model. and so the question is where/how to find out the shadow prices of those constraints associated with fixing binary variables at their optimal level when resolving the corresponding LP? thanks

Mohan

unread,
Aug 23, 2018, 1:14:52 PM8/23/18
to ai...@googlegroups.com
Hello, 

Turn on the Always store marginals option in Settings -> Project Options -> Solvers General -> Sensitivity.

Screenshot 2018-08-23 10.13.37.png


Alternatively, you can also the property of the variable of interest as Reduced Cost. This is more useful if you want to store reduced costs of only certain identifiers in your model as storing marginals / reduced costs of all variables or constraints could be heavy on memory. 


Screenshot 2018-08-23 10.31.49.png



After your solve, you will see an additional Reduced Cost column in the data page of this variable. If you want to retrieve these values to do some further calculations, use the suffix .ReducedCost like Variable.ReducedCost. You might need to recompile / close and reopen your project for this suffix to show up in the list of allowed suffices of your variable. 


Let me know if this does not work as you require. 

Kong Chyong

unread,
Aug 24, 2018, 1:31:56 PM8/24/18
to ai...@googlegroups.com
Hi Mohan 

Thanks. Yes, that option has been on already. I can extract all shadow prices for the original constraints in the MIP but I can’t find how to extract shadow prices when Aimms/cplex resolves the MIP fixing the binary variables to their optimal values... for example, b(t) is the original binary variable in the MIP problem and then it fixes b(t)=1 and revolves the same problem but now LP to derive all shadow prices. So the question is where to find that constraints that b(t)=1 constraint and it’s associated shadow prices? 

Many thanks 

On 23 Aug 2018, at 18:14, Mohan <mohan....@aimms.com> wrote:

Hello, 

Turn on the Always store marginals option in Settings -> Project Options -> Solvers General -> Sensitivity.


Let me know if this does not work as you require. 



On Thursday, August 23, 2018 at 9:57:22 AM UTC-7, Kong Chyong wrote:
Hi, could you anyone help me to find out how/where in AIMMS to find shadow prices for the binary variables when they've been fixed to their optimal level after solving MIP? i understood that in order for CPLEX to derive sensitivity parameters such as shadow prices for constraints for MIP problems it needs to solve the MIP and then fix the binary variables at their optimal values and then re-solve the resultant LP model. and so the question is where/how to find out the shadow prices of those constraints associated with fixing binary variables at their optimal level when resolving the corresponding LP? thanks

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aimms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aimms/ba59a374-b2bc-4074-abd5-0e5a3d667ca1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Screenshot 2018-08-23 10.13.37.png>

Marcel Hunting

unread,
Aug 30, 2018, 10:30:13 AM8/30/18
to AIMMS - The Modeling System
Hi,

As the b(t)=1 constraint is not in the model you will not be able to find it or refer to it. (During the postsolve step the integer variables are fixed but that is not done by adding constraints, and even it would you could not refer to them as they are not in the model.)

If you want to find shadow prices of the b(t)=1 constraint then you have to simulate the postsolve step yourself. Namely using something like:

Solve MIP model;
Fix integer variables by adding constraints:  b(t)=round( b(t).level );
Change math program type to LP (or RMIP) and solve LP model;

Best regards,

Marcel Hunting
AIMMS Optimization Specialist

On Friday, August 24, 2018 at 7:31:56 PM UTC+2, Kong Chyong wrote:
Hi Mohan 

Thanks. Yes, that option has been on already. I can extract all shadow prices for the original constraints in the MIP but I can’t find how to extract shadow prices when Aimms/cplex resolves the MIP fixing the binary variables to their optimal values... for example, b(t) is the original binary variable in the MIP problem and then it fixes b(t)=1 and revolves the same problem but now LP to derive all shadow prices. So the question is where to find that constraints that b(t)=1 constraint and it’s associated shadow prices? 

Many thanks 

On 23 Aug 2018, at 18:14, Mohan <mohan....@aimms.com> wrote:

Hello, 

Turn on the Always store marginals option in Settings -> Project Options -> Solvers General -> Sensitivity.

<Screenshot 2018-08-23 10.13.37.png>


Let me know if this does not work as you require. 



On Thursday, August 23, 2018 at 9:57:22 AM UTC-7, Kong Chyong wrote:
Hi, could you anyone help me to find out how/where in AIMMS to find shadow prices for the binary variables when they've been fixed to their optimal level after solving MIP? i understood that in order for CPLEX to derive sensitivity parameters such as shadow prices for constraints for MIP problems it needs to solve the MIP and then fix the binary variables at their optimal values and then re-solve the resultant LP model. and so the question is where/how to find out the shadow prices of those constraints associated with fixing binary variables at their optimal level when resolving the corresponding LP? thanks

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aimms+unsubscribe@googlegroups.com.
<Screenshot 2018-08-23 10.13.37.png>
Reply all
Reply to author
Forward
0 new messages