absorbing_centrality.greedy_team¶
-
greedy_team
(G, k, query=None, candidates=None, fast_select=False, return_times=False, with_restarts=False, alpha=0.85)[source]¶ Selects a team of nodes according to the greedy algorithm.
Parameters: - G (Networkx graph) – The graph from which the team will be selected.
- k (int) – The size of the team.
- query (list, optional) – If provided, the distance is measured with respect to the nodes in query.
- candidates (list, optional) – If provided, the team is picked only among the nodes in candidates.
- fast_select (bool, optional) – If True, the greedy algorithm will only consider candidates in a smart way, by examining their gain at each round (default is False).
- with_restarts (bool, optional) – If True, the greedy algorithm is based on the transition matrix w/ restarts to the supernode (default is False).
- alpha (float, optional) – If the transition matrix has restarts, alpha is the probability for the random surfer to continue (default is 0.85).
Returns: - scores (list) – The scores of all the greedy teams of size up to k.
- teams (list) – The list of greedy times of size up to k.
- times (list) – The time to compute each team. Returned only if return_times is True.