> I am using GLPK to solve a LP problem, such as:

> max            Z = x1 + x2 + x3
> subject to:    1 >      x2 + x3
>                2 > x1 + x2

> In the first row, the coefficient of x1 is zero and in the 2nd line the
> coefficient of x3 is zero. I trid to set the constaint matrix by
> lpx_load_matrix(),but got an error "lpx_load_matrix: ar[1] = 0; zero element 
> not
> allowed".

You are using some old version of the package. Most recent version
is 4.24, where it is allowed to specify zero coefficients.

> How could I formulate this problem?

See a brief example included in the reference manual (section 1.3).

If you only need to solve your lp, you could write it, say, in
cplex lp format and then use the stand-alone solver glpsol rather
than writing a program in C.



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

Reply via email to