Does this still work when the edge with maximum ID is removed from the graph, or a new edge is added?