Macaulay2 » Documentation
Packages » Nauty :: generateRandomRegularGraphs
next | previous | forward | backward | up | index | toc

generateRandomRegularGraphs -- generates random regular graphs on a given number of vertices

Synopsis

Description

This method generates a specified number of random graphs on a given number of vertices with a given regularity. 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$.

i1 : R = QQ[a..e];
i2 : generateRandomRegularGraphs(R, 3, 2)

o2 = {Graph{"edges" => {{b, c}, {a, d}, {b, d}, {a, e}, {c, e}}},
            "ring" => R                                          
            "vertices" => {a, b, c, d, e}                        
     ------------------------------------------------------------------------
     Graph{"edges" => {{a, c}, {a, d}, {b, d}, {b, e}, {c, e}}},
           "ring" => R                                          
           "vertices" => {a, b, c, d, e}                        
     ------------------------------------------------------------------------
     Graph{"edges" => {{b, c}, {a, d}, {c, d}, {a, e}, {b, e}}}}
           "ring" => R
           "vertices" => {a, b, c, d, e}

o2 : List

Caveat

The number of vertices $n$ must be positive as nauty cannot handle graphs with zero vertices.

See also

Ways to use generateRandomRegularGraphs :

For the programmer

The object generateRandomRegularGraphs is a method function with options.