On Fri, 25 Jun 2010, glpk xypron wrote:

see the example below.

if w[s] = 0 then inc[s] = 0 else inc[s] = 1

Your "if" is modelled as

s.t. indicator{s in S} :
 w[s] <= M * inc[s];

M should be chosen as small as is possible without restricting
the solution.

Possibly better:
w[s] <= M[s] * inc[s]
where M[s] is an upper bound on w[s].
The difference can be important if the w's can have distinct bounds.

--
Michael   [email protected]
"Pessimist: The glass is half empty.
Optimist:   The glass is half full.
Engineer:   The glass is twice as big as it needs to be."

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

Reply via email to