sample_k_uniform_hypergraph {HyperG} | R Documentation |
Random k-uniform and k-regular hypergraphs.
Description
Randomly generate a hypergraph in which each hyper-edge contains k vertices, or each vertex is incident to k hyper-edges.
Usage
sample_k_uniform_hypergraph(n, m, k, prob)
sample_k_regular_hypergraph(n, m, k, prob)
Arguments
n |
the order of the hypergraph. |
m |
the size of the hypergraph. |
k |
the order of each hyper-edge. |
prob |
a vector of length |
Details
A k-uniform hypergraph is one for which each hyper-edge contains exactly
k vertices. A k-regular hypergraph is one for which each vertex has degree k.
These are implemented through calls to sample
.
Value
a hypergraph.
Note
For both of these functions m
, the number of hyper-edges, must be
provided. This is unlike the corresponding functions for graphs – all
simple graphs are 2-uniform, and there are constraints on the values of k
for which a graph can be k-regular, since the graphs are constrained to be
2-regular, i.e. all rows of the incidence matrix must contain 2 ones.
Author(s)
David J. Marchette dmarchette@gmail.com.
See Also
Examples
set.seed(77)
h <- sample_k_uniform_hypergraph(20,5,3)
set.seed(73)
k <- sample_k_regular_hypergraph(20,5,3)