igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] igraph - problem at summary function: number of nodes does


From: Csaba Ragany
Subject: Re: [igraph] igraph - problem at summary function: number of nodes does not match
Date: Wed, 11 Jun 2014 14:57:05 +0200

Thank you! It works!


2014-06-11 14:45 GMT+02:00 Tamás Nepusz <address@hidden>:
> Can anyone explain why the number of nodes is 425957 instead 317080?
It is probably because you read it into igraph using the "edgelist" format, which assumes that vertex IDs start from zero and are continuous. If this is not the case, use the "ncol" format, which will simply assign integer IDs to the vertices and preserve the original IDs in the file in the "name" vertex attribute (see my_graph.vs["name"]). Also, you will need to get rid of the first four lines in the file and specify explicitly that your graph is undirected:

In [1]: g=load("com-dblp.ungraph.txt", format="ncol", directed=False)
In [2]: summary(g)
IGRAPH UN-- 317080 1049866 -- 
+ attr: name (v)

-- 
T.




reply via email to

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