At 12:38am -0500 Fri, 15 Nov 2013, Kevin Hunter Kesling wrote:
At 4:18pm -0500 Thu, 14 Nov 2013, Joseph Mundy wrote:
It is possible in glpk to represent variables with multiple bounds
that are disjoint? For example,
1<= x <=2 or 5<=x<=7. It seems that two different linear programs
must be formulated.
Yes, it is generally possible. Consider:
1 * b <= x <= 2*b
5 * (1 - b) <= x <= 7 * (1 - b)
where 'b' is a binary variable. I don't know if GLPK supports
multiple bounds directly on variables, but you can certainly
incorporate the disjointness as standard constraints.
Ah crap. That's embarrassing. It's late, and I'm clearly beyond my
useful hours. That's not going to work, as x would have to be 0 to
simultaneously satisfy both of those. Consider instead:
5*b + 1*(1-b) <= x <= 7*b + 2*(1-b)
You can still incorporate as constraints, however.
Kevin
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk