Graph Theory37 sections · 1633 units
Open in Course

School Dance - Walkthrough

(3 boys 4 girls)

we trace an example: 33 boys, 33 girls, edges {(1,1),(1,2),(2,2),(3,3)}\{(1,1), (1,2), (2,2), (3,3)\}. Start with boy 11, match him to girl 11. Boy 22 matches to girl 22. Boy 33 matches to girl 33. Matching size = 33. This is a perfect matching. Now try {(1,1),(2,1)}\{(1,1), (2,1)\}.

Boy 11 matches girl 11. Boy 22 tries girl 11, she's taken. DFS tries to rematch boy 11, but he has no other options. The attempt fails. Final matching size = 11. This shows why some graphs have smaller matchings.