networkx 2.8.2 Pypi GitHub Homepage
Other Docs
ParametersBackRef
path_graph(n, create_using=None)

Parameters

n : int or iterable

If an integer, nodes are 0 to n - 1. If an iterable of nodes, in the order they appear in the path.

create_using : NetworkX graph constructor, optional (default=nx.Graph)

Graph type to create. If graph instance, then cleared before populated.

Returns the Path graph :None:None:`P_n` of linearly connected nodes.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx

175 Elements
networkx.algorithms.dag.descendants
networkx.utils.rcm.cuthill_mckee_ordering
networkx.classes.graph.Graph.update
networkx.algorithms.components.weakly_connected.weakly_connected_components
networkx.algorithms.shortest_paths.unweighted.single_source_shortest_path
networkx.algorithms.shortest_paths.unweighted.single_target_shortest_path
networkx.readwrite.adjlist.read_adjlist
networkx.algorithms.isomorphism.isomorphvf2.DiGraphMatcher.__init__
networkx.readwrite.multiline_adjlist.write_multiline_adjlist
networkx.drawing.layout.spiral_layout
networkx.algorithms.traversal.depth_first_search.dfs_edges
networkx.classes.graph.Graph
networkx.algorithms.shortest_paths.weighted.single_source_dijkstra_path
networkx.algorithms.shortest_paths.weighted.bellman_ford_path_length
networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_path
networkx.algorithms.shortest_paths.weighted.single_source_bellman_ford
networkx.classes.graph.Graph.edge_subgraph
networkx.readwrite.graphml.write_graphml_lxml
networkx.classes.digraph.DiGraph.remove_edges_from
networkx.classes.function.induced_subgraph
networkx.readwrite.json_graph.cytoscape.cytoscape_data
networkx.algorithms.shortest_paths.weighted.single_source_bellman_ford_path
networkx.classes.reportviews.DiDegreeView
networkx.classes.graph.Graph.size
networkx.algorithms.shortest_paths.weighted.single_source_bellman_ford_path_length
networkx.readwrite.gpickle.write_gpickle
networkx.algorithms.shortest_paths.weighted.dijkstra_path_length
networkx.classes.digraph.DiGraph.to_undirected
networkx.drawing.layout.shell_layout
networkx.classes.graph.Graph.__len__
networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra
networkx.algorithms.components.semiconnected.is_semiconnected
networkx.algorithms.bipartite.projection.collaboration_weighted_projected_graph
networkx.classes.multidigraph.MultiDiGraph
networkx.algorithms.shortest_paths.weighted.bellman_ford_path
networkx.readwrite.multiline_adjlist.read_multiline_adjlist
networkx.algorithms.shortest_paths.unweighted.all_pairs_shortest_path_length
networkx.algorithms.node_classification.hmn.harmonic_function
networkx.algorithms.bipartite.projection.overlap_weighted_projected_graph
networkx.algorithms.assortativity.neighbor_degree.average_neighbor_degree
networkx.algorithms.bipartite.basic.color
networkx.algorithms.link_analysis.hits_alg.hits_numpy
networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_path_length
networkx.classes.multigraph.MultiGraph
networkx.readwrite.gml.write_gml
networkx.readwrite.pajek.write_pajek
networkx.classes.multigraph.MultiGraph.remove_edges_from
networkx.classes.reportviews.EdgeDataView
networkx.algorithms.shortest_paths.weighted.all_pairs_bellman_ford_path_length
networkx.classes.digraph.DiGraph
networkx.algorithms.bipartite.edgelist.generate_edgelist
networkx.classes.function.edge_subgraph
networkx.algorithms.assortativity.mixing.attribute_mixing_matrix
networkx.algorithms.shortest_paths.weighted.goldberg_radzik
networkx.classes.reportviews.NodeView
networkx.classes.digraph.DiGraph.remove_node
networkx.relabel.relabel_nodes
networkx.algorithms.bipartite.basic.sets
networkx.algorithms.shortest_paths.unweighted.predecessor
networkx.classes.graph.Graph.__str__
networkx.algorithms.centrality.eigenvector.eigenvector_centrality_numpy
networkx.algorithms.connectivity.edge_augmentation.partial_k_edge_augmentation
networkx.algorithms.shortest_paths.weighted.multi_source_dijkstra
networkx.classes.graph.Graph.to_undirected
networkx.algorithms.traversal.breadth_first_search.descendants_at_distance
networkx.classes.graph.Graph.__contains__
networkx.classes.graph.Graph.neighbors
networkx.algorithms.traversal.depth_first_search.dfs_tree
networkx.classes.digraph.DiGraph.remove_nodes_from
networkx.algorithms.minors.contraction.contracted_nodes
networkx.algorithms.bipartite.projection.projected_graph
networkx.readwrite.gpickle.read_gpickle
networkx.algorithms.shortest_paths.weighted.bellman_ford_predecessor_and_distance
networkx.drawing.layout.circular_layout
networkx.classes.graph.Graph.has_edge
networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation
networkx.algorithms.isomorphism.temporalisomorphvf2.TimeRespectingDiGraphMatcher.__init__
networkx.readwrite.graphml.write_graphml_xml
networkx.classes.graph.Graph.clear
networkx.algorithms.traversal.depth_first_search.dfs_preorder_nodes
networkx.algorithms.shortest_paths.weighted.all_pairs_bellman_ford_path
networkx.algorithms.link_analysis.pagerank_alg.pagerank
networkx.readwrite.edgelist.read_edgelist
networkx.classes.multidigraph.MultiDiGraph.to_undirected
networkx.algorithms.shortest_paths.weighted.dijkstra_path
networkx.algorithms.shortest_paths.weighted.bidirectional_dijkstra
networkx.classes.graph.Graph.subgraph
networkx.algorithms.shortest_paths.unweighted.all_pairs_shortest_path
networkx.algorithms.centrality.katz.katz_centrality_numpy
networkx.readwrite.graph6.to_graph6_bytes
networkx.classes.graph.Graph.__getitem__
networkx.algorithms.connectivity.edge_augmentation.complement_edges
networkx.classes.graph.Graph.get_edge_data
networkx.algorithms.centrality.katz.katz_centrality
networkx.classes.graph.Graph.number_of_nodes
networkx.algorithms.traversal.depth_first_search.dfs_successors
networkx.convert.to_dict_of_dicts
networkx.readwrite.adjlist.write_adjlist
networkx.classes.graph.Graph.copy
networkx.classes.multigraph.MultiGraph.copy
networkx.algorithms.shortest_paths.weighted.single_source_dijkstra_path_length
networkx.drawing.layout.spring_layout
networkx.readwrite.graphml.generate_graphml
networkx.classes.function.freeze
networkx.classes.digraph.DiGraph.clear_edges
networkx.algorithms.bipartite.basic.is_bipartite
networkx.readwrite.gexf.write_gexf
networkx.algorithms.bipartite.projection.weighted_projected_graph
networkx.algorithms.shortest_paths.weighted.multi_source_dijkstra_path_length
networkx.algorithms.isomorphism.temporalisomorphvf2.TimeRespectingGraphMatcher.__init__
networkx.classes.digraph.DiGraph.clear
networkx.classes.graph.Graph.order
networkx.drawing.layout.kamada_kawai_layout
networkx.algorithms.shortest_paths.weighted.dijkstra_predecessor_and_distance
networkx.algorithms.assortativity.correlation.degree_assortativity_coefficient
networkx.classes.reportviews.EdgeView
networkx.algorithms.shortest_paths.weighted.single_source_dijkstra
networkx.readwrite.sparse6.to_sparse6_bytes
networkx.readwrite.graphml.parse_graphml
networkx.readwrite.pajek.read_pajek
networkx.algorithms.link_prediction.cn_soundarajan_hopcroft
networkx.algorithms.chordal.find_induced_nodes
networkx.algorithms.components.connected.is_connected
networkx.algorithms.node_classification.lgc.local_and_global_consistency
networkx.classes.reportviews.DegreeView
networkx.utils.rcm.reverse_cuthill_mckee_ordering
networkx.algorithms.mis.maximal_independent_set
networkx.algorithms.traversal.breadth_first_search.bfs_successors
networkx.classes.graph.Graph.remove_node
networkx.algorithms.shortest_paths.generic.average_shortest_path_length
networkx.algorithms.isomorphism.isomorphvf2.GraphMatcher.__init__
networkx.algorithms.traversal.breadth_first_search.bfs_tree
networkx.algorithms.components.biconnected.is_biconnected
networkx.algorithms.connectivity.edge_augmentation.weighted_bridge_augmentation
networkx.classes.graph.Graph.remove_nodes_from
networkx.algorithms.bipartite.basic.is_bipartite_node_set
networkx.algorithms.shortest_paths.unweighted.single_source_shortest_path_length
networkx.readwrite.gml.read_gml
networkx.classes.graphviews.subgraph_view
networkx.classes.graph.Graph.adjacency
networkx.algorithms.link_analysis.pagerank_alg.pagerank_numpy
networkx.algorithms.connectivity.edge_augmentation.unconstrained_bridge_augmentation
networkx.algorithms.traversal.breadth_first_search.generic_bfs_edges
networkx.algorithms.shortest_paths.unweighted.single_target_shortest_path_length
networkx.classes.function.restricted_view
networkx.algorithms.link_analysis.hits_alg.hits
networkx.algorithms.assortativity.connectivity.average_degree_connectivity
networkx.algorithms.dag.ancestors
networkx.algorithms.shortest_paths.generic.shortest_path
networkx.algorithms.centrality.eigenvector.eigenvector_centrality
networkx.algorithms.shortest_paths.astar.astar_path
networkx.algorithms.components.connected.connected_components
networkx.classes.graph.Graph.__iter__
networkx.algorithms.traversal.depth_first_search.dfs_predecessors
networkx.classes.graph.Graph.has_node
networkx.algorithms.traversal.breadth_first_search.bfs_predecessors
networkx.algorithms.link_analysis.pagerank_alg.pagerank_scipy
networkx.algorithms.bipartite.edgelist.read_edgelist
networkx.drawing.layout.spectral_layout
networkx.classes.graph.Graph.number_of_edges
networkx.readwrite.edgelist.write_edgelist
networkx.classes.graph.Graph.clear_edges
networkx.algorithms.assortativity.correlation.degree_pearson_correlation_coefficient
networkx.algorithms.traversal.depth_first_search.dfs_postorder_nodes
networkx.algorithms.bipartite.cluster.latapy_clustering
networkx.algorithms.link_analysis.hits_alg.hits_scipy
networkx.drawing.layout.planar_layout
networkx.algorithms.bipartite.spectral.spectral_bipartivity
networkx.algorithms.shortest_paths.weighted.multi_source_dijkstra_path
networkx.classes.graph.Graph.remove_edge
networkx.algorithms.bipartite.edgelist.write_edgelist
networkx.classes.graph.Graph.remove_edges_from
networkx.classes.function.is_weighted
networkx.readwrite.gexf.generate_gexf
networkx.algorithms.shortest_paths.generic.shortest_path_length

Local connectivity graph

Hover 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


GitHub : /networkx/generators/classic.py#581
type: <class 'function'>
Commit: