Simple graph data structure written in Python