As far as I understood, you are going to have 9! games with 10 teams as sooner or later each team will play a match with others.
I noticed that in your algorithm you are using
for (int i = 1; i <= 10; i++)
{
_teams.Add(new Team("Team "+i,MyExtensions.RandomNumber(31)));
}
If space complexity is not a problem, currently, I suggest following:
0. Create an array of HashSet (size = n-1, in your case 9). In these hashsets, we will keep the team_number with which the team_index has player a match. (Note: When there is a match between team 4 and 5, we do arrayHashset[4].add(5) and we never do arrayHashset[HighNumber].add(SmallerNumber) because this entry will be avilable to us in arrayHashset[SmallNumber].add(HighNumber).
1. The index of this array is the team number, 1 - 9 (Team 10 wont have any hashset as its the highest number thus all matches of team 10 will be saved in other hashsets).
2. Sort the list during the above loop.
3. Take first two of this list and make a match. Whichever number is smaller. Do ArrayHashSet[SmallerNumber].add(greaterNumber).
4. Increase the points randomly, sort it. Take above two, find min of those team. Look in the hashset of min number if the higher number is present or not. If not make the match else choose the team in sorted array which is just below and repeat again.
Two minor optimization you can do is:
1. Eliminate a team from the list once it has played matches against all other teams this would reduce the sorting complexity a bit for remaining matches. You can maintain an array to keep the match counter indexed by the team_number.
2. When you increase the points randomly, if possible, first increase points of the team which is at 0th index in the latest sorted list, then 1st index, then 2nd and so on... By doing so, you have the opportunity to check if after increasing points this team is eligible for index change or not (thus you can avoid unnecessary moves for sorting).
Right now, I am unable to think of any other solution. Hope you would post me back some better solution once found.