Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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 In reply to Re: Assign guests to hotel rooms
by QM
|
|