igraph-help
[Top][All Lists]
Advanced

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

[igraph] edge.betweenness returns negative or NaN values


From: Vincent Labatut
Subject: [igraph] edge.betweenness returns negative or NaN values
Date: Sat, 12 Sep 2015 15:08:43 +0200

Hello,

I am processing the edge-betweenness of various networks using R igraph version 7.1. Those are spatial networks (each node has a (x,y) position) and I am using the "weight" option of the "edge.betweenness" function to take the spatial distances into account. This spatial distance is stored in an edge attribute called "dist".

Here is the command I use:
edge.betweenness(graph=g, weights=E(g)$dist)

However, for some of my networks, I get negative values, or even NaN. Here are two examples, under the graphml format: http://dx.doi.org/10.6084/m9.figshare.1540708
- scale=32.graphml
- scale=41.graphml

For the first one, the first values returned by "edge.betweenness" are:
   [1] 1904887544.08 1904887544.08 1896303182.39 1951787568.72 1203043060.76
   [6] 1270869072.68  622780616.09  667964773.27  279064394.68  309184936.21
  [11]  135403467.81  155266075.94   51600202.02   60120695.31   21113003.39
  [16]   24783603.89    6275147.30    6937885.52    1347425.01    1002544.99
  [21]     150574.42    -327097.77    -711849.38   -1430744.36    -246214.20
  [26]    -602827.15    -230344.97    -484630.12    -297768.08    -492364.06

For the second one, all the returned values are NaN.

Note that all these weights are positive by definition. They even are non-zero since no two nodes hold the same position, by construction. I also checked this programmatically. Moreover, there are no multiple links, also by construction (and I checked with "has.multiple").

I was wondering if the negative or NaN values I get are due to me misusing the function, or if this is a bug in igraph.

Thanks,
Vincent Labatut

reply via email to

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