Tennis match scheduling

前端 未结 6 2056
余生分开走
余生分开走 2020-12-12 22:06

There are a limited number of players and a limited number of tennis courts. At each round, there can be at most as many matches as there are courts. Nobody plays 2 rounds

6条回答
  •  青春惊慌失措
    2020-12-12 22:53

    Each player must play at least n - 1 matches where n is the number of players. So the minimum of rounds is 2(n - 1) - 1, since every player needs to rest a match. The minimum is also bound by (n(n-1))/2 total matches divided by number of courts. Using the smallest of these two gives you the length of the optimal solution. Then it's a matter of coming up with a good lower estimating formula ((number of matches+rests remaining)/courts) and run A* search.

    As Geoffrey said, I believe the problem is NP Hard, but meta-heuristics such as A* is very applicable.

提交回复
热议问题