easygraph.functions.hypergraph.centrality package

Submodules

easygraph.functions.hypergraph.centrality.cycle_ratio module

easygraph.functions.hypergraph.centrality.cycle_ratio.StatisticsAndCalculateIndicators(SmallestCyclesOfNodes, CycLenDict)[source]
easygraph.functions.hypergraph.centrality.cycle_ratio.cycle_ratio_centrality(G)[source]
Parameters

G (eg.Graph) –

Returns

cycle ratio centrality of each node in G

Return type

dict

Example

>>> G = eg.Graph()
>>> G.add_edges([(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4), (1, 5), (2, 5)])
>>> cycle_ratio_centrality(G)
{1: 4.083333333333333, 2: 4.083333333333333, 3: 2.6666666666666665, 4: 2.6666666666666665, 5: 1.5}
easygraph.functions.hypergraph.centrality.cycle_ratio.getSmallestCycles(G, NodeGirth, Coreness, DEF_IMPOSSLEN)[source]
easygraph.functions.hypergraph.centrality.cycle_ratio.getandJudgeSimpleCircle(objectList)[source]
easygraph.functions.hypergraph.centrality.cycle_ratio.my_all_shortest_paths(G, source, target)[source]

easygraph.functions.hypergraph.centrality.degree module

easygraph.functions.hypergraph.centrality.degree.hyepergraph_degree_centrality(G)[source]
Parameters

G (eg.Hypergraph) – The target hypergraph

Returns

degree centrality of each node in G

Return type

dict

easygraph.functions.hypergraph.centrality.hypercoreness module

easygraph.functions.hypergraph.centrality.hypercoreness.frequency_based_hypercoreness(h)[source]

The frequency-based hypercoreness of nodes in hypergraph.

h : easygraph.Hypergraph

Returns

dict

Return type

Centrality, where keys are node IDs and values are lists of centralities.

References

Mancastroppa, M., Iacopini, I., Petri, G. et al. Hyper-cores promote localization and efficient seeding in higher-order processes. Nat Commun 14, 6223 (2023). https://doi.org/10.1038/s41467-023-41887-2

easygraph.functions.hypergraph.centrality.hypercoreness.size_independent_hypercoreness(h)[source]

The size_independent_hypercoreness of nodes in hypergraph.

Parameters

h (eg.Hypergraph.) –

Returns

Centrality, where keys are node IDs and values are lists of centralities.

Return type

dict

References

Mancastroppa, M., Iacopini, I., Petri, G. et al. Hyper-cores promote localization and efficient seeding in higher-order processes. Nat Commun 14, 6223 (2023). https://doi.org/10.1038/s41467-023-41887-2.

easygraph.functions.hypergraph.centrality.s_centrality module

easygraph.functions.hypergraph.centrality.s_centrality.s_betweenness(H, s=1, n_workers=None)[source]

Computes the betweenness centrality for each edge in the hypergraph.

Computes the betweenness centrality for each edge in the hypergraph.

Parameters
  • H (eg.Hypergraph.) – The hypergraph to compute

  • s (int, optional.) –

Returns

  • dict

  • The keys are the edges and the values are the betweenness centrality.

  • The betweenness centrality for each edge in the hypergraph.

easygraph.functions.hypergraph.centrality.s_centrality.s_closeness(H, s=1, n_workers=None)[source]

Compute the closeness centrality for each edge in the hypergraph.

Parameters
  • H (eg.Hypergraph.) –

  • s (int, optional) –

Return type

dict. The closeness centrality for each edge in the hypergraph. The keys are the edges and the values are the closeness centrality.

easygraph.functions.hypergraph.centrality.s_centrality.s_eccentricity(H, s=1, edges=True, source=None)[source]

The length of the longest shortest path from a vertex $u$ to every other vertex in the s-linegraph. $V$ = set of vertices in the s-linegraph $d$ = shortest path distance

\[\text{s-ecc}(u) = \text{max}\{d(u,v): v \in V\}\]
Parameters
  • H (eg.Hypergraph) –

  • s (int, optional) –

  • edges (bool, optional) – Indicates if method should compute edge linegraph (default) or node linegraph.

  • source (str, optional) – Identifier of node or edge of interest for computing centrality

Returns

returns the s-eccentricity value of the edges(nodes). If source=None a dictionary of values for each s-edge in H is returned. If source then a single value is returned. If the s-linegraph is disconnected, np.inf is returned.

Return type

dict or float

easygraph.functions.hypergraph.centrality.vector_centrality module

easygraph.functions.hypergraph.centrality.vector_centrality.vector_centrality(H)[source]

The vector centrality of nodes in the line graph of the hypergraph.

Parameters

H (eg.Hypergraph) –

Returns

Centrality, where keys are node IDs and values are lists of centralities.

Return type

dict

References

“Vector centrality in hypergraphs”, K. Kovalenko, M. Romance, E. Vasilyeva, D. Aleja, R. Criado, D. Musatov, A.M. Raigorodskii, J. Flores, I. Samoylenko, K. Alfaro-Bittner, M. Perc, S. Boccaletti, https://doi.org/10.1016/j.chaos.2022.112397

Module contents