Decision Optimization

Decision Optimization

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

 View Only
  • 1.  combining two constraints in one only

    Posted Fri January 20, 2017 07:28 AM

    Originally posted by: Rym


    I want to improve the performance of my model by combing two constraints ( in yellow) in one ony if possible

     

    dvar boolean lumda[V][P];
    dvar boolean phy[P];
    dexpr int O = sum( i in V, j in P) lumda[i][j];
    dexpr int ODPVMType[vtype in VMTypes]=sum( i in V, j in P:vms[i]==vtype) lumda[i][j];
    dexpr int OP = sum( j in P) phy[j];
    minimize OP;


    //constraints


    subject to{ 
    //une machine virtuelle est hébergée par au plus une seule pm
      limit:
       forall( i in V)
         sum( j in P ) lumda[i][j] <= 1;
        

    //la quantité de cpu consommée par les vms ne depasse la la quantité de cpu de la pm j
       cpur:
        forall( j in P)
          sum( i in V) cpui[i]*lumda[i][j] <= cpuj[j];
            

    //la quantité de ram consommée par les vms ne depasse la la quantité de ram de la pm j
        ramr:
         forall( j in P)
           sum( i in V) rami[i]*lumda[i][j] <= ramj[j];

    //la quantité de disk consommée par les vms ne depasse la la quantité de disk de la pm 

        diskr: 
         forall( j in P)
           sum( i in V) diski[i]*lumda[i][j] <= diskj[j];
           
           
    //la somme des vms hebergèes ne depasse pas le nombre des demandes satisfaites

           
                  glob:
     v <= sum (i in V, j in P) lumda[i][j];
    //quand est ce que phyprends un

         phyone:
           forall ( i in V, j in P)
          lumda[i][j]<= phy[j] ;

    //quand est ce que phy prends zero

       phynull:
          forall (j in P)
            phy[j]<= sum (i in V) lumda[i][j];

     

    }

     

    Thanks
     


    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: combining two constraints in one only

    Posted Fri January 20, 2017 07:42 AM

    The second constraint (phynull) looks redundant to me and could just be dropped.

    phy[j] has positive coefficient in the objective, hence it will be set to 0 whenever possible and for phy[j]=0 constraint phynull is always satisfied. phy[j] will only be set to 1 if there is an i such that lumda[i][j]==1. This very lumda[i][j] will also appear in the right side of the respective phynull constraint. Hence that constraint will trivially be satisfied: the left side is 1 while the right side is at least 1.

     


    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: combining two constraints in one only

    Posted Fri January 20, 2017 07:56 AM

    Originally posted by: Rym


    I agree with you.  Thanks


    #DecisionOptimization
    #MathematicalProgramming-General