Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  generating constraint

    Posted 07/09/08 03:41 AM

    Originally posted by: SystemAdmin


    [agus said:]

    Hi,
    I have a problem in generating constraints.
    Here is my code:

    tuple flight {
    key string ID;
      {string} realNodes;
    }

    {flight} Flights = ...;

    dvar int+ t[Flights][Nodes];
    dvar int+ z[Flights][Flights][Nodes];

    subject to {

    forall(i in Flights, j in Flights: i.ID != j.ID)

    t[i.ID][i.realNodes] <= t[j.ID][j.realNodes in i.realNodes];<br />}



    And here is the code in my data file:

    Flights = {
    <", {"a", "b"}>,
    <", {"a", "b", "c"}>,
    };


    Here is the explanation:
    I would like to generate this constraint:
    t[sub]iu[/sub] <= t[sub]ju[/sub] + z[sub]iju[/sub], where i and j are the flight ID (i != j) and u are set of COMMON real nodes between flight i and flight j. <br />
    From the data above, these are the constraints I would like to generate:
    t[sub]xa [/sub] <= t[sub]ya [/sub] + z[sub]xya[/sub]<br />t[sub]ya[/sub] <= t[sub]xa[/sub] + z[sub]yxa[/sub]<br />t[sub]xb[/sub] <= t[sub]yb[/sub] + z[sub]xyb[/sub]<br />t[sub]yb[/sub] <= t[sub]xb[/sub] + z[sub]yxb[/sub]<br />
    How do I write the statement for this constraint?

    Thank you

    agus



    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: generating constraint

    Posted 07/09/08 02:28 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    Agus,

    You should find a way to define realNode and the condition j.realNodes in i.realNodes in the forall statement.
    In the range constraint, you can only use variables that are defined in the forallStatement.

    Didier.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: generating constraint

    Posted 07/10/08 12:57 AM

    Originally posted by: SystemAdmin


    [agus said:]

    Thanks,

    I tried

    subject to {

    forall(i in Flights, j in Flights: i.ID != j.ID, u in (i.realNodes inter j.realNodes))
    t[i][u] <= t[j][u];<br />}


    and I think it works
    #DecisionOptimization
    #OPLusingCPLEXOptimizer