title: How to implement undirected graph in Ruby on Rails?
body: <p>I need to implement a undirected graph G = (V,E) in Ruby on Rails and thought of building a <em>Vertex</em> and an <em>Edge</em> model where <em>Vertex has_many Edges</em>.</p>
  
  <p>As an edge connects exactly two vertices, how would you enforce this in Rails? </p>
  
  <p>Do you know any gem or library that would help implementing such a graph (not intrested in re-inventing the wheel ;-))?</p>