Wednesday, November 23, 2011

This does not compute

GLPK doesn't accept an constraint in which a variable is devided by an variable, i would like to know if there is some solution to linearize this constraint. knowning that var2 is binary and var 1 is reel in case var1 / var 2.

This means var2=1 and we can replace the expression var1/var2 by var1.


  1. The link below might help. Slides #22-24 show conditional expressions:

  2. How about interpreting the request as
    ( var1 / var2 ) = var1 + (1-var2)* BIGNUM
    where BIGNUM is a reasonable version of Infinity.

    Then the context might be constraint <= var1 + (1-var2)* BIGNUM
    to allow relaxation of a constraint depending on the binary var2.