igraph-help
[Top][All Lists]
Advanced

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

[igraph] edge betweenness after scaling edge weights


From: Guido Scarabelli
Subject: [igraph] edge betweenness after scaling edge weights
Date: Tue, 28 May 2013 18:24:15 -0400

Hi everyone!
I am using igraph version 0.6.5-2 with R (version 2.15.0) on a Linux machine.

My question is: is it possible that the betweenness of the edges change if the weights of the network are scaled all by the same factor?

In my case I started with a file containing the following adjacency matrix:

0  1  0  0  0
1  0  1  1  0
0  1  0  0  1
0  1  0  0  1
0  0  1  1  0

and in the R session I used these commands to build the network (it has 5 nodes and 5 edges):

library(igraph)
test.network <- data.matrix(read.table("matrix.dat"))
test.graphic <- graph.adjacency(test.network,mode="undirected",weighted=TRUE,diag=FALSE)

The command "edge.betweenness(test.graphic)" gives this output:
4.0 3.5 3.5 2.5 2.5

Now, if I use the following matrix (I divided the weights all by 10):

0.0 0.1 0.0 0.0 0.0
0.1 0.0 0.1 0.1 0.0
0.0 0.1 0.0 0.0 0.1
0.0 0.1 0.0 0.0 0.1
0.0 0.0 0.1 0.1 0.0

the command "edge.betweenness" gives this output:
4.00 2.25 3.75 2.25 3.75

Also, if I divide by 100 the original matrix I get other edge betweenness values:
4 5 3 3 1

I do not know what I am doing wrong, as I suppose the edge betweenness should not change if I scale all the weights of the edges by the same value...
Does anyone have an idea?
Thanks so much in advance for the help!
Guido

P.S. Counting by hand the betweenness values, the ones of the first matrix should be the correct ones.

reply via email to

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