Set solver constraints so variables are either 1 OR 0.

G

Gwyndalf

I have an array which consists of some 100 variables but each can only be 1
or zero. (0.3 of a vehicle is meaningless!!!) If I place the constraints of
=0 and <=1 and INT(all seperate line entries) the solver still wastes many
iterations with decimal numbers resulting in a long time to work out the
solution. The variables are used to specify the numbers of vehicle types
needed to tramsport a certain number of passengers. Each vehicle has a
different capacity and a different cost. I wish to find the cheapest
solution hence the variables array.

Can anyone offer a solution to the subject problem? Many Thanks.
 
D

Dana DeLouis

each can only be 1 or zero.
the constraints of >=0 and <=1 and INT(all separate line entries).

One option would be to use the following instead.
For one of the constraints, add that A1:A100 are "bin." (The last item in
the pull-down menu).
bin means "Binary", which is the integer 0 or 1, and is designed to be a
little more efficient then the above code.
Hopefully this will help.
 
G

Gwyndalf

Thanks for taking the time to reply.
The solver still comes up with decimal values despite using bin as the
constraint - I suspect that I must be thick!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top