> Hi, I am new to GNU MathProg language. > I have following model but glpk always complains:
> "test2.mod:10: operand preceding > less has invalid type" > The GMPL document says it has this less > operator. How could I use it in modeling? Being non-linear the less operator can be applied only to constants and parameters, but not to variables, because glpk does not support non-linear constraints. Nevertheless, you can reformulate your model using SOS2 constraints, since less is a piecewise linear operator. For more details see: http://lists.gnu.org/archive/html/help-glpk/2007-06/msg00005.html > var a {i in I}, binary; > s.t. R4 {i in I diff J}: a[i]-a[i-1] !=0; This constraint is also incorrectly formulated. The correct formulation is the following: s.t. R4 {i in I diff J}: a[i] + a[i-1] = 1; _______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
