Home › Forums › Software Bugs (Braph 1.0) › NaN in small worldness › Reply To: NaN in small worldness

Dear Hojoon Lee,

Thanks for using Braph and I hope that it proves to be a valuable tool in your research.

If you would like to implement harmonic mean implementation of the path length calculation, you would need to change the file GraphBU.m. Locate the method “measure” in the GraphBU.m file. Line 459 just calculates the mean of the path length of each node (in the original code). In order to implement the harmonic mean, just substitute line 459, with the following:

tmp = g.pl();

res = mean(tmp.^(-1)).^(-1);

which is the expression for the harmonic mean.

Hope this works. If there is anything more I can help you with, please let me know.

Best,

Mite