Hopcroft–Karp

Find places for as many participants as possible. Imagine casting a school play. Each actor lists roles they would like, but can play only one, and each role needs just one actor.

Actors are on the left, roles on the right. A line shows a role an actor can play. Start the search from all the actors who still need roles. Flip several shortest alternating chains in a phase, then rebuild the layers.

Time is O((V + E)√V), space O(V + E).