community_graphs
This module implements various types of graphs that can be used to represent evolving communities.
- class dyn.core.community_graphs.EvolvingCommunitiesGraph(**attr)
Bases:
SizeGraph,FlowGraph,TimeGraph,CommunityGraph- add_edge(n1, n2, flow=0, **attr)
Add edge between two nodes.
- Parameters
n1 – source node
n2 – target node
flow (
float) –attr – other attributes in dict-like structure
- add_node(node, t=0, evolvingCommunity=None, nbMembers=0, **attr)
Add node to the graph.
- Parameters
node –
t (int) – snapshot of the node
evolvingCommunity –
nbMembers – size of node
attr – other attributes in a dict-like structure
- get_begin_end_snapshot(evolvingCommunity)
Return start snapshot of given evolving community
- get_node(evolvingCommunity=None, t=0)
Return node of given evolving community at given snapshot.
- Parameters
evolvingCommunity – community
t (int) – snapshot
- Returns
- predecessor(n)
Return community predecessor of node.
- Parameters
n (
Any) –- Return type
Any- Returns
predecessor if existing, else
None
- successor(n)
Return community successor of node
- Parameters
n (
Any) –- Return type
Any- Returns
successor if existing, else
None