[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] if...then...else
From: |
Michael Hennebry |
Subject: |
Re: [Help-glpk] if...then...else |
Date: |
Fri, 25 Jun 2010 09:34:17 -0500 (CDT) |
User-agent: |
Alpine 1.00 (DEB 882 2007-12-20) |
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 address@hidden
"Pessimist: The glass is half empty.
Optimist: The glass is half full.
Engineer: The glass is twice as big as it needs to be."