title: Merge/Join two separate graphs algorithm?
body: <p>i Need an algorithm for merging or joining to graphs, by this I mean that the last node of graph 1 should be predecesor of first node of graph 2. 
  Graph 1:</p>
  
  <pre><code>1-&gt;2-&gt;3
     \ /
      4-&gt;5
  </code></pre>
  
  <p>Graph 2: </p>
  
  <pre><code>6-&gt;7
     | \
     8-&gt;9
  </code></pre>
  
  <p>This is what I need:</p>
  
  <pre><code>1-&gt;2-&gt;3
     \ /
      4-&gt;5-&gt;6-&gt;7
               | \
               8-&gt;9
  </code></pre>