Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  network flow formulation

    Posted 05/12/19 08:27 AM

    Originally posted by: AnushKara


    Hello everyone,

    I am a beginner in using CPLEX optimization studio. I want to formulate a network flow problem. In my problem, a1 = (i, j) and a2 = (i, j) may be two different arcs in A, both connecting the nodes i and j in N. However, I have an excel file of 100 instances of i and j.  And now I can't define these variables so that it retrieves the values of i and j from excel and defines the above-mentioned statement of arc sets.  

    
    
    
    
    
    
    
    
    
    
    
    
    
    tuple 
    arc {
    
    key 
    int 
    fromnode;
    
    key 
    int 
    tonode;
    

    }

    The values of i in my excel file refer to tuple component fromnode and j to component tonode. However, I don't know how to define the set of arcs to be retrieved from excel.

     

    I would be really grateful for the help.

     

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: network flow formulation

    Posted 05/13/19 03:55 AM

    Hi,

    let me give you an example out of the netflow example : https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.ide.help/OPL_Studio/usroplexamples/topics/opl_modlib_transport.html#usroplsamples.uss_opl_modlib.1016594__usroplsamples.uss_opl_modlib.1016717

     

    in that example all data is in a .dat

    Let me show you how to read that same data from an excel spreadsheet.

     

    I added a new run configuration.

    And in arcs.dat:

    SheetConnection s("arcs.xlsx");

    NumNodes from SheetRead(s,"nodes!A2:A2");
    SupDem from SheetRead(s,"supplydemand!A2:A6");
    Arcs from SheetRead(s,"arcs!A2:D10");

    regards

     

    NB:

    Many how to with OPL at https://www.linkedin.com/pulse/how-opl-alex-fleischer/

     

     

     


    #DecisionOptimization


  • 3.  Re: network flow formulation

    Posted 05/14/19 03:10 PM

    Originally posted by: AnushKara


    Thank you very much, this helped a lot!!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer