next | previous | forward | backward | up | top | index | toc | Macaulay2 website
EdgeIdeals :: randomGraph

randomGraph -- returns a random graph

Synopsis

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 }}}
                       3   4     1   4     6   7     1   9
           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 }}}
                       4   9     5   6     5   7     4   5
           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 :

For the programmer

The object randomGraph is a method function.