2
votes

I have a vertices list as (vertexID) and a edge list as (srcID, dstID). I want to create a igraph Graph out of these nodes and edges. The ids are OSM Node IDs and they do not start from zero and are not sequential in most cases. Also, I am dealing with hundreds and thousands of nodes. Hence to make the graph creation fast I tried following code:

gr = Graph()
gr.add_vertices(vertexList)
gr.add_edges(edgeList)

But I get following error:

OverflowError: long integer too large for conversion to C int

I think because my Ids are of type long I get this error. Is there any way to get around this error without sacrificing the speed of graph creation?

1

1 Answers

0
votes

Had this same issue just now - I converted my list into strings, verse integers, then the issue was solved - though I have no created another issue.