title: How to generate transitive closure of set of tuples?
body: <p>What is the best way to generate transitive closure of a set of tuples?</p>
  
  <p>Example:</p>
  
  <ul>
  <li>Input <code>Set((1, 2), (2, 3), (3, 4), (5, 0))</code></li>
  <li>Output <code>Set((1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4), (5, 0))</code></li>
  </ul>