Edmonds’ blossom algorithm

Make as many pairs of players as possible. A line connects two people who can play together. Each player can belong to just one pair.

Alternate unmatched and matched edges from a free vertex. When two branches close an odd cycle, temporarily treat it as one vertex. Colors and base labels identify the contracted blossom.

This implementation with explicit contraction scans takes O(V³) time.