> I have a decision variable defined as
> 
> x(i,j,k,t) where
> 
> i in I
> j in J(i)
> k in K(i,j)
> 
> That is, the number of elements of J depends on the "i".
> For instance, J(1) has 1 element, J(2) has 1 element, J(3) has 4 elements,
> J(4) has 6 elements and so on.
> 
> Is it possible to use GMPL to define this variable?
> 

Yes, it is.

set I;
set J{i in I};
set K{i in I, j in J[i]};
var x{i in I, j in J[i], k in K[i,j]} ... ;

See also some examples (e.g. egypt.mod) in subdirectory glpk/examples
that demonstrate how to use subscripted sets.



_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to