xgi.generators.lattice#
Generators for some lattice hypergraphs.
All the functions in this module return a Hypergraph class (i.e. a simple, undirected hypergraph).
Functions
- ring_lattice(n, d, k, l, with_positions=False)#
A ring lattice hypergraph.
A d-uniform hypergraph on n nodes where each node is part of k edges and the overlap between consecutive edges is d-l.
- Parameters:
n (int) – Number of nodes
d (int) – Edge size
k (int) – Number of edges of which a node is a part. Should be a multiple of 2.
l (int) – Overlap between edges
with_positions (bool, optional) – If True, store each node’s coordinates on a unit circle as the
"pos"node attribute. By default, False. Useful for plotting:xgi.draw(H, pos=H.nodes.pos.asdict()).
- Returns:
The generated hypergraph
- Return type:
- Raises:
ValueError – If k is negative.
Notes
ring_lattice(n, 2, k, 0) is a ring lattice graph where each node has k//2 edges on either side.