Macaulay2 » Documentation
Packages » EdgeIdeals :: randomUniformHyperGraph
next | previous | forward | backward | up | index | toc

# randomUniformHyperGraph -- returns a random uniform hypergraph

- Usage:
    `H = randomUniformHyperGraph(R,c,d)`
- Inputs:
  - R, a polynomial ring, which gives the vertex set of H
  - c, an integer, the cardinality of the edge sets
  - d, an integer, the number of edges in H
- Outputs:
  - H, a hypergraph, a hypergraph with d edges of cardinality c on vertex set determined by R

## Description

This function allows one to create a uniform hypergraph on an underlying vertex set with a given number of randomly chosen edges of given cardinality.

    i1 : R = QQ[x_1..x_9];

    i2 : randomUniformHyperGraph(R,3,4)

    o2 = HyperGraph{"edges" => {{x , x , x }, {x , x , x }, {x , x , x }, {x , x , x }}}
                                  5   6   9     2   6   8     4   7   8     3   5   7
                    "ring" => R
                    "vertices" => {x , x , x , x , x , x , x , x , x }
                                    1   2   3   4   5   6   7   8   9

    o2 : HyperGraph

    i3 : randomUniformHyperGraph(R,4,2)

    o3 = HyperGraph{"edges" => {{x , x , x , x }, {x , x , x , x }}   }
                                  2   3   4   9     2   3   4   8
                    "ring" => R
                    "vertices" => {x , x , x , x , x , x , x , x , x }
                                    1   2   3   4   5   6   7   8   9

    o3 : HyperGraph

## See also

- randomGraph -- returns a random graph
- randomHyperGraph -- returns a random hypergraph
- Constructor Overview -- a summary of the many ways of making graphs and hypergraphs

## Ways to use randomUniformHyperGraph:

- `randomUniformHyperGraph(PolynomialRing,ZZ,ZZ)`

## For the programmer

The object randomUniformHyperGraph is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/EdgeIdeals.m2:3924:0.