Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Need help modelling this constraint in OPL

    Posted 07/16/18 08:56 PM

    Originally posted by: SRDesai


    I needed to model the LP given in the attached image. Here is my progress on the same.  I am unable to model the constraints. Any help in this regard would be appreciated.

     

    int     n       = ...;
    range   Nodes  = 1..n;
    
    
    tuple       edge        {int i; int j;}
    setof(edge) Edges       = {<i,j> | i,j in Nodes};
    int         Weight[Edges] = ...;
    
    dvar float+ z[Edges];
    
    
    maximize
      
        sum(e in Edges) z[e]*Weight[e];
     
     subject to
     {
     forall (v in Nodes)
       sum(e in Edges:e == <u,v>) e - sum(<w,v> in Edges) <w,v> == 0;
    

     

     

    Regards,

    SRDesai

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Need help modelling this constraint in OPL

    Posted 07/17/18 02:08 AM

    You are close. You just have to do the filtering of edges differently. The conservation constraint would read:

    forall (v in Nodes)
       sum(e_out in Edges: e_out.i == v) z[e_out] - sum(e_in in Edges : e_in.j == v) z[e_in] == 0;


     


    #CPLEXOptimizers
    #DecisionOptimization