help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] help! how tow set constraint coeffients to zero?


From: Andrew Makhorin
Subject: Re: [Help-glpk] help! how tow set constraint coeffients to zero?
Date: Mon, 10 Dec 2007 12:24:21 +0300

> 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.





reply via email to

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