ash_model.multiego.get_fractured_multiego

ash_model.multiego.get_fractured_multiego(h, U, start=None, end=None, alpha=0.5)[source]

Extract the Fractured Multi-Ego Network for a set of ego nodes U within a time window.

A Fractured Multi-Ego Network contains all hyperedges where at least alpha*|U| nodes from the ego set U are present.

Parameters:
  • h (ASH) – an ASH instance

  • U (Set[int]) – set of ego nodes (root nodes)

  • start (int | None) – start time of the query window (optional). If None, considers all time periods.

  • end (int | None) – end time of the query window (inclusive, optional). If None, only start time is considered (if start is provided), otherwise all time periods.

  • alpha (float) – fraction threshold (0 < alpha <= 1). A hyperedge is included if it contains at least alpha*|U| nodes from U.

Returns:

list of hyperedges (as sets of node IDs) forming the Fractured Multi-Ego Network

Return type:

List[Set[int]]

Examples

>>> h = ASH()
>>> # ... add hyperedges ...
>>> U = {1, 2, 3, 4}  # Four ego nodes
>>> # Include hyperedges with at least 50% of U (2 nodes)
>>> multiego = get_fractured_multiego(h, U, alpha=0.5)  # All time periods
>>> multiego = get_fractured_multiego(h, U, start=0, alpha=0.5)
>>> multiego = get_fractured_multiego(h, U, start=0, end=5, alpha=0.75)