Python implementation of graphs.