# R igraph: edge weights should be interpreted as connection strenghts or distances?

Hello everyone,

I am analyzing a weighted, directed network with R igraph. I noticed that there are a number of functions that allow the use of edge weights as arguments and make it explicit whether these edge weight should be interpreted as connection strengths or as distances. But there are a number of functions in which the documentation does not make it clear how they should be interpreted. Among these I can mention `mean_distance()`, `global_efficiency()`, `local_efficiency()`, `strength()`, `transitivity()`, `alpha.centrality()`, `diversity()`, `knn()` etc.

Does anyone have any clue as to how I should interpret the edge weights in those cases?

Any function that is based on the concept of distances / path lengths (i.e. mean distance, efficiency, etc.) computes the length of a path by adding up edge weights along the path, as is standard in network analysis.

The documentation of `strength()` makes the answer very clear. Quoting:

Summing up the edge weights of the adjacent edges for each vertex.

`transitivity()`: once again, the documentation explains how weights are used. Only Barrat’s version uses weights. The formula is given in the documentation, as well as a reference to Barrat’s paper.

`knn()`: again, the documentation contains the formula, as a reference to the same paper where Barrat’s transitivity is defined.

`alpha_centrality()`: this metric is defined based on the adjacency matrix. The weights are used in the adjacency matrix in the usual manner (i.e. included directly).

`diversity()`: formula, as well as reference to the original paper, are given.

Frankly, I’m not sure how the documentation could be improved further, though specific suggestions are always welcome.

Generally, igraph functions will not perform ad-hoc transformations on the weight values that you pass in, such as inverting them to transform large values to small ones. The weight values will be used as they are by each analysis function. For example, if you compute betweenness, which is based on the concept shortest paths, weights will be used for path length calculations. Thus larger weights naturally indicate weaker connections.

Note though that the igraph documentation is not really the best resource to learn about network analysis concepts … It’s a good idea to read up on each metric you are planning to use, as well as its interpretation. Some metrics can be defined in subtly different ways, and indeed you will find differences between the various network analysis packages. The igraph documentation aims to make it clear (and unambiguous) which specific definition is used, but it does not aim to explain the usage/interpretation of each metric in detail.

Sorry if my questions were quite basic. It happens that I am a beginner in R, igraph and SNA. In any case, your tips were very useful to me. Thank you.

As to specific suggestions to improve further the documentation, I would suggest adding straightforward sentences as we already can read in several functions of the documentation: “Edges are interpreted as distances, not as connection strengths”, “Larger edge weights correspond to stronger connections” etc.

It’s just an amateur suggestion that might help other beginners like me.

Best regards,

Fernando.

Distances, strength are concepts from the physical world. A graph can be seen as an abstract model. But igraph, of course, does not know the translation between the two. The less the model assumes about the real world, the more broadly applicable it is. Keep it simple, but not too simple.

Models can include navigation, social cohesion, schedules, network topologies, competition scores, group symmetry, genealogy and organization charts, among others. So as a user, you have to determine for yourself the “meaning” of distance, strength as used in the igraph documentation with respect to your specific application.

Fortunately, you do not need to be an expert, the best help: common sense in your area of interest.