Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Your Intelligence on this!

0 views
Skip to first unread message

Mike

unread,
Nov 24, 2009, 2:53:39 PM11/24/09
to
Hi everyone,

Say I have 3 sets [A, B, C] each set has 2 elements [X, Y], and I want
to select of each set a single element only. That means I have 2+2+2=6
[(A+X, A+Y, B+X, B+Y, C+X, C+Y] possible combinations. Suppose all
variables are BINARY, and an SOS constraint forces a single selection
from each set ONLY. It is a binary linear model.

Now, assume that every element has a single value of ONE. That means
any solution is an optimal since any pair of elements has a value of
2.

Whether I am using GAMS, MPL, AMPL, etc. Is there a way that I can
trick the modeler/solver to write down all 6 solutions?

Thanks,
Mike

Paul

unread,
Nov 27, 2009, 6:31:28 PM11/27/09
to
On Nov 24, 2:53 pm, Mike <mas_it_2...@yahoo.com> wrote:
> Hi everyone,
>
> Say I have 3 sets [A, B, C] each set has 2 elements [X, Y], and I want
> to select of each set a single element only. That means I have 2+2+2=6
> [(A+X, A+Y, B+X, B+Y, C+X, C+Y] possible combinations.

... or 2*2*2=8 combinations ...

> Suppose all
> variables are BINARY, and an SOS constraint forces a single selection
> from each set ONLY. It is a binary linear model.
>
> Now, assume that every element has a single value of ONE. That means
> any solution is an optimal since any pair of elements has a value of
> 2.
>
> Whether I am using GAMS, MPL, AMPL, etc. Is there a way that I can
> trick the modeler/solver to write down all 6 solutions?

It's possible to force most solvers to find all combinations by usin,
t a callback that records and then rejects each solution. I'm not
aware of a way to do that from a modelling language.

This presumes that there is some reason for using variables in the
first place (i.e., that this is a piece of a larger model). If you
have all three sets populated up front (the sets contain data) and you
want to generate the set of all combinations, you can use a looping
construct in a modelling language.

/Paul

0 new messages