I'm trying to solve the standard bipartization problem, i.e., find a subset of the edges such that the output graph is a bipartite graph. My additional constraints are:
- The number of vertices on each side must be equal.
- Each vertex has exactly 1 edge.
In fact, it would suffice to know whether such a subset exists at all - I don't really need the construction itself. Optimally, the algorithm should be fast as I need to run it for O(400) nodes repeatedly.