开发者

Allocating preferences

If n beds are to be allocated to m people.Each may have multiple 开发者_运维问答preferences or not prefer at all. How to satisfy maximum people. A person who had a preference and got the same will be accounted as a satisfied person.

I tried allocating a person with minimum preferences first with minimum preferred bed. Is there some case I am missing, because it gave me a wrong answer?


This is the maximum bipartite matching problem. Wiki has good algorithms, also look up maximum flow.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