igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] What's wrong with vcount() ?


From: shahab
Subject: Re: [igraph] What's wrong with vcount() ?
Date: Fri, 15 Mar 2013 20:20:29 +0100

I see .Thanks a lot for quick reply.

best,
/Shahab

On Fri, Mar 15, 2013 at 8:12 PM, Tamás Nepusz <address@hidden> wrote:
>> I face strange problem with vcount(). I tried to get the number of
>> nodes form an edge list graph (see attachment).
>> Using vcount() it returns 502 but in fact it is 262 nodes ???
> No, it has 502 nodes since there is an edge from vertex 35 to vertex 501 
> according to the file, and the nodes are indexed from zero upwards in an 
> edgelist file. So, if the highest node ID is 501 in your file, it means that 
> it has 502 nodes. Of course it may happen that lots of your nodes have no 
> attached edges.
>
> If your numeric IDs are not continuous, you may want to read the file using 
> the NCOL format instead of edgelist. In this case, igraph will treat the 
> numbers in the file as symbolic names and it will attach them to the "name" 
> vertex attribute. However, in this case, the nodes will be ordered 
> arbitrarily and you will have to look up the appropriate indices based on the 
> "name" vertex attribute.
>
> --
> T.
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help



reply via email to

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