I am working with some tournament software where i need to generate pairings based on the swiss system. Some of the ideas i have came up with are as follows:
1)Create all permutations and choose best -This is O(n!) which is not possible when n can be up to 1000.
2)Create a weighted graph and choose best pairs somehow -I feel this is best but was hoping to find some similar examples
3)Find api where players(objects) can be passed in and paired based on typical elo/swiss pairing rules.
4)Generate initial result with no logic then try to improve with swapping until no more improvements can be made(not sure how one would know when no more improvements can be made)
So for pairings players are paired with others with same scores and staggered. So for example in a 16 player tournament the first round would have top seed paired with 9 seed and 2nd seed paired with 10 seed and so on. This gets complicated when you take into account teams(players on same team will only play each other when forced), players can't play each other twice, alternating colors is optimal which is what is meant by the above #1 creating all permutations to see which is best. This will not work if tournament is large.
Thanks in advance for any suggestions