title: Split vertices of disconnected bipartite graph equally
body: <p>I'm given a graph with many seperate components. Each component is bipartite. How do I distribute the vertices into two sets <code>A</code> and <code>B</code> such that the difference between the two sets is minimal ? </p>
  
  <p>Example:</p>
  
  <p>1: <code>1 -&gt; 2 -&gt;3 -&gt; 4 -&gt; 5</code></p>
  
  <p>2: <code>6 -&gt; 7 -&gt; 8</code></p>
  
  <p>The best solution is</p>
  
  <p><code>A = {1, 3, 5, 7}</code></p>
  
  <p><code>B = {2, 4 ,6, 8}</code></p>
  
  <p>The other (non-optimal) solution is </p>
  
  <p><code>A = {1, 3, 5, 6, 8}</code></p>
  
  <p><code>B = {2, 4, 7}</code></p>
  
  <p>How do you solve this when the graph has many seperate bipartite components ?</p>