Skip to contents

This function shuffles a directed network while preserving in-degree and out-degree. It follows a controlled randomization process by swapping edges iteratively. Similar to the curve_ball() function but more computationally demanding. This function is useful for generating increasingly randomized networks, to generate fully randomized networks, the curbe_ball() function is preferred.

Usage

shuffle_network_deg(input_graph, delta = 100, directed = TRUE, weighted = TRUE)

Arguments

delta

Number of edge swaps to perform.

A

A square adjacency matrix (directed, weighted or unweighted).

max_attempts

Number of times to attempt a valid swap before stopping.

Value

A shuffled adjacency matrix preserving in-degree and out-degree.

References

Huaylla, C. A., Nacif, M. E., Coulin, C., Kuperman, M. N., & Garibaldi, L. A. (2021). Decoding information in multilayer ecological networks: The keystone species case. Ecological Modelling, 460, 109734. https://doi.org/10.1016/j.ecolmodel.2021.109734

Strona, G., Nappo, D., Boccacci, F., Fattorini, S., & San-Miguel-Ayanz, J. (2014). A fast and unbiased procedure to randomize ecological binary matrices with fixed row and column totals. Nature Communications, 5, 4114. https://doi.org/10.1038/ncomms5114