> I have a linear program which works fine with variables and fixed
> parameters. But I want to fix values of some variables for testing 
> purposes. 
> More specifically, I have a set of variables and constraints in my 
> model file: 
> set x; 
> var vars{x}; 
> subject to constraint1{i in x}: 
>    vars[i] ... ; 
> And data file defines the members of the set. 
> set x := x1 x2; 
> This works fine, but I want to assign a constant to vars[x1] and see the 
> output of the program and its effect on the other variables. I cannot 
> put constraints in my model file using names x1 or x2 because they are 
> not defined yet, and I cannot define the value of vars[x1] in data file 
> because set x is formed of variables. Does anyone know a way of doing 
> this without changing variables to parameters? 

The following way is not elegant, but it must work in glpsol 4.13:

var vars{j in x}, >= if ... then -Infinity else c[j],
                  <= if ... then +Infinity else c[j];





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

Reply via email to