def rand_permute_adj_matrix(matrix):
    'Randomly permute the order of vertices in the adjacency matrix, while maintaining the connectivity\n    between them.'
    num_vertices = matrix.shape[0]
    rand_order = np.arange(num_vertices)
    np.random.shuffle(rand_order)
    matrix_permuted = rearrange_adj_matrix(matrix, rand_order)
    return matrix_permuted
Randomly permute the order of vertices in the adjacency matrix, while maintaining the connectivity
between them.
def rand_permute_adj_matrix(matrix):
    'Randomly permute the order of vertices in the adjacency matrix, while maintaining the connectivity\n    between them.'
    num_vertices = matrix.shape[0]
    rand_order = np.arange(num_vertices)
    np.random.shuffle(rand_order)
    matrix_permuted = rearrange_adj_matrix(matrix, rand_order)
    return matrix_permuted