Decision Optimization

 View Only
  • 1.  shadow price for MIP

    Posted Thu June 18, 2020 04:48 AM
    Hi, everyone.
    Any one can help with the shadow price for MIP in CPLEX? (From google search I see several posts about this topic in IBM forum before but they are not visible now.)
    Currently I am trying to get the shadow price (dual values) for the continuous constraints in mixed integer models in CPLEX, using the solveFixed() method but failed. 
    I am not sure if this is the correct way to get the shadow price for MIP. if yes, please help to correct me where I am wrong. if not, please let me know what should I do to get the shadow price for MIP. 

    The code is shown below.
    if (cplex.solve()) {
        _logger.info("Successfully solved.");
        if(cplex.solveFixed() {
            _logger.info("SolveFixed Successfully solved.");
        }
        else {
           _logger.info("SolveFixed failed.");
        }
    }

    The log file shows as follows:
    Successfully solved.
    SolveFixed failed.

    Thank a lot.

    ------------------------------
    Hui Zhao
    ------------------------------

    #DecisionOptimization


  • 2.  RE: shadow price for MIP

    Posted Thu June 18, 2020 05:32 AM
    What you do looks correct at first glance. The fact that solveFixed() fails after a successful solve() indicates that there are some issues either with numerics or with resource limits. Do you have any non-default parameter settings in place? Does it help to set the integrality tolerance parameter to 0 for the MIP solve? Can you show the engine log for the two solves?

    About the old forum: all questions were moved here. Usually you can find the questions back by searching here for the question's title.

    ------------------------------
    Daniel Junglas
    ------------------------------



  • 3.  RE: shadow price for MIP

    Posted Mon August 31, 2020 05:21 AM
    Hi Daniel,
    I am sorry that I missed your reply for so long time and thanks a lot for your help. 
    I have disable the time limit and epgap for the MIP solve. Please also see the log file in the attachment. Please kindly let me know if you spot anything which might be the cause of solveFixed fails. 
    Thank you so much.
    Looking forward to your reply.

    ------------------------------
    Hui Zhao
    ------------------------------



  • 4.  RE: shadow price for MIP

    Posted Mon August 31, 2020 05:32 AM
    Hm, it looks like the solveFixed() call does complete in some way. What do cplex.getStatus() and cplex.getCplexStatus() return after solveFixed() completes?

    ------------------------------
    Daniel Junglas
    ------------------------------



  • 5.  RE: shadow price for MIP

    Posted Mon August 31, 2020 05:49 AM
    Hi Daniel,
    Thanks for your fast reply.
    I have got both statuses as optimal. Please also see the log below. Any suggestions? 
    2020-08-31_17:43:42.693|INFO |ODM-IloScenarioTas| |_cplex.solveFixed() status: false|
    2020-08-31_17:43:42.740|INFO |ODM-IloScenarioTas| |_cplex.getStatus(): Optimal|
    2020-08-31_17:43:42.740|INFO |ODM-IloScenarioTas| |_cplex.getCplexStatus(): Optimal|
    Thank you.

    ------------------------------
    Hui Zhao
    ------------------------------



  • 6.  RE: shadow price for MIP

    Posted Mon August 31, 2020 06:52 AM
    That is very weird. I take it, cplex.isPrimalFeasible() returns false? What happens if you attempt to query shadow prices even if solveFixed() returns false?

    ------------------------------
    Daniel Junglas
    ------------------------------



  • 7.  RE: shadow price for MIP

    Posted Mon August 31, 2020 08:40 AM
    Hi Daniel,
    1) cplex.isPrimalFeasible() returns true after the failed solveFixed().
    2) The shadow prices are generated even if solveFixed() returns false. Thanks for your kind help. I did not check the shadow price generation after I see the false solveFixed(). 
    Thank you so much. It is really nice of you. 



    ------------------------------
    Hui Zhao
    ------------------------------