NetworkX

Previous topic

networkx.generators.classic.null_graph

Next topic

networkx.generators.classic.star_graph

networkx.generators.classic.path_graph

networkx.generators.classic.path_graph(n, create_using=None)

Return the Path graph P_n of n nodes linearly connected by n-1 edges.

Node labels are the integers 0 to n - 1. If create_using is a DiGraph then the edges are directed in increasing order.