Example: boys, girls. Boy likes girls and . Boy likes girl . Boy likes girl . Build the flow graph with source, boys, girls, and sink. All edges have capacity . Max flow is , meaning all boys can be paired. Edmonds-Karp finds augmenting paths:
(bottleneck ).
(bottleneck ).
(bottleneck ).
Final pairs: (,), (,), (,). Output pairs. The algorithm found a perfect matching where everyone dances.