The "cost" used in the betweenness centrality calculation
6 次查看(过去 30 天)
显示 更早的评论
For weighted networks, in the command "centrality(G,'betweenness','Cost',G.Edges.Weight)", betweenness means shortest paths between other nodes that pass through node i, so when finding out the shortest path, I think the Dijkstra’s algorithm is adopted. So my question is: the weights of links are directly used in the Dijkstra’s algorithm as "cost" or the weights are reversed firstly and then used for finding the shortest path. In summary, what I am asking is the "cost" used in the "centrality(G,'betweenness','Cost',G.Edges.Weight)" is the weights directly or reversed, i.e., higher weight is (1) higher cost and longer distance or (2) lower cost and shorter distance. I appreciate anyone's help regarding this question. Thank you very much.
0 个评论
回答(1 个)
Paras Gupta
2022-6-28
Hi,
It is my understanding that you want to know whether weights are inversed or not when using the ‘betweenness centrality’ measure function in MATLAB. The short answer is ‘NO, the weights are not inversed’.
For measures like the ‘betweenness centrality’, the higher the total edge weight is between any two given nodes, the greater would be the 'cost' between them (or a larger distance between the two nodes). This generally works for cases when the edge weights themselves represent the farness between the edge nodes.
centrality(G,'betweenness','Cost',1./(G.Edges.Weight));
In case the edge weights in your network represent some form of importance between the edge nodes, you can inverse the weights using the element-wise division operation before using the 'betweenness centrality' function (scaling the inversed weights can also be done if required).
You can refer to the documentation of centrality measure functions for more information on the interpretation of the 'cost' argument.
Hope this helps!
1 个评论
Christine Tobler
2022-6-28
Yes, the weights are not used by default in the centrality function, while they are used for example in shortestpath. There's an example in the doc related to betweenness centrality which shows this: Closeness and Betweenness of Minnesota Roads
The reason is just as Paras explained, since centrality measures have two different notions of edge weights, we have these be specified explicitly through the "Cost" or "Importance" flag, depending which notion of edge weight each centrality measure uses. That way, it's explicit whether a larger weight means a larger distance between nodes, or a larger importance of the connection between two nodes.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specialized Power Systems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!