Update graph.cpp