structify_net.zoo.sort_blocks_assortative

structify_net.zoo.sort_blocks_assortative(nodes, blocks=None)

Rank model based on assortative blocks

This rank model is based on assortative blocks. The blocks are defined by the blocks argument. It can be either a list of lists, where each list is a block, or an integer, in which case the nodes are randomly assigned to blocks.

Edge pairs inside blocks are ordered before edge pairs outside blocks.

Args:

nodes (_type_): Describe nodes of the graphs, either as a networkx graph (node names and node attributes are preserved) or an integer (number of nodes) blocks (_type_, optional): Blocks definition. Can be either a list of lists, where each list is a block, or an integer, in which case the nodes are randomly assigned to the corresponding number of equal size blocks. Defaults to None.

Returns:

structify_net.Rank_model: The corresponding rank model