Learn R Programming

HyperG (version 1.0.0)

sample_k_uniform_hypergraph: 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 n containing the probabilities for the vertices. This is passed to sample.

Value

a hypergraph.

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.

See Also

sample.

Examples

Run this code
# NOT RUN {
set.seed(77)
h <- sample_k_uniform_hypergraph(20,5,3)
set.seed(73)
k <- sample_k_regular_hypergraph(20,5,3)
# }

Run the code above in your browser using DataLab