title: Minimizing space usage by moving sets on a graph
body: <p>I have a complete directional graph. On each edge there is a set of numbers. The set is saved on the source node by default. Note that each number is saved only ONCE. For example, if a node has two edges with sets {1,2,3} and {2,3,4} it takes only 4 spaces.
  Now, we can select an edge to move the set from the source to the destination with one space penalty. The question is which sets to move to the other side to get minimum space usage.</p>
  
  <p>For example if I have the following graph</p>
  
  <pre><code>1-&gt;2: {123}
  1-&gt;3: {456}
  2-&gt;1: {}
  2-&gt;3: {456}
  3-&gt;1: {}
  3-&gt;2: {123}
  </code></pre>
  
  <p>The original space usage is 12. But if I move all the sets to the destinations the used space is 3+3=6 which with 4 space penalty the result will be 10 which is better than the original setting.</p>
  
  <p>Does anyone have any hint for this problem? Is this similar to an NP-complete problems?</p>