Graph Theory37 sections · 1633 units
Open in Course

School Dance - Extracting Pairs

(Check flow on middle edges)

After computing max flow, extract the pairs by looking at the flow on edges between boys and girls. If f(boyi,girlj)=1f(\text{boy}_i, \text{girl}_j) = 1, then boy ii and girl jj are paired. Only edges with flow 11 represent actual pairs.

Edges with flow 00 are unused preferences. Output all such pairs. The count equals the max flow value. This extracts the matching from the flow solution. The flow values directly represent the pairing.