networkqit.algorithms.community.reassign_singletons

reassign_singletons(memb)[source]

Set all the singleton communities into the same community. If membership has C communities, S of which are singletons, then this function sets the singleton communities with the label C + 1 Args:

memb (np.array): the input membership vector

Output:

an array where all the nodes with a single community are merged into one.