networkx 2.8.2 Pypi GitHub Homepage
Other Docs
ParametersBackRef

A Graph stores nodes and edges with optional data, or attributes.

Graphs hold undirected edges. Self loops are allowed but multiple (parallel) edges are not.

Nodes can be arbitrary (hashable) Python objects with optional key/value attributes, except that :None:None:`None` is not allowed as a node.

Edges are represented as links between nodes with optional key/value attributes.

Parameters

incoming_graph_data : input graph (optional, default: None)

Data to initialize graph. If None (default) an empty graph is created. The data can be any format that is supported by the to_networkx_graph() function, currently including edge list, dict of dicts, dict of lists, NetworkX graph, 2D NumPy array, SciPy sparse matrix, or PyGraphviz graph.

attr : keyword arguments, optional (default= no attributes)

Attributes to add to graph as key=value pairs.

Base class for undirected graphs.

See Also

DiGraph
MultiDiGraph
MultiGraph
OrderedGraph

Examples

Create an empty graph structure (a "null graph") with no nodes and no edges.

>>> G = nx.Graph()

G can be grown in several ways.

Nodes:

Add one node at a time:

>>> G.add_node(1)

Add the nodes from any container (a list, dict, set or even the lines from a file or the nodes from another graph).

>>> G.add_nodes_from([2, 3])
... G.add_nodes_from(range(100, 110))
... H = nx.path_graph(10)
... G.add_nodes_from(H)

In addition to strings and integers any hashable Python object (except None) can represent a node, e.g. a customized node object, or even another Graph.

>>> G.add_node(H)

Edges:

G can also be grown by adding edges.

Add one edge,

>>> G.add_edge(1, 2)

a list of edges,

>>> G.add_edges_from([(1, 2), (1, 3)])

or a collection of edges,

>>> G.add_edges_from(H.edges)

If some edges connect nodes not yet in the graph, the nodes are added automatically. There are no errors when adding nodes or edges that already exist.

Attributes:

Each graph, node, and edge can hold key/value attribute pairs in an associated attribute dictionary (the keys must be hashable). By default these are empty, but can be added or changed using add_edge, add_node or direct manipulation of the attribute dictionaries named graph, node and edge respectively.

>>> G = nx.Graph(day="Friday")
... G.graph {'day': 'Friday'}

Add node attributes using add_node(), add_nodes_from() or G.nodes

>>> G.add_node(1, time="5pm")
... G.add_nodes_from([3], time="2pm")
... G.nodes[1] {'time': '5pm'}
>>> G.nodes[1]["room"] = 714  # node must exist already to use G.nodes
... del G.nodes[1]["room"] # remove attribute
... list(G.nodes(data=True)) [(1, {'time': '5pm'}), (3, {'time': '2pm'})]

Add edge attributes using add_edge(), add_edges_from(), subscript notation, or G.edges.

>>> G.add_edge(1, 2, weight=4.7)
... G.add_edges_from([(3, 4), (4, 5)], color="red")
... G.add_edges_from([(1, 2, {"color": "blue"}), (2, 3, {"weight": 8})])
... G[1][2]["weight"] = 4.7
... G.edges[1, 2]["weight"] = 4

Warning: we protect the graph data structure by making :None:None:`G.edges` a read-only dict-like structure. However, you can assign to attributes in e.g. :None:None:`G.edges[1, 2]`. Thus, use 2 sets of brackets to add/change data attributes: :None:None:`G.edges[1, 2]['weight'] = 4` (For multigraphs: :None:None:`MG.edges[u, v, key][name] = value`).

Shortcuts:

Many common graph features allow python syntax to speed reporting.

>>> 1 in G  # check if node in graph
True
>>> [n for n in G if n < 3]  # iterate through nodes
[1, 2]
>>> len(G)  # number of nodes in graph
5

Often the best way to traverse all edges of a graph is via the neighbors. The neighbors are reported as an adjacency-dict :None:None:`G.adj` or :None:None:`G.adjacency()`

>>> for n, nbrsdict in G.adjacency():
...  for nbr, eattr in nbrsdict.items():
...  if "weight" in eattr:
...  # Do something useful with the edges
...  pass

But the edges() method is often more convenient:

>>> for u, v, weight in G.edges.data("weight"):
...  if weight is not None:
...  # Do something useful with the edges
...  pass

