0
votes

Is it possible to use three-dimensional decision variable in OPL?

I want to do optimization on the network graph. In particular, I need two-dimensional decision variable for each pair of nodes. I can avoid that with single three-dimensional decision variable.

1
Of course. Just add an index. The syntax for a 2 d variable extends directly to a 3 d variable. - Erwin Kalvelagen

1 Answers

0
votes

of course.

You can see and example in CPLEX_Studio127\opl\examples\opl\models\NoughtsAndCrosses

Three-dimensional Noughts and Crosses

Problem 17 from Model Building in Mathematical Programming by H.P. Williams.

>    range r=1..3;
>    dvar boolean cell[r][r][r];