On Fri, 21 Mar 2014 09:42:25 -0600
jbiskofski <[email protected]> wrote:

> I have 6 elevators, and 50 people. These people weigh between 120 and
> 350lbs.
> 
> How can I find the optimal way of distributing these people into the 6
> elevators so that each elevator carries approximately the same
> weight ?
> 
> Hopefully the proposed solutions are "use XYZ::FOO::BAR module from
> cpan" rather than 60 lines of crazy algorithm perl code :)
> 
> Have a nice day everyone!

This is known as the Knapsack Problem:
http://en.wikipedia.org/wiki/Knapsack_problem

And it's NP-hard. :(


-- 
Don't stop where the ink does.
        Shawn

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to