Reporting:

Simple graph information is obtained using object-attributes and methods. Reporting typically provides views instead of containers to reduce memory usage. The views update as the graph is updated similarly to dict-views. The objects nodes , edges and :None:None:`adj` provide access to data attributes via lookup (e.g. :None:None:`nodes[n]`, :None:None:`edges[u, v]`, :None:None:`adj[u][v]`) and iteration (e.g. :None:None:`nodes.items()`, :None:None:`nodes.data('color')`, :None:None:`nodes.data('color', default='blue')` and similarly for edges ) Views exist for nodes , edges , :None:None:`neighbors()`/:None:None:`adj` and degree .

For details on these and other miscellaneous methods, see below.

Subclasses (Advanced):

The Graph class uses a dict-of-dict-of-dict data structure. The outer dict (node_dict) holds adjacency information keyed by node. The next dict (adjlist_dict) represents the adjacency information and holds edge data keyed by neighbor. The inner dict (edge_attr_dict) represents the edge data and holds edge attribute values keyed by attribute names.

Each of these three dicts can be replaced in a subclass by a user defined dict-like object. In general, the dict-like features should be maintained but extra features can be added. To replace one of the dicts create a new graph class by changing the class(!) variable holding the factory for that dict-like structure.

node_dict_factory

node_dict_factory

node_attr_dict_factory: function, (default: dict)

Factory function to be used to create the node attribute dict which holds attribute values keyed by attribute name. It should require no arguments and return a dict-like object

adjlist_outer_dict_factory

adjlist_outer_dict_factory

adjlist_inner_dict_factory

adjlist_inner_dict_factory

edge_attr_dict_factory

edge_attr_dict_factory

graph_attr_dict_factory

graph_attr_dict_factory

Typically, if your extension doesn't impact the data structure all methods will inherit without issue except: :None:None:`to_directed/to_undirected`. By default these methods create a DiGraph/Graph class and you probably want them to create your extension of a DiGraph/Graph. To facilitate this we define two class variables that you can set in your subclass.

to_directed_class

to_directed_class

to_undirected_class

to_undirected_class

Subclassing Example

Create a low memory graph class that effectively disallows edge attributes by using a single attribute dict for all edges. This reduces the memory used, but you lose edge attributes.

>>> class ThinGraph(nx.Graph):
...  all_edge_dict = {"weight": 1} ... ... def single_edge_dict(self): ... return self.all_edge_dict ... ... edge_attr_dict_factory = single_edge_dict
>>> G = ThinGraph()
... G.add_edge(2, 1)
... G[2][1] {'weight': 1}
>>> G.add_edge(2, 2)
... G[2][1] is G[2][2] True

Please see ~networkx.classes.ordered for more examples of creating graph subclasses by overwriting the base class :None:None:`dict` with a dictionary-like object.

See :

Back References

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

networkx

