Update the graph