0

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:

  1. The number of vertices on each side must be equal.
  2. 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.

1 Answers1

0

If each vertex is to be incident on exactly one edge, it seems what you want is a matching. If so, Edmonds's blossom algorithm will do the job. I haven't used an implementation of the algorithm to recommend. You might check out http://www.algorithmic-solutions.com/leda/ledak/index.htm

saulspatz
  • 5,011
  • 5
  • 36
  • 47