my first pull request

These changes are just graph.cpp. Please merge this once and for all.