networkqit.algorithms.community.reindex_membership

reindex_membership(memb, key='community_size', compress_singletons=False, adj=None)[source]

This function has the membership as input and output the membership where the communities number are ordered by the number of nodes in that community

Args:

memb (list): a list of nodes membership key (str): by default it sorts the community indices by decreasing number of nodes in each community.

other arguments are ‘community_weight’ (sum of all internal community weights) or ‘community_normalized_weight’ (internal weight normalized by internal pairs). Important

compress_singletons (bool): if set to True assign all singleton communities into a single community. adj (np.array): the adjacency matrix where to read the