You have applicants and jobs, and lines connecting each applicant to the jobs they're qualified for. You want to hire as many people as possible — pair each to a job they can do, with nobody double-booked. The same shape appears everywhere: students to projects, riders to drivers, donors to patients.
The tempting approach is greedy: walk through the connections and grab any pair that still fits. It's quick — but it can paint itself into a corner. An early, hasty pairing can block two other pairings that would have worked, leaving people unmatched who didn't have to be.
That's the maximum matching problem: find the largest set of pairs. And here's the cheerful news, fitting for a finale: it's easy. Unlike the NP-hard problems across this site, maximum matching is solvable exactly, in polynomial time — and it's the engine inside assignment and kidney exchange.
Comments
Loading comments...