Is there a way to express the array element operation based on index that is a variable?

Yuri <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <[email protected]>
Suppose I have these elements in the linear program:


param n := 10;

var idx, integer >= 1  <= n;

var arr{1..n};


What would be the simplest way to express arr[idx] (for example to use 
arr]idx] in some other statements)?


I know that this is possible. I first had "var memb{1..n}, binary;" 
instead of "idx", so that it expressed the array index as a boolean 
array instead of a single integer index, but this way it led to an 
unsolvable MIP instance.

Not even sure if this is a feasible way to simplify the MIP instance.



Thank you,

Yuri



_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.