# How to declare a decision vector in OPL/CPLEX with varying range indexes.

 0 I would like to define a decision vector xij in OPL such that the range of index j is dependent on index i. This is, for i in I, j assumes a value in a range f(i)..J. asked 14 Sep '16, 15:32 Anselmo 11●2 accept rate: 0%

 0 Hi, then you should use a tuple set with the right . range I=1..3; int J=10; int f[i in I]=J-i; tuple t { int i; int j; } {t} s={ | i in I,j in (f[i]..J)}; dvar boolean x[s]; subject to { x[<1,10>]==1; }  regards answered 17 Sep '16, 05:33 AlexFleischer 86●3 accept rate: 10%
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags:

×191
×13
×2
×2