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