Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  no relaxed solution

    Posted 12/13/17 06:46 AM

    Originally posted by: Rym


    Did you have a proposition in modifying some constraints in order to have a feasible submodel, without a relaxed solution

     

     

    themodel is:

     

     

    int M=10000000000;
    int n=1;
    int p=4;
    range N=1..n;
    int nd=8;
    range ND=1..nd;

    int PDCBW[ND][ND];
    int PDC[1..nd][1..nd]=[ 
                             [0,0,0,0,1,0,0,0],
                             [0,0,0,0,1,0,0,0],
                             [0,0,0,0,0,1,0,0],
                             [0,0,0,0,0,1,0,0],
                             [1,1,0,0,0,0,1,1],
                             [0,0,1,1,0,0,1,1],
                             [0,0,0,0,1,1,0,0],
                             [0,0,0,0,1,1,0,0]
                            
                                       
                       ];
                       
                       
                       ;
    int PDCBWx=10;
    execute xc
    {
    for (var x=1;x<=nd;x++)
      {
       for(var y=1;y<=nd;y++)
        {
         if(PDC[x][y]==1)
         {
           PDCBW[x][y]= PDCBWx;
          }        
        
       }    
      

    }
    //writeln("P=",PDCBW);
    }

    tuple edge // link definition
    {
    int i;
    int j;
    }
    {edge} liaisonp = { <i,j> | i in 1..p,j in 1..p:i!=j};

    int LR[N][liaisonp]=[[0, 0, 48, 0, 0, 0, 0, 0, 0, 48, 0, 0]];
    int LRb[N][liaisonp]=[[0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0]];

     

    //Definition of the model
    dvar boolean lumdabw[N][liaisonp][ND][ND];
    dvar boolean Vd[N];
    dexpr int lumdij[i in ND][j in ND]=sum(f in N,l in liaisonp)lumdabw[f][l][i][j]*LR[f][l];
    dexpr int maxbw=max(i,j in ND)lumdij[i][j];
    dexpr int o= sum(f in N) Vd[f];
    dvar boolean vdf[N];
    maximize o;;

    subject to
    {

     

    //capacity link constraint

    clc:
    forall (i in ND, j in ND)
    sum(f in N,l in liaisonp)(lumdabw[f][l][i][j])*LR[f][l]<=PDCBW[i][j];
    //flow constraint

    flc:

    forall(f in N,l in liaisonp,i in ND)
     {(i==l.i) => ((sum(j in ND) (lumdabw[f][l][i][j])-  sum(j in ND) (lumdabw[f][l][j][i]))==LRb[f][l]);
    (i==l.j) => ((sum(j in ND) (lumdabw[f][l][i][j])-  sum(j in ND) (lumdabw[f][l][j][i]))==-LRb[f][l]);
    ((i!=l.i)&&(i!=l.j)) => ((sum(j in ND) (lumdabw[f][l][i][j])-  sum(j in ND) (lumdabw[f][l][j][i]))==0);     
    }
     //A virtual link can be embedded into one physical path(a set of physical links)
        rgv:
       forall(f in N,l in liaisonp,i in ND)
         sum(j in ND)(lumdabw[f][l][i][j])<=1; 
       
     // a virtual link can be embedded into only  a existing  physical link  
       thn:
      forall(f in N, l in liaisonp,i,j in ND) 
        lumdabw[f][l][i][j]<=PDC[i][j];


    //lumdaBw existe si seulement si LR existe
    yhj:
      forall(f in N,l in liaisonp,i,j in ND) 
         lumdabw[f][l][i][j]<=LRb[f][l];

       
       forall(f in N)
      (1/M)*(sum(i,j in ND,l in liaisonp)lumdabw[f][l][i][j])<=Vd[f];
           
    }

     

    Thanks


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: no relaxed solution

    Posted 12/13/17 08:28 AM

    Hi,

    at

    https://www.ibm.com/developerworks/community/forums/html/topic?id=8dcfe05c-e35f-4997-ab26-777fffc2861c&ps=25

    I suggested

    clc:
    forall (i in ND, j in ND)
    sum(f in N,l in liaisonp)(lumdabw[f][l][i][j])*LR[f][l]<=PDCBW[i][j]+100;

    But you said we should not relax that one. Which one could we relax a bit ?

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: no relaxed solution

    Posted 12/13/17 09:18 AM

    Originally posted by: Rym


    Hi,

     

    Yes i can't add 100 to  PDCBW[i][j] in :

    lc:
    forall (i in ND, j in ND)
    sum(f in N,l in liaisonp)(lumdabw[f][l][i][j])*LR[f][l]<=PDCBW[i][j]

     

    I can relax only this constraint: 

     //A virtual link can be embedded into one physical path(a set of physical links)
        rgv:
       forall(f in N,l in liaisonp,i in ND)
         sum(j in ND)(lumdabw[f][l][i][j])<=1; 
       

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: no relaxed solution

    Posted 12/13/17 09:54 AM

    ok then

    int M=10000000000;
    int n=1;
    int p=4;
    range N=1..n;
    int nd=8;
    range ND=1..nd;

    int PDCBW[ND][ND];
    int PDC[1..nd][1..nd]=[
                             [0,0,0,0,1,0,0,0],
                             [0,0,0,0,1,0,0,0],
                             [0,0,0,0,0,1,0,0],
                             [0,0,0,0,0,1,0,0],
                             [1,1,0,0,0,0,1,1],
                             [0,0,1,1,0,0,1,1],
                             [0,0,0,0,1,1,0,0],
                             [0,0,0,0,1,1,0,0]
                            
                                       
                       ];
                       
                       
                       ;
    int PDCBWx=10;
    execute xc
    {
    for (var x=1;x<=nd;x++)
      {
       for(var y=1;y<=nd;y++)
        {
         if(PDC[x][y]==1)
         {
           PDCBW[x][y]= PDCBWx;
          }        
        
       }    
     

    }
    //writeln("P=",PDCBW);
    }

    tuple edge // link definition
    {
    int i;
    int j;
    }
    {edge} liaisonp = { <i,j> | i in 1..p,j in 1..p:i!=j};

    int LR[N][liaisonp]=[[0, 0, 48, 0, 0, 0, 0, 0, 0, 48, 0, 0]];
    int LRb[N][liaisonp]=[[0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0]];

     

    //Definition of the model
    dvar boolean lumdabw[N][liaisonp][ND][ND];
    dvar boolean Vd[N];
    dexpr int lumdij[i in ND][j in ND]=sum(f in N,l in liaisonp)lumdabw[f][l][i][j]*LR[f][l];
    dexpr int maxbw=max(i,j in ND)lumdij[i][j];
    dexpr int o= sum(f in N) Vd[f];
    dvar boolean vdf[N];
    maximize o;;

    subject to
    {

     

    //capacity link constraint

    //clc:
    forall (i in ND, j in ND)
    sum(f in N,l in liaisonp)(lumdabw[f][l][i][j])*LR[f][l]<=PDCBW[i][j];
    //flow constraint

    flc:

    forall(f in N,l in liaisonp,i in ND)
     {ct1:(i==l.i) <= ((sum(j in ND) (lumdabw[f][l][i][j])-  sum(j in ND) (lumdabw[f][l][j][i]))==LRb[f][l]);
    ct2:(i==l.j) <= ((sum(j in ND) (lumdabw[f][l][i][j])-  sum(j in ND) (lumdabw[f][l][j][i]))==-LRb[f][l]);
    ct3:((i!=l.i)&&(i!=l.j)) <= ((sum(j in ND) (lumdabw[f][l][i][j])-  sum(j in ND) (lumdabw[f][l][j][i]))==0);     
    }
     //A virtual link can be embedded into one physical path(a set of physical links)
        
       forall(f in N,l in liaisonp,i in ND)
         rgv:sum(j in ND)(lumdabw[f][l][i][j])<=1;
       
     // a virtual link can be embedded into only  a existing  physical link  
       
      forall(f in N, l in liaisonp,i,j in ND)
        thn:lumdabw[f][l][i][j]<=PDC[i][j];


    //lumdaBw existe si seulement si LR existe
    yhj:
      forall(f in N,l in liaisonp,i,j in ND)
         lumdabw[f][l][i][j]<=LRb[f][l];

       
       forall(f in N)
      (1/M)*(sum(i,j in ND,l in liaisonp)lumdabw[f][l][i][j])<=Vd[f];
           
    }

    gives the following relaxation:

    Line    Original    Relaxed    Element (8)
    78    [-Infinity,-1]    [-Infinity,0]    ct1[1][<1,4>][1]
    78    [-Infinity,-1]    [-Infinity,0]    ct1[1][<4,1>][4]
    78    [-Infinity,-1]    [-Infinity,0]    ct2[1][<1,4>][4]
    78    [-Infinity,-1]    [-Infinity,0]    ct2[1][<4,1>][1]
    78    [-Infinity,-1]    [-Infinity,0]    ct1[1][<1,4>][1]
    78    [-Infinity,-1]    [-Infinity,0]    ct2[1][<1,4>][4]
    78    [-Infinity,-1]    [-Infinity,0]    ct2[1][<4,1>][1]
    78    [-Infinity,-1]    [-Infinity,0]    ct1[1][<4,1>][4]

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: no relaxed solution

    Posted 12/13/17 10:31 AM

    Originally posted by: Rym


    if i relax both constraints a the following

     

    forall (i in ND, j in ND)
    clc:sum(f in N,l in liaisonp)(lumdabw[f][l][i][j])*LR[f][l]<=PDCBW[i][j];
    //flow constraint

     

    forall(f in N,l in liaisonp,i in ND)
     {ct1:(i==l.i) => ((sum(j in ND) (lumdabw[f][l][i][j])-  sum(j in ND) (lumdabw[f][l][j][i]))==LRb[f][l]);
    ct2:(i==l.j) =>((sum(j in ND) (lumdabw[f][l][i][j])-  sum(j in ND) (lumdabw[f][l][j][i]))==-LRb[f][l]);
    ct3:((i!=l.i)&&(i!=l.j))=> ((sum(j in ND) (lumdabw[f][l][i][j])-  sum(j in ND) (lumdabw[f][l][j][i]))==0);     
    }

    I obtained as conflict theses lines, what does it mean ?

     

     
    80 Oui clc[6][4]
    86 Oui ct2[1][<1,4>][4]
    86 Oui ct2[1][<2,4>][4]

    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: no relaxed solution

    Posted 12/13/17 10:56 AM

    Hi

    In the documentation you may read

    plus do not hesitate to have a look at

    http://www-01.ibm.com/support/docview.wss?uid=swg27044521&aid=1

    regards

     


    #DecisionOptimization