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.

2 comments:

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

    http://www.ampl.com/MEETINGS/TALKS/2011_11_Charlotte_TD18.pdf

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

    ReplyDelete