Perl class for direct graph data structures and algorithms