Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Help regarding arrays and tuples

    Posted 11/21/18 01:45 AM

    Originally posted by: Nomykan


    Hi everyone, 

    i have a small problem and i got the problem solved but now the problem is that i got too many warnings in the solution. i solved the problem for small network but if i do it for large network i think it will be too much time consuming. help regarding this issue is required. for simplicity i have a network consisting of nodes and lines. each line has a starting node and an ending node like L1= from node 1 to 2, L2 from node 2 to 3  and so on. i declared in my model as 

    range nodes=1..n;

    float line[nodes][nodes]=...;

    dvar float flow[nodes][nodes];

    what would be the better option to use arrays or tuples in this case?

    this works fines but as many of the configurations of the nodes are not used so i got too many warnings. i have attached the simple example here with this post. help in this regard will be appreciated. Thanks


    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: Help regarding arrays and tuples

    Posted 11/21/18 01:53 AM

    You would do something like this:

    tuple line {
      int from;
      int to;
    }
    {line} lines = ...;
    float value[lines] = ...;
    dvar float flow[lines];

    where 'value' are the values that were previously stored in 'lines'. You have various examples for this in the examples that ship with CPLEX. For example in opl/examples/opl/models/TravelingSalesmanProblem/tsp.mod.


    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: Help regarding arrays and tuples

    Posted 11/21/18 02:30 AM

    Originally posted by: Nomykan


    Hi , 

    Thanks a lot .. you made it so easy... i was just confused .... Thanks a lot.. 


    #DecisionOptimization
    #MathematicalProgramming-General