igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] vcount() shows one more node than existing one ??


From: Tamás Nepusz
Subject: Re: [igraph] vcount() shows one more node than existing one ??
Date: Tue, 23 Oct 2012 20:23:13 +0200

> More probably I am mistaking, but I loaded an edge list graph
> (graph<-read.graph("graph.txt", format="edgelist",0, TRUE), with 7
> nodes but vcount(..) shows me 8 (nodes).
> The nodes in my graph are identified by a numeric number  1-7 (graph
> is shown in below).
igraph uses zero-based vertex indices in edge list files, so your input file 
has an isolated vertex with ID zero. That's why you are seeing 8 vertices 
instead of 7. You can either recode your input file to zero-based indices or 
delete the extra vertex after you have loaded the file.

-- 
T.


reply via email to

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