Message Boards Message Boards

0
|
4338 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How can BetweennessCentrality be generalized?

Posted 11 years ago
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
POSTED BY: Fernando Perez
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract