Skip to content

Instantly share code, notes, and snippets.

int m, n;
boolean[][] graph;
boolean seen[];
int matchL[]; //What left vertex i is matched to (or -1 if unmatched)
int matchR[]; //What right vertex j is matched to (or -1 if unmatched)
int maximumMatching() {
//Read input and populate graph[][]
//Set m to be the size of L, n to be the size of R
Arrays.fill(matchL, -1);