Note

This is the documentation for the current state of the development branch of rustworkx. The documentation or APIs here can change prior to being released.

rustworkx.generators.dorogovtsev_goltsev_mendes_graph#

dorogovtsev_goltsev_mendes_graph(n)#

Generate a Dorogovtsev-Goltsev-Mendes graph.

Generate a graph following the recursive procedure in [1] . Starting from the two-node, one-edge graph, iterating n times generates a graph with (3**n + 3) // 2 nodes and 3**n edges.

Parameters:

n (int) – The number of iterations to perform.

Returns:

The generated Dorogovtsev-Goltsev-Mendes graph

Return type:

PyGraph

import rustworkx.generators
from rustworkx.visualization import mpl_draw

graph = rustworkx.generators.dorogovtsev_goltsev_mendes_graph(2)
mpl_draw(graph)
../_images/rustworkx.generators.dorogovtsev_goltsev_mendes_graph_0_0.png