lifecycles.LifeCycle.group_flow

LifeCycle.group_flow(target: str, direction: str, min_branch_size: int = 1) dict

compute the flow of a group w.r.t. a given temporal direction. The flow of a group is the collection of groups that contain at least one element of the target group, Returns a dictionary keyed by group name and valued by the intersection of the target group and the group corresponding to the key.

Parameters:
  • target – the name of the group to analyze

  • direction – the temporal direction in which the group is to be analyzed

  • min_branch_size – the minimum size of the intersection between the target group and the group corresponding

Returns:

a dictionary keyed by group name and valued by the intersection of the target group and the group

Example:

>>> lc = LifeCycle()
>>> lc.add_partition([[1,2], [3,4,5]])
>>> lc.add_partition([[1,2,3], [4,5]])
>>> lc.group_flow("0_0", "+")
>>> # {'1_0': {1, 2}}