[R] Calculating Betweenness - Efficiency problem

From: Senthil Purushothaman <spurushothaman_at_lnxresearch.com>
Date: Fri, 18 Jul 2008 12:51:05 -0700


Hello,

I am calculating 'Betweenness' of a large network using R. Currently, I have the node-node information (City1-City2) in an excel file, present in two columns where column A has City1 and column B has City2 that city1 is connected to. These are the steps that I go through to calculate betweenness of my network.

  1. Convert the City1-City2 (text) into Number1-Number2 in the excel file where every unique city has a unique number.
  2. Paste all the city-city information separated by comma into c(...) in the R GUI to obtain the corresponding vectors. As you can imagine this copy-paste operation takes a long time. Example: c(1,3,1,5,2,4,2,5). Just fyi, I have a text file that contains all nodes separated by comma based on the appropriate link information.
  3. Then, I create a graph file with the above vector.
  4. I use the graph file to calculate betweenness of my network.

I am sure there must be a better, more efficient way to calculate betweenness. Ideally, I would like to just have the City1 - City2 (link) information in two columns in an excel file and calculate the betweenness from that file directly.

Please provide an optimal solution for this problem. I appreciate your time and help.

Thanks,
Senthil

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 18 Jul 2008 - 20:07:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 19 Jul 2008 - 23:31:44 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive