path_graph(n, create_using=None)
If an integer, nodes are 0 to n - 1. If an iterable of nodes, in the order they appear in the path.
Graph type to create. If graph instance, then cleared before populated.
Returns the Path graph :None:None:`P_n` of linearly connected nodes.
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.dag.descendantsnetworkx.utils.rcm.cuthill_mckee_orderingnetworkx.classes.graph.Graph.updatenetworkx.algorithms.components.weakly_connected.weakly_connected_componentsnetworkx.algorithms.shortest_paths.unweighted.single_source_shortest_pathnetworkx.algorithms.shortest_paths.unweighted.single_target_shortest_pathnetworkx.readwrite.adjlist.read_adjlistnetworkx.algorithms.isomorphism.isomorphvf2.DiGraphMatcher.__init__networkx.readwrite.multiline_adjlist.write_multiline_adjlistnetworkx.drawing.layout.spiral_layoutnetworkx.algorithms.traversal.depth_first_search.dfs_edgesnetworkx.classes.graph.Graphnetworkx.algorithms.shortest_paths.weighted.single_source_dijkstra_pathnetworkx.algorithms.shortest_paths.weighted.bellman_ford_path_lengthnetworkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_pathnetworkx.algorithms.shortest_paths.weighted.single_source_bellman_fordnetworkx.classes.graph.Graph.edge_subgraphnetworkx.readwrite.graphml.write_graphml_lxmlnetworkx.classes.digraph.DiGraph.remove_edges_fromnetworkx.classes.function.induced_subgraphnetworkx.readwrite.json_graph.cytoscape.cytoscape_datanetworkx.algorithms.shortest_paths.weighted.single_source_bellman_ford_pathnetworkx.classes.reportviews.DiDegreeViewnetworkx.classes.graph.Graph.sizenetworkx.algorithms.shortest_paths.weighted.single_source_bellman_ford_path_lengthnetworkx.readwrite.gpickle.write_gpicklenetworkx.algorithms.shortest_paths.weighted.dijkstra_path_lengthnetworkx.classes.digraph.DiGraph.to_undirectednetworkx.drawing.layout.shell_layoutnetworkx.classes.graph.Graph.__len__networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstranetworkx.algorithms.components.semiconnected.is_semiconnectednetworkx.algorithms.bipartite.projection.collaboration_weighted_projected_graphnetworkx.classes.multidigraph.MultiDiGraphnetworkx.algorithms.shortest_paths.weighted.bellman_ford_pathnetworkx.readwrite.multiline_adjlist.read_multiline_adjlistnetworkx.algorithms.shortest_paths.unweighted.all_pairs_shortest_path_lengthnetworkx.algorithms.node_classification.hmn.harmonic_functionnetworkx.algorithms.bipartite.projection.overlap_weighted_projected_graphnetworkx.algorithms.assortativity.neighbor_degree.average_neighbor_degreenetworkx.algorithms.bipartite.basic.colornetworkx.algorithms.link_analysis.hits_alg.hits_numpynetworkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_path_lengthnetworkx.classes.multigraph.MultiGraphnetworkx.readwrite.gml.write_gmlnetworkx.readwrite.pajek.write_pajeknetworkx.classes.multigraph.MultiGraph.remove_edges_fromnetworkx.classes.reportviews.EdgeDataViewnetworkx.algorithms.shortest_paths.weighted.all_pairs_bellman_ford_path_lengthnetworkx.classes.digraph.DiGraphnetworkx.algorithms.bipartite.edgelist.generate_edgelistnetworkx.classes.function.edge_subgraphnetworkx.algorithms.assortativity.mixing.attribute_mixing_matrixnetworkx.algorithms.shortest_paths.weighted.goldberg_radziknetworkx.classes.reportviews.NodeViewnetworkx.classes.digraph.DiGraph.remove_nodenetworkx.relabel.relabel_nodesnetworkx.algorithms.bipartite.basic.setsnetworkx.algorithms.shortest_paths.unweighted.predecessornetworkx.classes.graph.Graph.__str__networkx.algorithms.centrality.eigenvector.eigenvector_centrality_numpynetworkx.algorithms.connectivity.edge_augmentation.partial_k_edge_augmentationnetworkx.algorithms.shortest_paths.weighted.multi_source_dijkstranetworkx.classes.graph.Graph.to_undirectednetworkx.algorithms.traversal.breadth_first_search.descendants_at_distancenetworkx.classes.graph.Graph.__contains__networkx.classes.graph.Graph.neighborsnetworkx.algorithms.traversal.depth_first_search.dfs_treenetworkx.classes.digraph.DiGraph.remove_nodes_fromnetworkx.algorithms.minors.contraction.contracted_nodesnetworkx.algorithms.bipartite.projection.projected_graphnetworkx.readwrite.gpickle.read_gpicklenetworkx.algorithms.shortest_paths.weighted.bellman_ford_predecessor_and_distancenetworkx.drawing.layout.circular_layoutnetworkx.classes.graph.Graph.has_edgenetworkx.algorithms.connectivity.edge_augmentation.k_edge_augmentationnetworkx.algorithms.isomorphism.temporalisomorphvf2.TimeRespectingDiGraphMatcher.__init__networkx.readwrite.graphml.write_graphml_xmlnetworkx.classes.graph.Graph.clearnetworkx.algorithms.traversal.depth_first_search.dfs_preorder_nodesnetworkx.algorithms.shortest_paths.weighted.all_pairs_bellman_ford_pathnetworkx.algorithms.link_analysis.pagerank_alg.pageranknetworkx.readwrite.edgelist.read_edgelistnetworkx.classes.multidigraph.MultiDiGraph.to_undirectednetworkx.algorithms.shortest_paths.weighted.dijkstra_pathnetworkx.algorithms.shortest_paths.weighted.bidirectional_dijkstranetworkx.classes.graph.Graph.subgraphnetworkx.algorithms.shortest_paths.unweighted.all_pairs_shortest_pathnetworkx.algorithms.centrality.katz.katz_centrality_numpynetworkx.readwrite.graph6.to_graph6_bytesnetworkx.classes.graph.Graph.__getitem__networkx.algorithms.connectivity.edge_augmentation.complement_edgesnetworkx.classes.graph.Graph.get_edge_datanetworkx.algorithms.centrality.katz.katz_centralitynetworkx.classes.graph.Graph.number_of_nodesnetworkx.algorithms.traversal.depth_first_search.dfs_successorsnetworkx.convert.to_dict_of_dictsnetworkx.readwrite.adjlist.write_adjlistnetworkx.classes.graph.Graph.copynetworkx.classes.multigraph.MultiGraph.copynetworkx.algorithms.shortest_paths.weighted.single_source_dijkstra_path_lengthnetworkx.drawing.layout.spring_layoutnetworkx.readwrite.graphml.generate_graphmlnetworkx.classes.function.freezenetworkx.classes.digraph.DiGraph.clear_edgesnetworkx.algorithms.bipartite.basic.is_bipartitenetworkx.readwrite.gexf.write_gexfnetworkx.algorithms.bipartite.projection.weighted_projected_graphnetworkx.algorithms.shortest_paths.weighted.multi_source_dijkstra_path_lengthnetworkx.algorithms.isomorphism.temporalisomorphvf2.TimeRespectingGraphMatcher.__init__networkx.classes.digraph.DiGraph.clearnetworkx.classes.graph.Graph.ordernetworkx.drawing.layout.kamada_kawai_layoutnetworkx.algorithms.shortest_paths.weighted.dijkstra_predecessor_and_distancenetworkx.algorithms.assortativity.correlation.degree_assortativity_coefficientnetworkx.classes.reportviews.EdgeViewnetworkx.algorithms.shortest_paths.weighted.single_source_dijkstranetworkx.readwrite.sparse6.to_sparse6_bytesnetworkx.readwrite.graphml.parse_graphmlnetworkx.readwrite.pajek.read_pajeknetworkx.algorithms.link_prediction.cn_soundarajan_hopcroftnetworkx.algorithms.chordal.find_induced_nodesnetworkx.algorithms.components.connected.is_connectednetworkx.algorithms.node_classification.lgc.local_and_global_consistencynetworkx.classes.reportviews.DegreeViewnetworkx.utils.rcm.reverse_cuthill_mckee_orderingnetworkx.algorithms.mis.maximal_independent_setnetworkx.algorithms.traversal.breadth_first_search.bfs_successorsnetworkx.classes.graph.Graph.remove_nodenetworkx.algorithms.shortest_paths.generic.average_shortest_path_lengthnetworkx.algorithms.isomorphism.isomorphvf2.GraphMatcher.__init__networkx.algorithms.traversal.breadth_first_search.bfs_treenetworkx.algorithms.components.biconnected.is_biconnectednetworkx.algorithms.connectivity.edge_augmentation.weighted_bridge_augmentationnetworkx.classes.graph.Graph.remove_nodes_fromnetworkx.algorithms.bipartite.basic.is_bipartite_node_setnetworkx.algorithms.shortest_paths.unweighted.single_source_shortest_path_lengthnetworkx.readwrite.gml.read_gmlnetworkx.classes.graphviews.subgraph_viewnetworkx.classes.graph.Graph.adjacencynetworkx.algorithms.link_analysis.pagerank_alg.pagerank_numpynetworkx.algorithms.connectivity.edge_augmentation.unconstrained_bridge_augmentationnetworkx.algorithms.traversal.breadth_first_search.generic_bfs_edgesnetworkx.algorithms.shortest_paths.unweighted.single_target_shortest_path_lengthnetworkx.classes.function.restricted_viewnetworkx.algorithms.link_analysis.hits_alg.hitsnetworkx.algorithms.assortativity.connectivity.average_degree_connectivitynetworkx.algorithms.dag.ancestorsnetworkx.algorithms.shortest_paths.generic.shortest_pathnetworkx.algorithms.centrality.eigenvector.eigenvector_centralitynetworkx.algorithms.shortest_paths.astar.astar_pathnetworkx.algorithms.components.connected.connected_componentsnetworkx.classes.graph.Graph.__iter__networkx.algorithms.traversal.depth_first_search.dfs_predecessorsnetworkx.classes.graph.Graph.has_nodenetworkx.algorithms.traversal.breadth_first_search.bfs_predecessorsnetworkx.algorithms.link_analysis.pagerank_alg.pagerank_scipynetworkx.algorithms.bipartite.edgelist.read_edgelistnetworkx.drawing.layout.spectral_layoutnetworkx.classes.graph.Graph.number_of_edgesnetworkx.readwrite.edgelist.write_edgelistnetworkx.classes.graph.Graph.clear_edgesnetworkx.algorithms.assortativity.correlation.degree_pearson_correlation_coefficientnetworkx.algorithms.traversal.depth_first_search.dfs_postorder_nodesnetworkx.algorithms.bipartite.cluster.latapy_clusteringnetworkx.algorithms.link_analysis.hits_alg.hits_scipynetworkx.drawing.layout.planar_layoutnetworkx.algorithms.bipartite.spectral.spectral_bipartivitynetworkx.algorithms.shortest_paths.weighted.multi_source_dijkstra_pathnetworkx.classes.graph.Graph.remove_edgenetworkx.algorithms.bipartite.edgelist.write_edgelistnetworkx.classes.graph.Graph.remove_edges_fromnetworkx.classes.function.is_weightednetworkx.readwrite.gexf.generate_gexfnetworkx.algorithms.shortest_paths.generic.shortest_path_lengthHover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them