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.
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.
Attributes to add to graph as key=value pairs.
Base class for undirected graphs.
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.
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.similarity.optimal_edit_pathsnetworkx.classes.graph.Graph.updatenetworkx.algorithms.asteroidal.is_at_freenetworkx.algorithms.cluster.clusteringnetworkx.algorithms.connectivity.cuts.minimum_edge_cutnetworkx.algorithms.chordal.chordal_graph_treewidthnetworkx.convert_matrix.to_numpy_recarraynetworkx.classes.reportviews.DiDegreeViewnetworkx.classes.graph.Graph.sizenetworkx.generators.classic.circulant_graphnetworkx.algorithms.connectivity.edge_augmentation.is_locally_k_edge_connectednetworkx.algorithms.graph_hashing.weisfeiler_lehman_subgraph_hashesnetworkx.algorithms.shortest_paths.unweighted.all_pairs_shortest_path_lengthnetworkx.convert.from_edgelistnetworkx.algorithms.connectivity.disjoint_paths.edge_disjoint_pathsnetworkx.readwrite.pajek.write_pajeknetworkx.algorithms.connectivity.cuts.minimum_st_node_cutnetworkx.algorithms.cluster.average_clusteringnetworkx.algorithms.distance_measures.resistance_distancenetworkx.algorithms.distance_measures.eccentricitynetworkx.relabel.relabel_nodesnetworkx.readwrite.json_graph.adjacency.adjacency_datanetworkx.algorithms.minors.contraction.contracted_edgenetworkx.readwrite.sparse6.from_sparse6_bytesnetworkx.linalg.attrmatrix.attr_sparse_matrixnetworkx.algorithms.similarity.optimize_graph_edit_distancenetworkx.linalg.modularitymatrix.modularity_matrixnetworkx.algorithms.bipartite.projection.projected_graphnetworkx.readwrite.gpickle.read_gpicklenetworkx.drawing.layout.circular_layoutnetworkx.classes.graph.Graph.has_edgenetworkx.algorithms.connectivity.edge_augmentation.k_edge_augmentationnetworkx.algorithms.link_prediction.ra_index_soundarajan_hopcroftnetworkx.classes.graph.Graph.clearnetworkx.convert_matrix.to_numpy_arraynetworkx.readwrite.multiline_adjlist.generate_multiline_adjlistnetworkx.algorithms.connectivity.connectivity.node_connectivitynetworkx.algorithms.traversal.depth_first_search.dfs_preorder_nodesnetworkx.algorithms.connectivity.disjoint_paths.node_disjoint_pathsnetworkx.algorithms.operators.binary.intersectionnetworkx.algorithms.distance_measures.radiusnetworkx.algorithms.shortest_paths.unweighted.all_pairs_shortest_pathnetworkx.algorithms.centrality.katz.katz_centrality_numpynetworkx.algorithms.operators.unary.complementnetworkx.algorithms.centrality.katz.katz_centralitynetworkx.algorithms.traversal.depth_first_search.dfs_successorsnetworkx.classes.graph.Graph.__init__networkx.drawing.layout.multipartite_layoutnetworkx.algorithms.connectivity.connectivity.edge_connectivitynetworkx.algorithms.connectivity.edge_kcomponents.k_edge_componentsnetworkx.algorithms.tree.coding.to_prufer_sequencenetworkx.algorithms.connectivity.edge_augmentation.collapsenetworkx.algorithms.centrality.second_order.second_order_centralitynetworkx.algorithms.approximation.connectivity.local_node_connectivitynetworkx.algorithms.richclub.rich_club_coefficientnetworkx.drawing.nx_pylab.draw_networkx_labelsnetworkx.drawing.nx_pydot.from_pydotnetworkx.algorithms.shortest_paths.weighted.multi_source_dijkstra_path_lengthnetworkx.generators.degree_seq.random_degree_sequence_graphnetworkx.algorithms.assortativity.mixing.degree_mixing_matrixnetworkx.algorithms.polynomials.tutte_polynomialnetworkx.classes.reportviews.EdgeViewnetworkx.algorithms.chains.chain_decompositionnetworkx.algorithms.distance_measures.peripherynetworkx.algorithms.traversal.beamsearch.bfs_beam_edgesnetworkx.algorithms.link_prediction.cn_soundarajan_hopcroftnetworkx.algorithms.matching.maximal_matchingnetworkx.utils.rcm.reverse_cuthill_mckee_orderingnetworkx.algorithms.cluster.trianglesnetworkx.algorithms.traversal.breadth_first_search.bfs_successorsnetworkx.algorithms.shortest_paths.generic.average_shortest_path_lengthnetworkx.readwrite.text.forest_strnetworkx.algorithms.connectivity.edge_kcomponents.EdgeComponentAuxGraphnetworkx.algorithms.traversal.breadth_first_search.bfs_treenetworkx.algorithms.link_prediction.jaccard_coefficientnetworkx.algorithms.cycles.minimum_cycle_basisnetworkx.convert_matrix.from_numpy_matrixnetworkx.readwrite.json_graph.node_link.node_link_datanetworkx.algorithms.connectivity.edge_augmentation.weighted_bridge_augmentationnetworkx.algorithms.components.biconnected.biconnected_component_edgesnetworkx.algorithms.bipartite.basic.is_bipartite_node_setnetworkx.classes.digraph.DiGraph.remove_edgenetworkx.algorithms.chordal.chordal_graph_cliquesnetworkx.algorithms.summarization.snap_aggregationnetworkx.classes.graphviews.subgraph_viewnetworkx.classes.graph.Graph.adjacencynetworkx.algorithms.euler.is_euleriannetworkx.algorithms.connectivity.cuts.minimum_st_edge_cutnetworkx.drawing.nx_pydot.pydot_layoutnetworkx.classes.function.restricted_viewnetworkx.algorithms.shortest_paths.generic.all_shortest_pathsnetworkx.algorithms.components.connected.connected_componentsnetworkx.algorithms.traversal.depth_first_search.dfs_predecessorsnetworkx.readwrite.json_graph.cytoscape.cytoscape_graphnetworkx.convert_matrix.to_pandas_edgelistnetworkx.classes.function.common_neighborsnetworkx.classes.function.nodes_with_selfloopsnetworkx.algorithms.bipartite.edgelist.read_edgelistnetworkx.classes.graph.Graph.clear_edgesnetworkx.algorithms.traversal.depth_first_search.dfs_postorder_nodesnetworkx.algorithms.connectivity.edge_augmentation.is_k_edge_connectednetworkx.algorithms.cluster.square_clusteringnetworkx.algorithms.link_analysis.hits_alg.hits_scipynetworkx.algorithms.covering.min_edge_covernetworkx.algorithms.bipartite.edgelist.write_edgelistnetworkx.algorithms.distance_regular.intersection_arraynetworkx.classes.graph.Graph.remove_edges_fromnetworkx.algorithms.connectivity.edge_augmentation.unconstrained_one_edge_augmentationnetworkx.algorithms.centrality.subgraph_alg.estrada_indexnetworkx.algorithms.cluster.transitivitynetworkx.generators.random_graphs.random_kernel_graphnetworkx.algorithms.shortest_paths.unweighted.single_source_shortest_pathnetworkx.algorithms.similarity._simrank_similarity_numpynetworkx.drawing.nx_pylab.draw_networkxnetworkx.generators.community.stochastic_block_modelnetworkx.algorithms.shortest_paths.weighted.single_source_dijkstra_pathnetworkx.algorithms.shortest_paths.weighted.bellman_ford_path_lengthnetworkx.algorithms.graph_hashing.weisfeiler_lehman_graph_hashnetworkx.algorithms.shortest_paths.weighted.single_source_bellman_fordnetworkx.algorithms.distance_measures.centernetworkx.algorithms.connectivity.edge_kcomponents.bridge_componentsnetworkx.classes.reportviews.NodeView.datanetworkx.algorithms.bipartite.cluster.robins_alexander_clusteringnetworkx.classes.function.get_node_attributesnetworkx.generators.degree_seq.configuration_modelnetworkx.algorithms.shortest_paths.weighted.dijkstra_path_lengthnetworkx.algorithms.operators.binary.differencenetworkx.algorithms.matching.max_weight_matchingnetworkx.classes.graph.Graph.__len__networkx.algorithms.bipartite.projection.overlap_weighted_projected_graphnetworkx.readwrite.adjlist.generate_adjlistnetworkx.algorithms.assortativity.neighbor_degree.average_neighbor_degreenetworkx.algorithms.bipartite.basic.colornetworkx.algorithms.link_analysis.hits_alg.hits_numpynetworkx.classes.multigraph.MultiGraphnetworkx.algorithms.operators.product.tensor_productnetworkx.readwrite.gml.write_gmlnetworkx.classes.function.edge_subgraphnetworkx.algorithms.matching.is_perfect_matchingnetworkx.classes.reportviews.NodeViewnetworkx.classes.digraph.DiGraph.remove_nodenetworkx.algorithms.bipartite.cluster.average_clusteringnetworkx.algorithms.tree.mst.maximum_spanning_treenetworkx.drawing.nx_agraph.from_agraphnetworkx.drawing.nx_pylab.draw_networkx_nodesnetworkx.algorithms.community.modularity_max.naive_greedy_modularity_communitiesnetworkx.algorithms.traversal.breadth_first_search.descendants_at_distancenetworkx.classes.graph.Graph.neighborsnetworkx.classes.function.add_cyclenetworkx.convert_matrix.from_pandas_adjacencynetworkx.readwrite.edgelist.parse_edgelistnetworkx.classes.function.add_pathnetworkx.algorithms.euler.has_eulerian_pathnetworkx.algorithms.cycles.cycle_basisnetworkx.readwrite.graphml.write_graphml_xmlnetworkx.drawing.nx_pylab.draw_networkx_edgesnetworkx.generators.community.gaussian_random_partition_graphnetworkx.algorithms.vitality.closeness_vitalitynetworkx.algorithms.non_randomness.non_randomnessnetworkx.generators.trees.random_treenetworkx.classes.function.is_negatively_weightednetworkx.classes.graph.Graph.add_nodes_fromnetworkx.algorithms.operators.product.lexicographic_productnetworkx.classes.function.freezenetworkx.readwrite.edgelist.generate_edgelistnetworkx.readwrite.gexf.write_gexfnetworkx.algorithms.isomorphism.temporalisomorphvf2.TimeRespectingGraphMatcher.__init__networkx.algorithms.operators.product.cartesian_productnetworkx.algorithms.components.biconnected.biconnected_componentsnetworkx.algorithms.assortativity.correlation.degree_assortativity_coefficientnetworkx.algorithms.similarity.graph_edit_distancenetworkx.algorithms.chordal.find_induced_nodesnetworkx.algorithms.components.connected.is_connectednetworkx.algorithms.operators.binary.symmetric_differencenetworkx.algorithms.similarity._simrank_similarity_pythonnetworkx.algorithms.node_classification.lgc.local_and_global_consistencynetworkx.classes.graph.Graph.remove_nodenetworkx.algorithms.components.biconnected.articulation_pointsnetworkx.algorithms.centrality.voterank_alg.voteranknetworkx.algorithms.distance_measures.diameternetworkx.generators.directed.gn_graphnetworkx.classes.graph.Graph.remove_nodes_fromnetworkx.algorithms.connectivity.connectivity.local_node_connectivitynetworkx.classes.function.get_edge_attributesnetworkx.algorithms.centrality.subgraph_alg.communicability_betweenness_centralitynetworkx.drawing.nx_agraph.graphviz_layoutnetworkx.algorithms.link_analysis.hits_alg.hitsnetworkx.convert.from_dict_of_listsnetworkx.readwrite.edgelist.write_weighted_edgelistnetworkx.algorithms.centrality.eigenvector.eigenvector_centralitynetworkx.classes.graph.Graph.add_edges_fromnetworkx.readwrite.edgelist.write_edgelistnetworkx.algorithms.approximation.kcomponents.k_componentsnetworkx.classes.multidigraph.MultiDiGraph.__init__networkx.algorithms.flow.gomory_hu.gomory_hu_treenetworkx.algorithms.bipartite.cluster.latapy_clusteringnetworkx.generators.geometric.geometric_edgesnetworkx.drawing.layout.planar_layoutnetworkx.algorithms.planarity.is_planarnetworkx.algorithms.matching.is_matchingnetworkx.classes.digraph.DiGraph.add_nodenetworkx.utils.rcm.cuthill_mckee_orderingnetworkx.readwrite.adjlist.read_adjlistnetworkx.algorithms.traversal.depth_first_search.dfs_edgesnetworkx.classes.graph.Graphnetworkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_pathnetworkx.classes.graph.Graph.edge_subgraphnetworkx.algorithms.tree.mst.minimum_spanning_treenetworkx.classes.function.induced_subgraphnetworkx.classes.digraph.DiGraph.remove_edges_fromnetworkx.readwrite.json_graph.cytoscape.cytoscape_datanetworkx.algorithms.shortest_paths.weighted.single_source_bellman_ford_pathnetworkx.algorithms.connectivity.kcomponents.k_componentsnetworkx.algorithms.bipartite.basic.degreesnetworkx.algorithms.shortest_paths.weighted.all_pairs_dijkstranetworkx.drawing.nx_pydot.to_pydotnetworkx.algorithms.community.modularity_max.greedy_modularity_communitiesnetworkx.algorithms.planarity.check_planaritynetworkx.algorithms.bipartite.projection.collaboration_weighted_projected_graphnetworkx.readwrite.multiline_adjlist.read_multiline_adjlistnetworkx.generators.classic.complete_graphnetworkx.classes.multigraph.MultiGraph.remove_edges_fromnetworkx.classes.reportviews.EdgeDataViewnetworkx.classes.digraph.DiGraph.__init__networkx.algorithms.coloring.equitable_coloring.equitable_colornetworkx.algorithms.assortativity.mixing.attribute_mixing_matrixnetworkx.generators.spectral_graph_forge.spectral_graph_forgenetworkx.drawing.layout.bipartite_layoutnetworkx.algorithms.bipartite.basic.setsnetworkx.classes.graph.Graph.__str__networkx.algorithms.shortest_paths.weighted.multi_source_dijkstranetworkx.classes.graph.Graph.to_undirectednetworkx.algorithms.similarity.simrank_similaritynetworkx.algorithms.traversal.depth_first_search.dfs_treenetworkx.algorithms.chordal.complete_to_chordal_graphnetworkx.drawing.nx_agraph.to_agraphnetworkx.classes.digraph.DiGraph.remove_nodes_fromnetworkx.classes.graph.Graph.add_edgenetworkx.algorithms.minors.contraction.contracted_nodesnetworkx.convert_matrix.from_pandas_edgelistnetworkx.algorithms.operators.binary.composenetworkx.algorithms.link_prediction.within_inter_clusternetworkx.classes.digraph.DiGraph.add_edgenetworkx.classes.multidigraph.MultiDiGraph.to_undirectednetworkx.algorithms.shortest_paths.weighted.dijkstra_pathnetworkx.algorithms.shortest_paths.weighted.bidirectional_dijkstranetworkx.classes.graph.Graph.subgraphnetworkx.algorithms.simple_paths.shortest_simple_pathsnetworkx.drawing.nx_pydot.graphviz_layoutnetworkx.readwrite.adjlist.parse_adjlistnetworkx.algorithms.chordal.is_chordalnetworkx.algorithms.connectivity.kcutsets.all_node_cutsnetworkx.classes.graph.Graph.get_edge_datanetworkx.classes.multigraph.MultiGraph.add_edges_fromnetworkx.classes.graph.Graph.number_of_nodesnetworkx.algorithms.approximation.connectivity.node_connectivitynetworkx.readwrite.adjlist.write_adjlistnetworkx.classes.multigraph.MultiGraph.copynetworkx.readwrite.graphml.generate_graphmlnetworkx.linalg.attrmatrix.attr_matrixnetworkx.algorithms.bipartite.projection.weighted_projected_graphnetworkx.classes.graph.Graph.ordernetworkx.drawing.layout.kamada_kawai_layoutnetworkx.classes.graph.Graph.add_weighted_edges_fromnetworkx.readwrite.json_graph.node_link.node_link_graphnetworkx.readwrite.graphml.parse_graphmlnetworkx.readwrite.pajek.read_pajeknetworkx.algorithms.tree.recognition.is_forestnetworkx.classes.graph.Graph.add_nodenetworkx.classes.reportviews.DegreeViewnetworkx.algorithms.mis.maximal_independent_setnetworkx.classes.reportviews.OutEdgeView.datanetworkx.algorithms.tree.mst.maximum_spanning_edgesnetworkx.classes.digraph.DiGraph.add_nodes_fromnetworkx.algorithms.assortativity.mixing.attribute_mixing_dictnetworkx.algorithms.connectivity.edge_kcomponents.k_edge_subgraphsnetworkx.algorithms.shortest_paths.unweighted.single_source_shortest_path_lengthnetworkx.readwrite.gml.read_gmlnetworkx.algorithms.bridges.bridgesnetworkx.algorithms.connectivity.connectivity.local_edge_connectivitynetworkx.algorithms.bipartite.basic.densitynetworkx.algorithms.connectivity.stoerwagner.stoer_wagnernetworkx.algorithms.connectivity.edge_augmentation.unconstrained_bridge_augmentationnetworkx.algorithms.simple_paths.is_simple_pathnetworkx.algorithms.assortativity.connectivity.average_degree_connectivitynetworkx.generators.interval_graph.interval_graphnetworkx.generators.sudoku.sudoku_graphnetworkx.classes.graph.Graph.has_nodenetworkx.algorithms.operators.binary.unionnetworkx.algorithms.link_prediction.common_neighbor_centralitynetworkx.algorithms.cluster.generalized_degreenetworkx.algorithms.traversal.breadth_first_search.bfs_predecessorsnetworkx.drawing.layout.spectral_layoutnetworkx.algorithms.similarity.generate_random_pathsnetworkx.generators.random_clustered.random_clustered_graphnetworkx.algorithms.chordal._chordal_graph_cliquesnetworkx.classes.graph.Graph.remove_edgenetworkx.classes.function.is_weightednetworkx.readwrite.gexf.generate_gexfnetworkx.algorithms.community.kclique.k_clique_communitiesnetworkx.algorithms.connectivity.edge_augmentation.weighted_one_edge_augmentationnetworkx.algorithms.coloring.greedy_coloring.greedy_colornetworkx.classes.function.number_of_selfloopsnetworkx.generators.community.random_partition_graphnetworkx.readwrite.multiline_adjlist.write_multiline_adjlistnetworkx.drawing.layout.spiral_layoutnetworkx.readwrite.graphml.write_graphml_lxmlnetworkx.readwrite.graph6.from_graph6_bytesnetworkx.algorithms.tree.recognition.is_treenetworkx.algorithms.shortest_paths.weighted.single_source_bellman_ford_path_lengthnetworkx.readwrite.gpickle.write_gpicklenetworkx.classes.digraph.DiGraph.to_undirectednetworkx.drawing.layout.shell_layoutnetworkx.drawing.nx_pylab.draw_networkx_edge_labelsnetworkx.classes.multidigraph.MultiDiGraphnetworkx.algorithms.shortest_paths.weighted.bellman_ford_pathnetworkx.algorithms.node_classification.hmn.harmonic_functionnetworkx.algorithms.shortest_paths.weighted.all_pairs_dijkstra_path_lengthnetworkx.algorithms.shortest_paths.weighted.all_pairs_bellman_ford_path_lengthnetworkx.classes.digraph.DiGraphnetworkx.algorithms.bipartite.edgelist.generate_edgelistnetworkx.algorithms.traversal.edgedfs.edge_dfsnetworkx.algorithms.tree.mst.minimum_spanning_edgesnetworkx.algorithms.distance_regular.global_parametersnetworkx.algorithms.shortest_paths.unweighted.predecessornetworkx.algorithms.centrality.eigenvector.eigenvector_centrality_numpynetworkx.algorithms.connectivity.edge_augmentation.partial_k_edge_augmentationnetworkx.classes.graph.Graph.__contains__networkx.algorithms.similarity.panther_similaritynetworkx.algorithms.link_prediction.preferential_attachmentnetworkx.algorithms.matching.is_maximal_matchingnetworkx.algorithms.approximation.traveling_salesman.traveling_salesman_problemnetworkx.algorithms.assortativity.correlation.numeric_assortativity_coefficientnetworkx.algorithms.components.connected.node_connected_componentnetworkx.readwrite.gml.generate_gmlnetworkx.algorithms.communicability_alg.communicabilitynetworkx.algorithms.shortest_paths.weighted.all_pairs_bellman_ford_pathnetworkx.readwrite.edgelist.read_edgelistnetworkx.algorithms.tree.coding.from_prufer_sequencenetworkx.algorithms.operators.binary.disjoint_unionnetworkx.algorithms.operators.binary.full_joinnetworkx.algorithms.connectivity.cuts.minimum_node_cutnetworkx.algorithms.moral.moral_graphnetworkx.classes.graph.Graph.__getitem__networkx.algorithms.connectivity.edge_augmentation.complement_edgesnetworkx.drawing.nx_agraph.pygraphviz_layoutnetworkx.convert.to_dict_of_dictsnetworkx.classes.digraph.DiGraph.add_edges_fromnetworkx.classes.graph.Graph.copynetworkx.algorithms.shortest_paths.weighted.single_source_dijkstra_path_lengthnetworkx.drawing.layout.spring_layoutnetworkx.classes.digraph.DiGraph.clear_edgesnetworkx.algorithms.bipartite.basic.is_bipartitenetworkx.algorithms.communicability_alg.communicability_expnetworkx.classes.digraph.DiGraph.clearnetworkx.algorithms.shortest_paths.weighted.single_source_dijkstranetworkx.algorithms.operators.product.strong_productnetworkx.algorithms.traversal.edgebfs.edge_bfsnetworkx.algorithms.link_prediction.adamic_adar_indexnetworkx.algorithms.approximation.clustering_coefficient.average_clusteringnetworkx.linalg.bethehessianmatrix.bethe_hessian_matrixnetworkx.generators.line.line_graphnetworkx.algorithms.covering.is_edge_covernetworkx.classes.function.add_starnetworkx.algorithms.bipartite.projection.generic_weighted_projected_graphnetworkx.generators.directed.gnr_graphnetworkx.algorithms.isomorphism.isomorphvf2.GraphMatcher.__init__networkx.algorithms.components.biconnected.is_biconnectednetworkx.algorithms.components.connected.number_connected_componentsnetworkx.algorithms.traversal.breadth_first_search.generic_bfs_edgesnetworkx.convert.from_dict_of_dictsnetworkx.algorithms.shortest_paths.generic.shortest_pathnetworkx.algorithms.shortest_paths.astar.astar_pathnetworkx.classes.graph.Graph.__iter__networkx.algorithms.isolate.is_isolatenetworkx.readwrite.json_graph.adjacency.adjacency_graphnetworkx.readwrite.multiline_adjlist.parse_multiline_adjlistnetworkx.drawing.nx_pylab.drawnetworkx.classes.graph.Graph.number_of_edgesnetworkx.algorithms.assortativity.correlation.attribute_assortativity_coefficientnetworkx.algorithms.bipartite.edgelist.parse_edgelistnetworkx.convert_matrix.from_numpy_arraynetworkx.classes.graph.Graph.to_directednetworkx.algorithms.community.quality.modularitynetworkx.algorithms.assortativity.correlation.degree_pearson_correlation_coefficientnetworkx.drawing.layout.random_layoutnetworkx.algorithms.bipartite.spectral.spectral_bipartivitynetworkx.algorithms.shortest_paths.weighted.multi_source_dijkstra_pathnetworkx.algorithms.link_prediction.resource_allocation_indexnetworkx.generators.community.ring_of_cliquesnetworkx.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