@nodes_or_number(0)
def path_graph(n, create_using=None):
 (n_name, nodes) = n
 G = empty_graph(nodes, create_using)
 G.name = ('path_graph(%s)' % (n_name,))
 G.add_edges_from(nx.utils.pairwise(nodes))
 return G

@ nodes_or_number ( 0 ) def path_graph ( n , create_using = None ) : ( n_name , nodes ) = n G = empty_graph ( nodes , create_using ) G . name = ( 'path_graph(%s)' % ( n_name , ) ) G . add_edges_from ( nx . utils . pairwise ( nodes ) ) return G
return the path graph p_n of linearly connected nodes .