Clique eigenvector centrality#

Compute and visualize the clique eigenvector centrality.

plot clique centrality
import matplotlib.pyplot as plt

import xgi

# generate hypergraph
n = 20
ps = [0.15, 0.01]
H = xgi.fast_random_hypergraph(n, ps, seed=20)

# visualize hypergraph and centrality
pos = xgi.barycenter_spring_layout(H, seed=1)
ax, collections = xgi.draw(H, pos=pos, node_fc=H.nodes.clique_eigenvector_centrality)

node_col, _, edge_col = collections
plt.colorbar(node_col, label="Clique eigenvector centrality")

plt.show()

Total running time of the script: (0 minutes 0.050 seconds)

Gallery generated by Sphinx-Gallery