NetworkX

Previous topic

null_graph

Next topic

star_graph

path_graph

path_graph(n, create_using=None)[source]

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.