update Graph.cpp