Cplex Concert technology duals

General Tech Technology & Software 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Technology & Software related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I tried to get the duals of cocom/tag/n">nstraicom/tag/n">nts

This is the code, implemecom/tag/n">nted icom/tag/n">n C++:

    IloEcom/tag/n">nv ecom/tag/n">nv;
    IloModel MasterProblem(ecom/tag/n">nv);

    IloNumVarArray XX(ecom/tag/n">nv,Create_routes.size(),0,IloIcom/tag/n">nficom/tag/n">nity,ILOFLOAT);
    IloNumVarArray t(ecom/tag/n">nv,m,0,IloIcom/tag/n">nficom/tag/n">nity,ILOFLOAT);
    IloExpr expr(ecom/tag/n">nv);  

    ////deficom/tag/n">nicom/tag/n">ng ojective of com/tag/problem">problem

    IloObjective masterObj(ecom/tag/n">nv,expr,IloObjective::Maximize);
    expr.ecom/tag/n">nd();
    MasterProblem.add(masterObj);

    IloRacom/tag/n">ngeArray cocom/tag/n">nst1(ecom/tag/n">nv);  //hala yeki yeki mahdudiyatha ro misazim    

    for (icom/tag/n">nt i=0; i<com/tag/n">n; i++){
        IloExpr expr(ecom/tag/n">nv);
        for (icom/tag/n">nt j=0; j<Create_routes.size(); j++){
            if (Create_routes[j]->icom/tag/n">ntercom/tag/n">nalcom/tag/n">nodes[i+m]==1)
                expr+=XX[j];
        }
        cocom/tag/n">nst1.add(1==expr);
        MasterProblem.add(cocom/tag/n">nst1[i]);
        expr.ecom/tag/n">nd();
    }
    IloRacom/tag/n">ngeArray cocom/tag/n">nst2(ecom/tag/n">nv);      
    IloRacom/tag/n">ngeArray cocom/tag/n">nst4(ecom/tag/n">nv);//mahdudiate depohaye opecom/tag/n">n shode


    for (i=0; i<m; i++){
        IloExpr expr(ecom/tag/n">nv);
        for (icom/tag/n">nt j=0; j<Create_routes.size(); j++){
            if (Create_routes[j]->depot==i){
                expr+=XX[j]*Create_routes[j]->demacom/tag/n">nd_collected;
            }
        }

        expr-=t[i]*g[i]->QF;
        cocom/tag/n">nst2.add(0>=expr);
        MasterProblem
                                                
                                                
0 views
0 shares
profilepic.png
manpreet 2 years ago

You likely have multiple optimal dual solutions: solutions that are all feasible and have the same objective value equal to the optimal objective value. This can happen with or without equally constraints, and even if there is a unique optimal primal solution.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.