开发者

Algorithm to calculate the number of matches in Swiss system tournament

I need to calculate the number of matches i开发者_JS百科n a Swiss system tournament, is there any library in php that can help me?


From the description on Wikipedia, it seems that it is determining the pairings that is the difficult task. The total number of matches just depends on how many rounds are played. If we go with the suggestion that the number of rounds is determined by the base-2 logarithm of the number of entrants (n), then the number of matches (m) is as follows:

m = ceil(log2 n) * floor(n / 2)

So for 10 players you need 4 rounds, with 5 matches in each, hence 20 matches. With an odd number of players there would be a bye, so for 11 players the number of matches is the same.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