Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

How to define unstructured Decision variable

  • 1.  How to define unstructured Decision variable

    Posted Fri April 18, 2014 11:01 AM

    Originally posted by: Rajasekhar Kadambur


    Hi,

    How to define unstructured decision variables?

    A is 4X5 matrix

    A11    A21    A31     A41

    A21    A22    A32     A42

    A31      --       A33     A43

    A41      --        --         A44

      --        --         --        A45

    one way of doing is to take a structured array and define A51,A23,A24,A25,A34,A35 == 0.

    For large data, this process will be very painful.

    could you please suggest how to implement unstructured decision variables.

    Thanks in advance.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to define unstructured Decision variable

    Posted Fri April 25, 2014 03:15 AM

    Originally posted by: davidoff


    I don't know if I understood it clearly, but here is a way to flatten the matrix into a single array of variables.

     dvar float x[1..2][1..2] in 0..5;
     dvar float xflat[0..3] = all(i in 1..2,j in 1..2) x[i,j];
     
     maximize sum(i in 0..3) xflat[i];
    

    Be carefull that the indexation of xflat must begin with 0 (or I don't know how to index in a different way)

    Hope this helps

     

    David


    #DecisionOptimization
    #OPLusingCPLEXOptimizer