igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Read/Write Weighted Grapphs


From: Tamas Nepusz
Subject: Re: [igraph] Read/Write Weighted Grapphs
Date: Wed, 1 Sep 2010 10:11:48 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Dear Lorenzo,

> However, I must be doing something wrong, since when I read the two
> files, I finally get a different strength distribution.
> How comes? Am I making a mistake?
Well, there is no guarantee that the edge IDs will stay the same when
you save a graph and read it back. Since you store the weights
separately and then read them back, you implicitly assume that the edge
IDs stay the same, hence the re-assignment of the weights vector will
get you the same graph. This is not true.

Why do you store the weights separately? You could simply save your
graph in ncol format (which is practically a weighted symbolic edge
list), which stores the weights along with the edges, so they will not
be permuted.

Best,
-- 
Tamas



reply via email to

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