I want to build a graph in Python via package igraph, I can add vertices, but when I add edges, there's a problem I don't know how to fix. I print the vertices and edges above.
g = ig.Graph()
g.add_vertices(dfset)
g.add_edges(edges)
InternalError: Error at type_indexededgelist.c:272: cannot add edges, Invalid vertex id
print(dfset)= [1437218112, 1710990122, 1346433521, 1750346227, 1487721718, 1528123965]
print(edges) = [(1346433521, 1437218112),
(1528123965, 1710990122),
(1528123965, 1750346227),
(1710990122, 1750346227),
(1750346227, 1346433521),
(1750346227, 1437218112),
(1750346227, 1487721718)]
InternalError Traceback (most recent call last)
<ipython-input-75-82114955e940> in <module>()
----> 1 g.add_edges(edges)
/software/python/2.7.10/b1/lib/python2.7/site-packages/igraph/__init__.pyc in add_edges(self, es)
253 endpoints. Vertices are enumerated from zero.
254 """
--> 255 return GraphBase.add_edges(self, es)
256
257 def add_vertex(self, name=None, **kwds):
InternalError: Error at type_indexededgelist.c:272: cannot add edges, Invalid vertex id