[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] igraph - problem at summary function: number of nodes does
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] igraph - problem at summary function: number of nodes does not match |
Date: |
Wed, 11 Jun 2014 14:45:14 +0200 |
> 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.