next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Nauty :: generateRandomGraphs

generateRandomGraphs -- generates random graphs on a given number of vertices



This method generates a specified number of random graphs with a given number of vertices. Note that some graphs may be isomorphic.

If a PolynomialRing $R$ is supplied instead, then the number of vertices is the number of generators. Moreover, the nauty-based strings are automatically converted to instances of the class Graph in $R$.

If the input $pq$ is included, then the edges are chosen to be included with probability $pq$. If the input $pz$ is included and is positive, then the edges are chosen to be included with probability $1/pz$.

i1 : generateRandomGraphs(5, 5, RandomSeed => 314159)

o1 = {DEK, DbO, D[O, DiO, DMg}

o1 : List
i2 : generateRandomGraphs(5, 5)

o2 = {D}{, Ddg, DRo, DvW, DWs}

o2 : List
i3 : generateRandomGraphs(5, 5, RandomSeed => 314159)

o3 = {DEK, DbO, D[O, DiO, DMg}

o3 : List


The number of vertices $n$ must be positive as nauty cannot handle graphs with zero vertices. Further, if the probability $pq$ is included, then it is rounded to a precision of one-hundred millionth.

See also

Ways to use generateRandomGraphs :

For the programmer

The object generateRandomGraphs is a method function with options.