Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  get dual variable

    Posted 10/10/15 01:38 PM

    Originally posted by: white_hat


    Hi!

    I have solved this MIP problem... (primary form)

     

    then (because the dual form of this problem daesn't have dual variable) topic dual variable

    I have solved so:

    //change problem in FIXEDMILP
    CPXchgprobtype(env, lp, CPXPROB_FIXEDMILP);
    //optimaze... Is it useful??
    CPXlpopt (env, lp);
    
            num_rows = CPXgetnumrows(env, lp);
            
            dual_varVals_P1.resize(num_rows);
            //get dual variable
            CPXgetpi (env, lp, &dual_varVals_P1[0], 0,num_rows - 1);
                    
            //print  dual variables
            for (int i = 0; i < num_rows; i++) {
                    cout << dual_varVals_P1[i] << endl;
            }
            
    //RETURN TO THE ORIGINAL FORM OF PROBLEM
    CPXchgprobtype (env, lp, CPXPROB_MILP);
    

    Now.... (if this code is correct) I have solved this problem (dual form)

     

    My second question is what is v0  dual variable? how can I get it?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: get dual variable

    Posted 10/15/15 08:26 AM

    First of all, why do you say your problem is a MIP? According to your picture it does not have integer variables?

    If you solved the explicit dual then you can get the values of v0 using CPXgetx().


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: get dual variable

    Posted 10/15/15 08:30 AM

    Originally posted by: white_hat


    yes infact... I'm very stupid...This is a simple LP problem... thanks anyway for your answer!


    #CPLEXOptimizers
    #DecisionOptimization