very simple bipartite cardinally matching algorithm