xgi.generators.simple
Generators for some simple hypergraphs.
All the functions in this module return a Hypergraph class (i.e. a simple, undirected hypergraph).
Functions
- xgi.generators.simple.star_clique(n_star, n_clique, d_max)[source]
Generate a star-clique structure
That is a star network and a clique network, connected by one pairwise edge connecting the centre of the star to the clique. network, the each clique is promoted to a hyperedge up to order d_max.
- Parameters:
n_star (int) – Number of legs of the star
n_clique (int) – Number of nodes in the clique
d_max (int) – Maximum order up to which to promote cliques to hyperedges
- Returns:
H
- Return type:
Examples
>>> import xgi >>> H = xgi.star_clique(6, 7, 2)
Notes
The total number of nodes is n_star + n_clique.
- xgi.generators.simple.sunflower(l, c, m)[source]
Create a sunflower hypergraph.
This creates an m-uniform hypergraph according to the sunflower model.
- Parameters:
l (int) – Number of petals
c (int) – Size of the core
m (int) – Size of each edge
- Raises:
XGIError – If the edge size is smaller than the core.