Hello Juliana,

For a reference see the API documentation in doc/glpk.pdf in the distribution tarball available at ftp://ftp.gnu.org/gnu/glpk/glpk-4.39.tar.gz Have a look at the examples the examples folder and in glpk-java available at http://glpk-java.sourceforge.net/
Consider using modeling language GNU Mathprog available in GLPK.

sum[i=m to N] x_i((a_i) + (b_i*y_i))  + sum[i=1 to N] b_i*y_i
is not a linear term because it contains the product of two variables x_i * y_i.

If you want to use a MILP solver like GLPK you will have to reformulate your problem, e.g.

maximize obj :
 sum{i in m..N} w[i] + sum{i in 1..N} b[i]*y[i];

s.t. c1{i in m..N} :
 w[i] <= a[i] + b[i] * y[i];
s.t. c2{i in m..N} :
 w[i] <= x[i] * M;

Best regards

Xypron


Juliana Freitag wrote:
Hi everybody,
  is it possible to model the function below using GLPK API?

sum[i=m to N] x_i((a_i) + (b_i*y_i))  + sum[i=1 to N] b_i*y_i

a and b are constants
x is a binary variable
y is a integer variable

Thank you, Juliana.

Attachment: Roy.tar.gz
Description: GNU Zip compressed data

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

Reply via email to