[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] What is the max value of a node id?

From: ????????????
Subject: Re: [igraph] What is the max value of a node id?
Date: Fri, 26 Apr 2013 00:28:18 +0800

Thank you very much, Tamas!

Microsoft makes things confusing...

and I think I made a big mistake about adding vertices... I found that by the error message "src/vector.pmt:439 : cannot reserve space for vector, Out o memory"

the parameter of igraph_add_vertices is for the count of nodes to add, but not the node id. So if I repeat invoking it with larger and larger value, there will be too many nodes...

As a result, if I just run igraph_add_vertices(&g,2147483647,0), it works... the binary number of 2147483647 is 31 1 bits. As we know, the 32nd bit is the sign bit.
So if I run igraph_add_vertices(&g,2147483648,0), following error occurs: src/type_indexededgelist.c:369: cannot add negative number of vertices, Invalid value


It seems that there is not a function by which adding a single node by its ID? there is add_vertex() in python package, and if g.add_vertex(4294967296), the number will be the Name of the node.

BTW, I found that by calling g.add_vertex() in python, the Name of the node can be very large number, even larger than 64 bits, why is that?

------------------ Original ------------------
From:  "Tam??s Nepusz"<address@hidden>;
Date:  Thu, Apr 25, 2013 11:10 PM
To:  "Help for igraph users"<address@hidden>;
Subject:  Re: [igraph] What is the max value of a node id?

> 1. Why are the lengths of int, long, and long int all 4 bytes in my environment?
Well, since you are using Windows, you'd better ask Microsoft, not us ;) See this answer on Stack Overflow for more details:


> 2. even for 4 bytes of igraph_integer_t, why does not igraph_add_vertices work for 25 bits integer such as 33554431 and larger?
What is the error code you are getting when you try to add 33554431 vertices with igraph_add_vertices? Also, note that the parameter to igraph_add_vertices is *not* the ID of the vertex to add but the *number* of vertices to add.

igraph-help mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]