You migth also have a look at http://rgl.sourceforge.net/ which provides a method
RGL::Graph#acyclic? for directed graphs.

Horst

> > In other words, whenever a node is added, it must be checked that it
> hasn't produced a cycle.
> >
> > The million dollar question: how?
>
> I am sure there is one for this too. You may want to search for DAG
> construction algorithms in Google.
> HTH,
>
> -- shanko
>
>
>