Community calculation module¶
This module allows the creating networks of communities and the interactions of each community with users from another community
- communities_utils.connections(g, node, list_communities, own_community)[source]¶
Given a graph a node, a list of communities and the community to which that node belongs it creates the connections of each community with each other.
- Parameters
g – The general graph.
node – The node that is being analysed.
list_communities – A list of lists with each individual list containing the users that belong to that community.
own_community – The number of the community to which the node belongs
- Returns
The edges among the communities.
- communities_utils.get_communities_representative_graph(g, l_communities)[source]¶
Given a general graph and a list of communities, it creates a graph where each node is each communitie.
- Parameters
g – The general graph.
l_communities – A list of lists with each individual list containing the users that belong to that community.
- Returns
A graph where each node is a community.