I dropped the heuristic idea and went for a simpler/easier to tweak approach:
If no match was found, create a new one using the existing rules (random map, random left/right team).
Edit: applied tweaks from 5.3.1 (bold)
- get the 100 "oldest" (ordered by creation time) available matches with opponents in player's league
- filter matches with opponents that were played against in the last 10 minutes
- get the best from these matches using these comparison rules:
- match with an opponent in the closest league (compared to player's league) is the best
- in case of equality: match with an opponent using a different IP is the best
- in case of equality: match with an opponent never met or met the furthest from now is the best (using a 10 minutes tolerance)
- in case of equality: match with an opponent with the closest ELO score (compared to player's ELO score) is the best (using a 10 points tolerance)
- in case of equality: match with a creation time the furthest from now is the best
- match with an opponent in the closest league (compared to player's league) is the best
If no match was found, create a new one using the existing rules (random map, random left/right team).
Edit: applied tweaks from 5.3.1 (bold)