The documentation covers this.
Vertex and edge IDs
Vertices and edges have numerical vertex ids in igraph. Vertex ids are always consecutive and they start with one. I.e. for a graph with n vertices the vertex ids are between 1 and n . If some operation changes the number of vertices in the graphs, e.g. a subgraph is created via induced_subgraph , then the vertices are renumbered to satisfty this criteria.
The same is true for the edges as well, edge ids are always between one and m , the total number of edges in the graph.
It is often desirable to follow vertices along a number of graph operations, and vertex ids don't allow this because of the renumbering. The solution is to assign attributes to the vertices. These are kept by all operations, if possible. See more about attributes in the next section.
Attributes
In igraph it is possible to assign attributes to the vertices or edges of a graph, or to the graph itself. igraph provides flexible constructs for selecting a set of vertices or edges based on their attribute values, see vertex_attr , V and E for details.