Added a few handy methods to maintain graph.