Simple functionality for work with Graphs in ruby