ash_model.multiego.get_multiego¶
- ash_model.multiego.get_multiego(h, U, start=None, end=None)[source]¶
Extract the Multi-Ego Network for a set of ego nodes U within a time window.
A Multi-Ego Network contains all hyperedges that include at least one node from the ego set U. This generalizes the single-node ego network (ASH.star()) to multiple root nodes.
- Parameters:
- Returns:
list of hyperedges (as sets of node IDs) forming the Multi-Ego Network
- Return type:
Examples
>>> h = ASH() >>> # ... add hyperedges ... >>> U = {1, 2} # Two ego nodes >>> multiego = get_multiego(h, U) # All time periods >>> multiego = get_multiego(h, U, start=0) # Single snapshot >>> multiego = get_multiego(h, U, start=0, end=5) # Time window [0,5] >>> print(f"Multi-Ego Network contains {len(multiego)} hyperedges")