Hi.
I am using the BetweennessCentrality function and I want to see it if is possible to weight the nodes in some form. For example, if nodes are warehouses and not all of them have the same size, then I might want to calculate the importance of a node by a combination of the "betweenness" and the size of the source and the destination in the form of a weighted sum instead of a simple sum.
The following code is very very veeeeery slow and memory intensive (my graph has 3000 vertices and 9000 edges) and the original BetweennessCentrality function takes around 2 seconds. So if anyone can help me I would really appreciate it.
Do[(
sp = FindShortestPath[graf, node];
If[(shortpath = sp[#]; Length > 2), occurrences[[shortpath[[2 ;; -2]]]] =
occurrences[[shortpath[[2 ;; -2]]]] + warehousesize[[node]]]&/@Range[n]
), {node, n}]
Thanks
Fernando