bipartite problem