Random uniform hypergraphs

Undirected random uniform hypergraph

random_uniform_hypergraph[vert_type](size: int, edge_degree: int, edge_prob: float, random_state) undirected_hypernetwork[vert_type]
template<integer_network_vertex VertT, std::uniform_random_bit_generator Gen>
undirected_hypernetwork<VertT> random_uniform_hypergraph(VertT size, VertT edge_degree, double edge_prob, Gen &generator)

Generates a random hypergraph of size size vertices where each of the possible edges of degree edge_degree are present independently with probability edge_prob. This is the natural extension of Erdős–Rényi networks to uniform hypergraphs.

All edges will consist of exactly edge_degree vertices.

>>> import reticula as ret
>>> gen = ret.mersenne_twister(42)
>>> ret.random_uniform_hypergraph[ret.int64](
...      size=128, edge_degree=4, edge_prob=0.1, random_state=gen)
<undirected_hypernetwork[int64] with 128 verts and 1067339 edges>

Directed random uniform hypergraph

random_directed_uniform_hypergraph[vert_type](size: int, edge_in_degree: int, edge_out_degree: int, edge_prob: float, random_state) directed_hypernetwork[vert_type]
template<integer_network_vertex VertT, std::uniform_random_bit_generator Gen>
directed_hypernetwork<VertT> random_directed_uniform_hypergraph(VertT size, VertT edge_in_degree, VertT edge_out_degree, double edge_prob, Gen &generator)

Generates a random hypergraph of size size vertices where each of the possible directed edges of in-degree edge_in_degree and out-degree edge_out_degree are present independently with probability edge_prob. This is the natural extension of directed Erdős–Rényi networks to uniform directed hypergraphs.

All edges will consist of exactly edge_in_degree mutator vertices (tail of the arrow) and edge_out_degree mutated vertices (head of the arrow).

>>> import reticula as ret
>>> gen = ret.mersenne_twister(42)
>>> ret.random_directed_uniform_hypergraph[ret.int64](
...       size=128, edge_in_degree=2, edge_out_degree=2,
...       edge_prob=0.01, random_state=gen)
<directed_hypernetwork[int64] with 128 verts and 660286 edges>