rustworkx.generators.directed_empty_graph#

directed_empty_graph(n, multigraph=True)#

Generate a directed empty graph with n nodes and no edges.

Parameters:

n (int) – The number of nodes to generate the graph with.

Returns:

The generated empty graph

Return type:

PyDiGraph

import rustworkx.generators
from rustworkx.visualization import mpl_draw

graph = rustworkx.generators.directed_empty_graph(5)
mpl_draw(graph)
../_images/rustworkx.generators.directed_empty_graph_0_0.png