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.

# Generators#

 Generate an undirected cycle graph Generate a directed cycle graph rustworkx.generators.path_graph([num_nodes, ...]) Generate an undirected path graph Generate a directed path graph rustworkx.generators.star_graph([num_nodes, ...]) Generate an undirected star graph Generate a directed star graph rustworkx.generators.mesh_graph([num_nodes, ...]) Generate an undirected mesh (complete) graph where every node is connected to every other Generate a directed mesh (complete) graph where every node is connected to every other rustworkx.generators.grid_graph([rows, ...]) Generate an undirected grid graph. Generate a directed grid graph. Generate an undirected binomial tree of order n recursively. Generate a directed binomial tree of order n recursively. Generate an undirected hexagonal lattice graph. Generate a directed hexagonal lattice graph. Generate an undirected heavy square graph. Generate an directed heavy square graph. rustworkx.generators.heavy_hex_graph(d, /[, ...]) Generate an undirected heavy hex graph. Generate a directed heavy hex graph. Generate an undirected lollipop graph where a mesh (complete) graph is connected to a path. Generate a generalized Petersen graph $$G(n, k)$$ with $$2n$$ nodes and $$3n$$ edges. Generate an undirected barbell graph where two identical complete graphs are connected by a path. rustworkx.generators.full_rary_tree(...[, ...]) Creates a full r-ary tree of n nodes. rustworkx.generators.empty_graph(n[, multigraph]) Generate an undirected empty graph with n nodes and no edges. Generate a directed empty graph with n nodes and no edges. Generate an undirected complete graph with n nodes. Generate a directed complete graph with n nodes.