ash_model.multiego.get_core_multiego¶
- ash_model.multiego.get_core_multiego(h, U, start=None, end=None, beta=0.5)[source]¶
Extract the Core Multi-Ego Network for a set of ego nodes U within a time window.
A Core Multi-Ego Network contains all hyperedges where the nodes from U represent at least beta fraction of the hyperedge size.
- Parameters:
h (ASH) – an ASH instance
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.
beta (float) – fraction threshold (0 < beta <= 1). A hyperedge is included if nodes from U represent at least beta*|hyperedge| of its nodes.
- Returns:
list of hyperedges (as sets of node IDs) forming the Core Multi-Ego Network
- Return type:
Examples
>>> h = ASH() >>> # ... add hyperedges ... >>> U = {1, 2, 3} # Three ego nodes >>> # Include hyperedges where U nodes are at least 60% of the hyperedge >>> multiego = get_core_multiego(h, U, beta=0.6) # All time periods >>> multiego = get_core_multiego(h, U, start=0, beta=0.6) >>> multiego = get_core_multiego(h, U, start=0, end=5, beta=0.5)