391 Elements
networkx.algorithms.similarity.optimal_edit_paths
networkx.classes.graph.Graph.update
networkx.algorithms.asteroidal.is_at_free
networkx.algorithms.cluster.clustering
networkx.algorithms.connectivity.cuts.minimum_edge_cut
networkx.algorithms.chordal.chordal_graph_treewidth
networkx.convert_matrix.to_numpy_recarray
networkx.classes.reportviews.DiDegreeView
networkx.classes.graph.Graph.size
networkx.generators.classic.circulant_graph
networkx.algorithms.connectivity.edge_augmentation.is_locally_k_edge_connected
networkx.algorithms.graph_hashing.weisfeiler_lehman_subgraph_hashes
networkx.algorithms.shortest_paths.unweighted.all_pairs_shortest_path_length
networkx.convert.from_edgelist
networkx.algorithms.connectivity.disjoint_paths.edge_disjoint_paths
networkx.readwrite.pajek.write_pajek
networkx.algorithms.connectivity.cuts.minimum_st_node_cut
networkx.algorithms.cluster.average_clustering
networkx.algorithms.distance_measures.resistance_distance
networkx.algorithms.distance_measures.eccentricity
networkx.relabel.relabel_nodes
networkx.readwrite.json_graph.adjacency.adjacency_data
networkx.algorithms.minors.contraction.contracted_edge
networkx.readwrite.sparse6.from_sparse6_bytes
networkx.linalg.attrmatrix.attr_sparse_matrix
networkx.algorithms.similarity.optimize_graph_edit_distance
networkx.linalg.modularitymatrix.modularity_matrix
networkx.algorithms.bipartite.projection.projected_graph
networkx.readwrite.gpickle.read_gpickle
networkx.drawing.layout.circular_layout
networkx.classes.graph.Graph.has_edge
networkx.algorithms.connectivity.edge_augmentation.k_edge_augmentation
networkx.algorithms.link_prediction.ra_index_soundarajan_hopcroft
networkx.classes.graph.Graph.clear
networkx.convert_matrix.to_numpy_array
networkx.readwrite.multiline_adjlist.generate_multiline_adjlist
networkx.algorithms.connectivity.connectivity.node_connectivity
networkx.algorithms.traversal.depth_first_search.dfs_preorder_nodes
networkx.algorithms.connectivity.disjoint_paths.node_disjoint_paths
networkx.algorithms.operators.binary.intersection
networkx.algorithms.distance_measures.radius
networkx.algorithms.shortest_paths.unweighted.all_pairs_shortest_path
networkx.algorithms.centrality.katz.katz_centrality_numpy
networkx.algorithms.operators.unary.complement
networkx.algorithms.centrality.katz.katz_centrality
networkx.algorithms.traversal.depth_first_search.dfs_successors
networkx.classes.graph.Graph.__init__
networkx.drawing.layout.multipartite_layout
networkx.algorithms.connectivity.connectivity.edge_connectivity
networkx.algorithms.connectivity.edge_kcomponents.k_edge_components
networkx.algorithms.tree.coding.to_prufer_sequence
networkx.algorithms.connectivity.edge_augmentation.collapse
networkx.algorithms.centrality.second_order.second_order_centrality
networkx.algorithms.approximation.connectivity.local_node_connectivity
networkx.algorithms.richclub.rich_club_coefficient
networkx.drawing.nx_pylab.draw_networkx_labels
networkx.drawing.nx_pydot.from_pydot
networkx.algorithms.shortest_paths.weighted.multi_source_dijkstra_path_length
networkx.generators.degree_seq.random_degree_sequence_graph
networkx.algorithms.assortativity.mixing.degree_mixing_matrix
networkx.algorithms.polynomials.tutte_polynomial
networkx.classes.reportviews.EdgeView
networkx.algorithms.chains.chain_decomposition
networkx.algorithms.distance_measures.periphery
networkx.algorithms.traversal.beamsearch.bfs_beam_edges
networkx.algorithms.link_prediction.cn_soundarajan_hopcroft
networkx.algorithms.matching.maximal_matching
networkx.utils.rcm.reverse_cuthill_mckee_ordering
networkx.algorithms.cluster.triangles
networkx.algorithms.traversal.breadth_first_search.bfs_successors
networkx.algorithms.shortest_paths.generic.average_shortest_path_length
networkx.readwrite.text.forest_str
networkx.algorithms.connectivity.edge_kcomponents.EdgeComponentAuxGraph
networkx.algorithms.traversal.breadth_first_search.bfs_tree
networkx.algorithms.link_prediction.jaccard_coefficient
networkx.algorithms.cycles.minimum_cycle_basis
networkx.convert_matrix.from_numpy_matrix
networkx.readwrite.json_graph.node_link.node_link_data
networkx.algorithms.connectivity.edge_augmentation.weighted_bridge_augmentation
networkx.algorithms.components.biconnected.biconnected_component_edges
networkx.algorithms.bipartite.basic.is_bipartite_node_set
networkx.classes.digraph.DiGraph.remove_edge
networkx.algorithms.chordal.chordal_graph_cliques
networkx.algorithms.summarization.snap_aggregation
networkx.classes.graphviews.subgraph_view
networkx.classes.graph.Graph.adjacency
networkx.algorithms.euler.is_eulerian
networkx.algorithms.connectivity.cuts.minimum_st_edge_cut
networkx.drawing.nx_pydot.pydot_layout
networkx.classes.function.restricted_view
networkx.algorithms.shortest_paths.generic.all_shortest_paths
networkx.algorithms.components.connected.connected_components
networkx.algorithms.traversal.depth_first_search.dfs_predecessors
networkx.readwrite.json_graph.cytoscape.cytoscape_graph
networkx.convert_matrix.to_pandas_edgelist
networkx.classes.function.common_neighbors
networkx.classes.function.nodes_with_selfloops
networkx.algorithms.bipartite.edgelist.read_edgelist
networkx.classes.graph.Graph.clear_edges
networkx.algorithms.traversal.depth_first_search.dfs_postorder_nodes
networkx.algorithms.connectivity.edge_augmentation.is_k_edge_connected
networkx.algorithms.cluster.square_clustering
networkx.algorithms.link_analysis.hits_alg.hits_scipy
networkx.algorithms.covering.min_edge_cover
networkx.algorithms.bipartite.edgelist.write_edgelist
networkx.algorithms.distance_regular.intersection_array
networkx.classes.graph.Graph.remove_edges_from
networkx.algorithms.connectivity.edge_augmentation.unconstrained_one_edge_augmentation
networkx.algorithms.centrality.subgraph_alg.estrada_index
networkx.algorithms.cluster.transitivity
networkx.generators.random_graphs.random_kernel_graph
networkx.algorithms.shortest_paths.unweighted.single_source_shortest_path
networkx.algorithms.similarity._simrank_similarity_numpy
networkx.drawing.nx_pylab.draw_networkx
networkx.generators.community.stochastic_block_model
networkx.algorithms.shortest_paths.weighted.single_source_dijkstra_path
networkx.algorithms.shortest_paths.weighted.bellman_ford_path_length
networkx.algorithms.graph_hashing.weisfeiler_lehman_graph_hash
networkx.algorithms.shortest_paths.weighted.single_source_bellman_ford
networkx.algorithms.distance_measures.center
networkx.algorithms.connectivity.edge_kcomponents.bridge_components
networkx.classes.reportviews.NodeView.data
networkx.algorithms.bipartite.cluster.robins_alexander_clustering
networkx.classes.function.get_node_attributes
networkx.generators.degree_seq.configuration_model
networkx.algorithms.shortest_paths.weighted.dijkstra_path_length
networkx.algorithms.operators.binary.difference
networkx.algorithms.matching.max_weight_matching
networkx.classes.graph.Graph.__len__
networkx.algorithms.bipartite.projection.overlap_weighted_projected_graph
networkx.readwrite.adjlist.generate_adjlist
networkx.algorithms.assortativity.neighbor_degree.average_neighbor_degree
networkx.algorithms.bipartite.basic.color
networkx.algorithms.link_analysis.hits_alg.hits_numpy
networkx.classes.multigraph.MultiGraph
networkx.algorithms.operators.product.tensor_product
networkx.readwrite.gml.write_gml
networkx.classes.function.edge_subgraph
networkx.algorithms.matching.is_perfect_matching
networkx.classes.reportviews.NodeView
networkx.classes.digraph.DiGraph.remove_node
networkx.algorithms.bipartite.cluster.average_clustering
networkx.algorithms.tree.mst.maximum_spanning_tree
networkx.drawing.nx_agraph.from_agraph
networkx.drawing.nx_pylab.draw_networkx_nodes
networkx.algorithms.community.modularity_max.naive_greedy_modularity_communities
networkx.algorithms.traversal.breadth_first_search.descendants_at_distance
networkx.classes.graph.Graph.neighbors
networkx.classes.function.add_cycle
networkx.convert_matrix.from_pandas_adjacency
networkx.readwrite.edgelist.parse_edgelist
networkx.classes.function.add_path
networkx.algorithms.euler.has_eulerian_path
networkx.algorithms.cycles.cycle_basis
networkx.readwrite.graphml.write_graphml_xml
networkx.drawing.nx_pylab.draw_networkx_edges
networkx.generators.community.gaussian_random_partition_graph
networkx.algorithms.vitality.closeness_vitality
networkx.algorithms.non_randomness.non_randomness
networkx.generators.trees.random_tree
networkx.classes.function.is_negatively_weighted
networkx.classes.graph.Graph.add_nodes_from
networkx.algorithms.operators.product.lexicographic_product
networkx.classes.function.freeze
networkx.readwrite.edgelist.generate_edgelist
networkx.readwrite.gexf.write_gexf
networkx.algorithms.isomorphism.temporalisomorphvf2.TimeRespectingGraphMatcher.__init__
networkx.algorithms.operators.product.cartesian_product
networkx.algorithms.components.biconnected.biconnected_components
networkx.algorithms.assortativity.correlation.degree_assortativity_coefficient
networkx.algorithms.similarity.graph_edit_distance
networkx.algorithms.chordal.find_induced_nodes
networkx.algorithms.components.connected.is_connected
networkx.algorithms.operators.binary.symmetric_difference
networkx.algorithms.similarity._simrank_similarity_python
networkx.algorithms.node_classification.lgc.local_and_global_consistency
networkx.classes.graph.Graph.remove_node
networkx.algorithms.components.biconnected.articulation_points
networkx.algorithms.centrality.voterank_alg.voterank
networkx.algorithms.distance_measures.diameter
networkx.generators.directed.gn_graph
networkx.classes.graph.Graph.remove_nodes_from
networkx.algorithms.connectivity.connectivity.local_node_connectivity
networkx.classes.function.get_edge_attributes
networkx.algorithms.centrality.subgraph_alg.communicability_betweenness_centrality
networkx.drawing.nx_agraph.graphviz_layout
networkx.algorithms.link_analysis.hits_alg.hits
networkx.convert.from_dict_of_lists
networkx.readwrite.edgelist.write_weighted_edgelist
networkx.algorithms.centrality.eigenvector.eigenvector_centrality
networkx.classes.graph.Graph.add_edges_from
networkx.readwrite.edgelist.write_edgelist
networkx.algorithms.approximation.kcomponents.k_components
networkx.classes.multidigraph.MultiDiGraph.__init__
networkx.algorithms.flow.gomory_hu.gomory_hu_tree
networkx.algorithms.bipartite.cluster.latapy_clustering
networkx.generators.geometric.geometric_edges
networkx.drawing.layout.planar_layout
networkx.algorithms.planarity.is_planar
networkx.algorithms.matching.is_matching
networkx.classes.digraph.DiGraph.add_node
networkx.utils.rcm.cuthill_mckee_ordering
networkx.readwrite.adjlist.read_adjlist
networkx.algorithms.traversal.depth_first_search.dfs_edges
networkx.classes.graph.Graph
networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_path
networkx.classes.graph.Graph.edge_subgraph
networkx.algorithms.tree.mst.minimum_spanning_tree
networkx.classes.function.induced_subgraph
networkx.classes.digraph.DiGraph.remove_edges_from
networkx.readwrite.json_graph.cytoscape.cytoscape_data
networkx.algorithms.shortest_paths.weighted.single_source_bellman_ford_path
networkx.algorithms.connectivity.kcomponents.k_components
networkx.algorithms.bipartite.basic.degrees
networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra
networkx.drawing.nx_pydot.to_pydot
networkx.algorithms.community.modularity_max.greedy_modularity_communities
networkx.algorithms.planarity.check_planarity
networkx.algorithms.bipartite.projection.collaboration_weighted_projected_graph
networkx.readwrite.multiline_adjlist.read_multiline_adjlist
networkx.generators.classic.complete_graph
networkx.classes.multigraph.MultiGraph.remove_edges_from
networkx.classes.reportviews.EdgeDataView
networkx.classes.digraph.DiGraph.__init__
networkx.algorithms.coloring.equitable_coloring.equitable_color
networkx.algorithms.assortativity.mixing.attribute_mixing_matrix
networkx.generators.spectral_graph_forge.spectral_graph_forge
networkx.drawing.layout.bipartite_layout
networkx.algorithms.bipartite.basic.sets
networkx.classes.graph.Graph.__str__
networkx.algorithms.shortest_paths.weighted.multi_source_dijkstra
networkx.classes.graph.Graph.to_undirected
networkx.algorithms.similarity.simrank_similarity
networkx.algorithms.traversal.depth_first_search.dfs_tree
networkx.algorithms.chordal.complete_to_chordal_graph
networkx.drawing.nx_agraph.to_agraph
networkx.classes.digraph.DiGraph.remove_nodes_from
networkx.classes.graph.Graph.add_edge
networkx.algorithms.minors.contraction.contracted_nodes
networkx.convert_matrix.from_pandas_edgelist
networkx.algorithms.operators.binary.compose
networkx.algorithms.link_prediction.within_inter_cluster
networkx.classes.digraph.DiGraph.add_edge
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.simple_paths.shortest_simple_paths
networkx.drawing.nx_pydot.graphviz_layout
networkx.readwrite.adjlist.parse_adjlist
networkx.algorithms.chordal.is_chordal
networkx.algorithms.connectivity.kcutsets.all_node_cuts
networkx.classes.graph.Graph.get_edge_data
networkx.classes.multigraph.MultiGraph.add_edges_from
networkx.classes.graph.Graph.number_of_nodes
networkx.algorithms.approximation.connectivity.node_connectivity
networkx.readwrite.adjlist.write_adjlist
networkx.classes.multigraph.MultiGraph.copy
networkx.readwrite.graphml.generate_graphml
networkx.linalg.attrmatrix.attr_matrix
networkx.algorithms.bipartite.projection.weighted_projected_graph
networkx.classes.graph.Graph.order
networkx.drawing.layout.kamada_kawai_layout
networkx.classes.graph.Graph.add_weighted_edges_from
networkx.readwrite.json_graph.node_link.node_link_graph
networkx.readwrite.graphml.parse_graphml
networkx.readwrite.pajek.read_pajek
networkx.algorithms.tree.recognition.is_forest
networkx.classes.graph.Graph.add_node
networkx.classes.reportviews.DegreeView
networkx.algorithms.mis.maximal_independent_set
networkx.classes.reportviews.OutEdgeView.data
networkx.algorithms.tree.mst.maximum_spanning_edges
networkx.classes.digraph.DiGraph.add_nodes_from
networkx.algorithms.assortativity.mixing.attribute_mixing_dict
networkx.algorithms.connectivity.edge_kcomponents.k_edge_subgraphs
networkx.algorithms.shortest_paths.unweighted.single_source_shortest_path_length
networkx.readwrite.gml.read_gml
networkx.algorithms.bridges.bridges
networkx.algorithms.connectivity.connectivity.local_edge_connectivity
networkx.algorithms.bipartite.basic.density
networkx.algorithms.connectivity.stoerwagner.stoer_wagner
networkx.algorithms.connectivity.edge_augmentation.unconstrained_bridge_augmentation
networkx.algorithms.simple_paths.is_simple_path
networkx.algorithms.assortativity.connectivity.average_degree_connectivity
networkx.generators.interval_graph.interval_graph
networkx.generators.sudoku.sudoku_graph
networkx.classes.graph.Graph.has_node
networkx.algorithms.operators.binary.union
networkx.algorithms.link_prediction.common_neighbor_centrality
networkx.algorithms.cluster.generalized_degree
networkx.algorithms.traversal.breadth_first_search.bfs_predecessors
networkx.drawing.layout.spectral_layout
networkx.algorithms.similarity.generate_random_paths
networkx.generators.random_clustered.random_clustered_graph
networkx.algorithms.chordal._chordal_graph_cliques
networkx.classes.graph.Graph.remove_edge
networkx.classes.function.is_weighted
networkx.readwrite.gexf.generate_gexf
networkx.algorithms.community.kclique.k_clique_communities
networkx.algorithms.connectivity.edge_augmentation.weighted_one_edge_augmentation
networkx.algorithms.coloring.greedy_coloring.greedy_color
networkx.classes.function.number_of_selfloops
networkx.generators.community.random_partition_graph
networkx.readwrite.multiline_adjlist.write_multiline_adjlist
networkx.drawing.layout.spiral_layout
networkx.readwrite.graphml.write_graphml_lxml
networkx.readwrite.graph6.from_graph6_bytes
networkx.algorithms.tree.recognition.is_tree
networkx.algorithms.shortest_paths.weighted.single_source_bellman_ford_path_length
networkx.readwrite.gpickle.write_gpickle
networkx.classes.digraph.DiGraph.to_undirected
networkx.drawing.layout.shell_layout
networkx.drawing.nx_pylab.draw_networkx_edge_labels
networkx.classes.multidigraph.MultiDiGraph
networkx.algorithms.shortest_paths.weighted.bellman_ford_path
networkx.algorithms.node_classification.hmn.harmonic_function
networkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_path_length
networkx.algorithms.shortest_paths.weighted.all_pairs_bellman_ford_path_length
networkx.classes.digraph.DiGraph
networkx.algorithms.bipartite.edgelist.generate_edgelist
networkx.algorithms.traversal.edgedfs.edge_dfs
networkx.algorithms.tree.mst.minimum_spanning_edges
networkx.algorithms.distance_regular.global_parameters
networkx.algorithms.shortest_paths.unweighted.predecessor
networkx.algorithms.centrality.eigenvector.eigenvector_centrality_numpy
networkx.algorithms.connectivity.edge_augmentation.partial_k_edge_augmentation
networkx.classes.graph.Graph.__contains__
networkx.algorithms.similarity.panther_similarity
networkx.algorithms.link_prediction.preferential_attachment
networkx.algorithms.matching.is_maximal_matching
networkx.algorithms.approximation.traveling_salesman.traveling_salesman_problem
networkx.algorithms.assortativity.correlation.numeric_assortativity_coefficient
networkx.algorithms.components.connected.node_connected_component
networkx.readwrite.gml.generate_gml
networkx.algorithms.communicability_alg.communicability
networkx.algorithms.shortest_paths.weighted.all_pairs_bellman_ford_path
networkx.readwrite.edgelist.read_edgelist
networkx.algorithms.tree.coding.from_prufer_sequence
networkx.algorithms.operators.binary.disjoint_union
networkx.algorithms.operators.binary.full_join
networkx.algorithms.connectivity.cuts.minimum_node_cut
networkx.algorithms.moral.moral_graph
networkx.classes.graph.Graph.__getitem__
networkx.algorithms.connectivity.edge_augmentation.complement_edges
networkx.drawing.nx_agraph.pygraphviz_layout
networkx.convert.to_dict_of_dicts
networkx.classes.digraph.DiGraph.add_edges_from
networkx.classes.graph.Graph.copy
networkx.algorithms.shortest_paths.weighted.single_source_dijkstra_path_length
networkx.drawing.layout.spring_layout
networkx.classes.digraph.DiGraph.clear_edges
networkx.algorithms.bipartite.basic.is_bipartite
networkx.algorithms.communicability_alg.communicability_exp
networkx.classes.digraph.DiGraph.clear
networkx.algorithms.shortest_paths.weighted.single_source_dijkstra
networkx.algorithms.operators.product.strong_product
networkx.algorithms.traversal.edgebfs.edge_bfs
networkx.algorithms.link_prediction.adamic_adar_index
networkx.algorithms.approximation.clustering_coefficient.average_clustering
networkx.linalg.bethehessianmatrix.bethe_hessian_matrix
networkx.generators.line.line_graph
networkx.algorithms.covering.is_edge_cover
networkx.classes.function.add_star
networkx.algorithms.bipartite.projection.generic_weighted_projected_graph
networkx.generators.directed.gnr_graph
networkx.algorithms.isomorphism.isomorphvf2.GraphMatcher.__init__
networkx.algorithms.components.biconnected.is_biconnected
networkx.algorithms.components.connected.number_connected_components
networkx.algorithms.traversal.breadth_first_search.generic_bfs_edges
networkx.convert.from_dict_of_dicts
networkx.algorithms.shortest_paths.generic.shortest_path
networkx.algorithms.shortest_paths.astar.astar_path
networkx.classes.graph.Graph.__iter__
networkx.algorithms.isolate.is_isolate
networkx.readwrite.json_graph.adjacency.adjacency_graph
networkx.readwrite.multiline_adjlist.parse_multiline_adjlist
networkx.drawing.nx_pylab.draw
networkx.classes.graph.Graph.number_of_edges
networkx.algorithms.assortativity.correlation.attribute_assortativity_coefficient
networkx.algorithms.bipartite.edgelist.parse_edgelist
networkx.convert_matrix.from_numpy_array
networkx.classes.graph.Graph.to_directed
networkx.algorithms.community.quality.modularity
networkx.algorithms.assortativity.correlation.degree_pearson_correlation_coefficient
networkx.drawing.layout.random_layout
networkx.algorithms.bipartite.spectral.spectral_bipartivity
networkx.algorithms.shortest_paths.weighted.multi_source_dijkstra_path
networkx.algorithms.link_prediction.resource_allocation_index
networkx.generators.community.ring_of_cliques
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/classes/graph.py#22
type: <class 'type'>
Commit: