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

randomGraph -- returns a random graph

Description

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

i1 : R = QQ[x_1..x_9];
i2 : randomGraph(R,4)

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

o2 : Graph
i3 : randomGraph(R,4)

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

o3 : Graph

See also

Ways to use randomGraph:

  • randomGraph(PolynomialRing,ZZ)

For the programmer

The object randomGraph is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/EdgeIdeals.m2:3841:0.