Graph ids are used to check that a vertex or edge sequence belongs to a graph. If you create a new graph by changing the structure of a graph, the new graph will have a new id. Changing the attributes will not change the id.
graph_id(x, ...)
The id of the graph, a character scalar. For vertex and edge sequences the id of the graph they were created from.