in reply to Assign guests to hotel rooms

Also without getting into specific algorithms, it seems you need to do something along the following:
1) Generate combinations of people-room tuples (perhaps using an iterator instead of all at once).
2) Write a scoring function that returns a value showing how good the match is on each tuple.
2a) You may also want a scoring function that looks at overall efficiency, such as wasted space and empty rooms.
3) Iterate through the combinations, keeping track of which solutions have the highest totals.

Depending on the size of the problem set, you may need to optimize this by pruning the search space. You need to ask yourself if you want a pretty good solution, or the optimal. Optimal may take a long time to find, while pretty good could be an order of magnitude quicker.

-QM
--
Quantum Mechanics: The dreams stuff is made of

Replies are listed 'Best First'.
Re^2: Assign guests to hotel rooms
by richard5mith (Beadle) on Sep 15, 2005 at 16:05 UTC
    I'm happy with good. The user can always change it afterwards to something more optimal.