Read_Edgelist assumes that the node identifiers are integers from 0 to m, where m is the maximum integer in the list edge. Thus, "there is no need to store node ids".
For example, if your edgelist.txt is 1 3 , this code
import igraph as ig g = ig.Graph.Read_Edgelist("edgelist.txt") print g.get_adjacency()
creates a graph with four nodes (0, 1, 2, 3) and prints
[[0, 0, 0, 0] [0, 0, 0, 1] [0, 0, 0, 0] [0, 0, 0, 0]]
See this answer if you do not want to create intermediate nodes.
While there is no need for a graph with consecutive node identifiers starting with 0, you can access the node identifiers using VertexSeq and Vertex :
for v in g.vs: print v.index
source share