Source code for easygraph.functions.hypergraph.centrality.degree
__all__=["hyepergraph_degree_centrality"]
[docs]defhyepergraph_degree_centrality(G):""" Parameters ---------- G : eg.Hypergraph The target hypergraph Returns ---------- degree centrality of each node in G : dict """res={}node_list=G.v# Get hyperedge listedge_list=G.e[0]fornodeinnode_list:res[node]=0foreinedge_list:fornine:res[n]+=1returnres