Skip to content

Commit

Permalink
Add docstrings to watts-strogatz hypergraph
Browse files Browse the repository at this point in the history
  • Loading branch information
nwlandry committed Nov 12, 2024
1 parent b74205a commit fe604ea
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions xgi/generators/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,38 @@ def dcsbm_hypergraph(k1, k2, g1, g2, omega, seed=None):


def watts_strogatz_hypergraph(n, d, k, l, p, seed=None):
"""Generates a Watts-Strogatz hypergraph
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
p : float
The rewiring probability
seed : int, optional
The seed for the random number generator, by default None
Returns
-------
xgi.Hypergraph
THe Watts-Strogatz hypergraph
See Also
--------
~lattice.ring_lattice
References
----------
Tanu Raghav, Stefano Boccaletti, and Sarika Jalan,
Smallworldness in hypergraphs,
https://doi.org/10.1088/2632-072X/acf430
"""
if seed is not None:
np.random.seed(seed)
H = ring_lattice(n, d, k, l)
Expand Down

0 comments on commit fe604ea

Please sign in to comment.