Update WeightedGraph.cpp