Graph generators


balanced_tree(r, h[, create_using])

Returns the perfectly balanced r-ary tree of height h.

barbell_graph(m1, m2[, create_using])

Returns the Barbell Graph: two complete graphs connected by a path.


Returns the Binomial Tree of order n.

complete_graph(n[, create_using])

Return the complete graph K_n with n nodes.


Returns the complete multipartite graph with the specified subset sizes.

circular_ladder_graph(n[, create_using])

Returns the circular ladder graph $CL_n$ of length n.

circulant_graph(n, offsets[, create_using])

Generates the circulant graph $Ci_n(x_1, x_2, …, x_m)$ with $n$ vertices.

cycle_graph(n[, create_using])

Returns the cycle graph $C_n$ of cyclically connected nodes.

dorogovtsev_goltsev_mendes_graph(n[, …])

Returns the hierarchically constructed Dorogovtsev-Goltsev-Mendes graph.

empty_graph([n, create_using, default])

Returns the empty graph with n nodes and zero edges.

full_rary_tree(r, n[, create_using])

Creates a full r-ary tree of n vertices.

ladder_graph(n[, create_using])

Returns the Ladder graph of length n.

lollipop_graph(m, n[, create_using])

Returns the Lollipop Graph; K_m connected to P_n.


Returns the Null graph with no nodes or edges.

path_graph(n[, create_using])

Returns the Path graph P_n of linearly connected nodes.

star_graph(n[, create_using])

Return the star graph


Return the Trivial graph with one node (with label 0) and no edges.

turan_graph(n, r)

Return the Turan Graph

wheel_graph(n[, create_using])

Return the wheel graph

Social Networks


Returns Zachary’s Karate Club graph.


Returns Davis Southern women social network.


Returns Florentine families graph.


Returns coappearance network of characters in the novel Les Miserables.