maxnodf: an R package for fair and fast comparisons of nestedness between networks
Nestedness is a widespread pattern in mutualistic networks that has high ecological and evolutionary importance due to its role in enhancing species persistence and community stability. Nestedness measures tend to be correlated with fundamental properties of networks, such as size and connectance, and so nestedness values must be normalised to enable fair comparisons between different ecological communities. Current approaches, such as using null-corrected nestedness values and z-scores, suffer
... from extensive statistical issues. Thus a new approach called NODF_c was recently proposed, where nestedness is expressed relative to network size, connectance and the maximum nestedness that could be achieved in a particular network. While this approach is demonstrably effective in overcoming the issues of collinearity with basic network properties, it is computationally intensive to calculate, and current approaches are too slow to be practical for many types of analysis, or for analysing large networks. We developed three highly-optimised algorithms, based on greedy, hillclimbing and simulated annealing approaches, for calculation of NODF_c, spread along a speed-quality continuum. Users thus have the choice between a fast algorithm with a less accurate estimate, a slower algorithm with a more accurate estimate, and an intermediate option. We outline the package, and its implementation, as well as provide comparative performance benchmarking and two example analyses. We show that maxnodf enables speed increases of hundreds of times faster than existing approaches, with large networks seeing the biggest improvements. For example, for a large network with 3000 links, computation time was reduced from 50 minutes using the fastest existing algorithm to 11 seconds using maxnodf. maxnodf makes correctly-normalised nestedness measures feasible for complex analyses of even large networks. Analyses that would previously take weeks to complete can now be finished in hours or even seconds. Given evidence that correctly normalising nestedness values can significantly change the conclusions of ecological studies, we believe this package will usher in necessary widespread use of appropriate comparative nestedness statistics.