Decision Optimization

Decision Optimization

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

 View Only
  • 1.  dynamic optimization

    Posted Wed March 13, 2019 01:57 PM

    Originally posted by: NosaibaY


    Hi,

    I am working on assignment problem and I need to joint two arrays together. both arrays have same number of column with different number of rows. for example

    A=[[1,2,3];[2,2,0]]

    B=[[3,2,4];,[4,5,7],[3,2,6]]

    I need to update A and make it A=       [[1,2,3];

    [2,2,0];

    [3,2,4];

    [4,5,7];

    [3,2,6]]

    then I need to run for loop considering number of A' rows. I need to update A different times and every time size of b is different

     

    is it doable using CPLEX or do I have to another interface like python?

    Thanks

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: dynamic optimization

    Posted Wed March 13, 2019 03:15 PM

    What exactly do you mean by "CPLEX" here? Which is the way you are using CPLEX currently? Through a programming API? Through OPL?

    In any case, updating the matrix A means adding new constraints. That is supported in any API and in OPLScript as well.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: dynamic optimization

    Posted Wed March 13, 2019 03:17 PM

    Originally posted by: NosaibaY


    OPL. any hint about OPL script? I have no experience with OPL script. Also does it matter if i declare A as array or list?


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: dynamic optimization

    Posted Wed March 13, 2019 03:24 PM

    As usual, a good starting point is the documentation and the tutorials available here. The reference manual is at "IBM ILOG Script Reference Manual".
    Then you may want to take a look at the many OPL examples that ship with CPLEX optimization studio, there are some that dynamically update the model. For example opl/examples/opl/models/TravelingSalesmanProblem/tsp.mod updates the data after each solve, then regenerates the model and solves again.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: dynamic optimization

    Posted Mon March 25, 2019 08:04 PM

    Originally posted by: NosaibaY


    Thanks again. I am not finding dealing with set easy much as it is with array. I want to have multi-period planning. However for each plan, the input is changing (t is a join of solution of previous period to another input). consider t as a backlog order. so the order for next period is what were not met in last plan in addition to demand of next period. number of orders is fixed this is why I could not solve it using array. I could not function for number of array rows.

    for instance, number of orders in first plan is 6 and 13 for net period. In fist period, 5 orders were shipped, then in next period i need to consider 14 orders. in for loop. if i use array then  i need to declare array size upfront and i could not find way to join to array (demand of second period and what left).  is there any hint how to convert set to an array?


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: dynamic optimization

    Posted Mon April 15, 2019 04:21 AM

    I think we had a private communication about this and resolved the issue.


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: dynamic optimization

    Posted Tue April 16, 2019 12:28 PM

    Originally posted by: NosaibaY


    Yes we did. thanks you!


    #CPLEXOptimizers
    #DecisionOptimization