[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Betweenness in weighted adjacency matrix
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] Betweenness in weighted adjacency matrix |
Date: |
Fri, 3 May 2013 12:28:58 +0200 |
Hi,
> Import the txt file which looks as following (The first row specifies the
> code for the different nodes, the other rows specifies the weights of edges).
How come that your input file is not a square matrix? It seems to have 8 rows
and 13 columns -- where are the 5 missing rows and the 5 missing node names?
Otherwise what you do seems okay for me.
> IS it ok for igraph to have the name of the nodes just in the first row and
> not in the first column to generate an adjacency matrix? i have read
> somewhere it is the same as having the first column with 'A','B','C',etc
igraph doesn't care -- it does not read your file, it reads the matrix that you
loaded with read.table. If the matrix looks fine in R, then it should be okay
for igraph as well.
> I want then to calculate the betweenness, that will return a result for each
> node, but I am not sure whether the weights are inserted correctly in the
> function.
Seems okay for me, assuming that your input matrix is correct -- which is still
a bit weird for me because of the missing rows.
> Is there a way I can check the results using other programs?
Of course -- find another program that can calculate weighted betweenness
scores and compare the results ;) One possible option is the NetworkX module
for Python if you know the Python language. (igraph also has a Python interface
but it would be quite useless to compare igraph in Python vs igraph in R
because they use the same implementation).
--
T.