brainconn.reference.randmio_und_connected

randmio_und_connected(R, itr)[source]

This function randomizes an undirected network, while preserving the degree distribution. The function does not preserve the strength distribution in weighted networks. The function also ensures that the randomized network maintains connectedness, the ability for every node to reach every other node in the network. The input network for this function must be connected.

NOTE the changes to the BCT matlab function of the same name made in the Jan 2016 release have not been propagated to this function because of substantially decreased time efficiency in the implementation. Expect these changes to be merged eventually.

Parameters:
  • W (NxN numpy.ndarray) – undirected binary/weighted connection matrix
  • itr (int) – rewiring parameter. Each edge is rewired approximately itr times.
Returns:

  • R (NxN numpy.ndarray) – randomized network
  • eff (int) – number of actual rewirings carried out