sospcat.social¶
This module defines the methods for social community detection.
Return the grouping of the provided graph object using the specified method. The grouping is returned as a list of sets each holding all members of a group.
- Parameters
a_graph (
Graph
) – The graph to partitionmethod (str (default='component_infomap')) – String specifying which method to use. If two methods should be used one after the other they should be separated by _. Default: ‘component_infomap’ which will first consider all disconnected components as groups then apply infomap on all of those groups to optionally further split.
return_form (str (default='membership')) –
Determines the format of how the social group structure should be returned. Options are:
'membership'
: A list returning for each index node the group it belongs to.'memberlists'
: Dictionary with a list of members value for each group key.
- Returns
members – Depending on what was chosen for the return_form attribute, either the membership dict, i.e. for each node (key) the group affiliation (value, or the memberlist dict, i.e. for each group (key) a list of nodes (value) is returned.
- Return type