igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Extra vertex being read from edgelist


From: Prithwiraj MUKHERJEE
Subject: Re: [igraph] Extra vertex being read from edgelist
Date: Tue, 19 Nov 2013 16:38:26 +0100

Thanks! I fixed it now.


2013/11/19 Tamás Nepusz <address@hidden>
Hi

igraph edgelist files use zero-based vertex indices, so your edgelist file contains 1134 vertices since the highest vertex ID in the file is 1133. Subtract 1 from every edge ID  in the file and you should be okay. (However, note that vertex indices in R start from 1, so if you have a vertex with ID=X in your file, this will be vertex X+1 in R).

In case you wonder why edgelist files are zero-based: this is for sake of compatibility with edgelist files created from the raw C API of igraph or from igraph’s Python interface because those are zero-based.

-- 
T.

On Tuesday, 19 November 2013 at 16:00, Prithwiraj MUKHERJEE wrote:

Hi

I have attached an edgelist file "email_edges.txt". The graph has 1133 vertices. I am reading it as

G<-read.graph("email_edges.txt", format="edgelist")

On checking the graph, it has 1134 vertices (one extra vertex). Is there something I am missing?

I am using igraph's latest version (i updated it today) on R 2.15.3 (64 bit) for Windows 7.

Regards
Prithwiraj

_______________________________________________
igraph-help mailing list

Attachments:
- email_edges.txt


_______________________________________________
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]