[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Multivariate problem

From: Xypron
Subject: Re: [Help-glpk] Multivariate problem
Date: Sat, 03 Oct 2009 19:22:12 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20090823 SeaMonkey/1.1.18

Hello Juliana,

For a reference see the API documentation in doc/glpk.pdf in the distribution tarball available at Have a look at the examples the examples folder and in glpk-java available at
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


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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]