added some documenation and more functionality to the graph algorithms.