title: Tree and graph data structures in ruby
body: <p>I'm having a hard time finding tree data structures to use in ruby. Are there some well known ones I can look into? My requirements are simple. I want to create a tree (or maybe it's a graph) and find the distance between some of the nodes. For example, I might have a tree/graph like the following</p>
  
  <pre><code>     A
     /   \
    B-----C
   / \     \ 
  D   E     F
  </code></pre>
  
  <p>I want to be able to find the distances between the root node (A) and all the other nodes. So the distance between (A, B) should be 1, between (A, E) is 2, etc. Even though from node (A) you can get to (C) via (A, B, C), the length should still just be 1 since there is a direct path from (A, C).</p>
  
  <p>Is there a tree/graph gem I can use in ruby for this?</p>