Efficient algorithm for creating an ideal distribution of groups into containers?

Posted by Inshim on Stack Overflow See other posts from Stack Overflow or by Inshim
Published on 2010-06-13T19:06:59Z Indexed on 2010/06/13 19:12 UTC
Read the original article Hit count: 342

I have groups of students that need to be allocated into classrooms of a fixed capacity (say, 100 chairs in each).

Each group must only be allocated to a single classroom, even if it is larger than the capacity (ie there can be an overflow, with students standing up)

I need an algorithm to make the allocations with minimum overflows and under-capacity classrooms.

A naive algorithm to do this allocation is horrendously slow when having ~200 groups, with a distribution of about half of them being under 20% of the classroom size.

Any ideas where I can find at least some good starting point for making this algorithm lightning fast?

Thanks!

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about optimization