Skip to main content

watts_strogatz_hypergraph

Function watts_strogatz_hypergraph 

Source
pub fn watts_strogatz_hypergraph(
    n: usize,
    d: usize,
    k: usize,
    l: usize,
    p: f64,
    seed: Option<u64>,
) -> Result<Hypergraph, GeneratorError>
Available on crate feature generators only.
Expand description

Watts–Strogatz hypergraph: a ring lattice with each edge rewired with prob p, as XGI 1.1 rewrote watts_strogatz_hypergraph(n, d, k, l, p).

Each edge of the lattice is visited in order. With probability p, its farthest node (the last one) is replaced by a node chosen uniformly among the nodes that do not share an edge with the originating node (the first member of the lattice edge) in the current, partly rewired hypergraph. The edge keeps its id and its size; it is left alone when no such node exists. The same seed gives the same hypergraph; the draws are not XGI’s.

§Errors

GeneratorError::InvalidParameter when n == 0 or d == 0.