Next Release

Release date: TBD

Supports Python 3.7, 3.8, and 3.9.

NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.

For more information, please visit our website and our gallery of examples Please send comments and questions to the networkx-discuss mailing list.


This release is the result of X of work with over X pull requests by X contributors. Highlights include:

  • Dropped support for Python 3.6.

  • NumPy, SciPy, Matplotlib, and pandas are now default requirements.

  • Improved example gallery

  • Removed code for supporting Jython/IronPython

  • The __str__ method for graph objects is more informative and concise.

  • Improved import time

  • Improved test coverage

  • New documentation theme

  • Add functionality for drawing self-loop edges

  • Add approximation algorithms for Traveling Salesman Problem

New functions:

  • Panther algorithm

  • maximum cut heuristics

  • equivalence_classes

  • dedensification

  • random_ordered_tree

  • forest_str

  • snap_aggregation

  • networkx.approximation.diameter

  • partition_quality

  • prominent_group

  • prefix_tree_recursive

  • topological_generations


NetworkX Enhancement Proposals capture changes that are larger in scope than typical pull requests, such as changes to fundamental data structures. The following proposals have come under consideration since the previous release:


  • [#3886] Adds the Panther algorithm for top-k similarity search.

  • [#4138] Adds heuristics for approximating solution to the maximum cut problem.

  • [#4183] Adds equivalence_classes to public API.

  • [#4193] is more concise.

  • [#4198] Improve performance of transitivity.

  • [#4206] UnionFind.union selects the heaviest root as the new root

  • [#4240] Adds dedensification function in a new summarization module.

  • [#4294] Adds forest_str for string representation of trees.

  • [#4319] pagerank uses scipy by default now.

  • [#4841] simrank_similarity uses numpy by default now.

  • [#4317] New source argument to has_eulerian_path to look for path starting at source.

  • [#4356] Use bidirectional_djikstra in shortest_path for weighted graphs to improve performance.

  • [#4361] Adds nodelist argument to triadic_census

  • [#4435] Improve group_betweenness_centrality.

  • [#4446] Add sources parameter to allow computing harmonic_centrality from a subset of nodes.

  • [#4463] Adds the snap summarization algorithm.

  • [#4476] Adds the diameter function for approximating the lower bound on the diameter of a graph.

  • [#4519] Handle negative weights in clustering algorithms.

  • [#4528] Improved performance of edge_boundary.

  • [#4560] Adds prominent_group function to find prominent group of size k in G according to group_betweenness_centrality.

  • [#4588] Graph intersection now works when input graphs don’t have the same node sets.

  • [#4607] Adds approximation algorithms for solving the traveling salesman problem, including christofides, greedy_tsp, simulated_annealing_tsp, and threshold_accepting_tsp.

  • [#4640] prefix_tree now uses a non-recursive algorithm. The original recursive algorithm is still available via prefix_tree_recursive.

  • [#4659] New initial_graph argument to barabasi_albert_graph and dual_barabasi_albert_graph to supply an initial graph to the model.

  • [#4690] modularity_max now supports edge weights.

  • [#4727] Improved performance of scale_free_graph.

  • [#4757] Adds topological_generations function for DAG stratification.

  • [#4768] Improved reproducibility of geometric graph generators.

  • [#4769] Adds margins keyword to draw_networkx_nodes to control node clipping in images with large node sizes.

  • [#4812] Use scipy implementation for hits algorithm to improve performance.

  • [#4847] Improve performance of scipy implementation of hits algorithm.

API Changes

  • [#4183] partition argument of quotient_graph now accepts dicts

  • [#4190] Removed tracemin_chol. Use tracemin_lu instead.

  • [#4216] In to_*_array/matrix, nodes in nodelist but not in G now raise an exception. Use G.add_nodes_from(nodelist) to add them to G before converting.

  • [#4360] Internally nx_pylab.draw_networkx_edges now always generates a list of matplotlib.patches.FancyArrowPatch rather than using a matplotlib.collections.LineCollection for un-directed graphs. This unifies interface for all types of graphs. In addition to the API change this may cause a performance regression for large graphs.

  • [#4384] Added edge_key parameter for MultiGraphs in to_pandas_edgelist

  • [#4461] Added create_using parameter to binomial_tree

  • [#4466] relabel_nodes used to raise a KeyError for a key in mapping that is not a node in the graph, but it only did this when copy was False. Now any keys in mapping which are not in the graph are ignored.

  • [#4502] Moves maximum_independent_set to the clique module in approximation.

  • [#4536] Deprecate performance and coverage in favor of partition_quality, which computes both metrics simultaneously and is more efficient.

  • [#4573] label_propagation_communities returns a dict_values object of community sets of nodes instead of a generator of community sets. It is still iterable, so likely will still work in most user code and a simple fix otherwise: e.g., add iter( ... ) surrounding the function call.

  • [#4545] prefix_tree used to return tree, root but root is now always 0 instead of a UUID generate string. So the function returns tree.

  • [#4545] The variable NIL =”NIL” has been removed from networkx.generators.trees

  • [#3620] The function naive_greedy_modularity_communities now returns a list of communities (like greedy_modularity_communities) instead of a generator of communities.

  • [#4786] Deprecate the attrs keyword argument in favor of explicit keyword arguments in the json_graph module.

  • [#4843] The unused normalized parameter has been removed from communicability_betweeness_centrality

  • [#4850] Added dtype parameter to adjacency_matrix

  • [#4867] The function spring_layout now ignores ‘fixed’ nodes not in the graph


  • [#4238] Deprecate to_numpy_matrix and from_numpy_matrix.

  • [#4279] Deprecate networkx.utils.misc.is_iterator. Use isinstance(obj, instead.

  • [#4280] Deprecate networkx.utils.misc.is_list_of_ints as it is no longer used. See networkx.utils.misc.make_list_of_ints for related functionality.

  • [#4281] Deprecate read_yaml and write_yaml.

  • [#4282] Deprecate read_gpickle and write_gpickle.

  • [#4298] Deprecate read_shp, edges_from_line, and write_shp.

  • [#4319] Deprecate pagerank_numpy, pagerank_scipy.

  • [#4355] Deprecate copy method in the coreview Filtered-related classes.

  • [#4384] Deprecate unused order parameter in to_pandas_edgelist.

  • [#4428] Deprecate jit_data and jit_graph.

  • [#4449] Deprecate consume.

  • [#4448] Deprecate iterable.

  • [#4536] Deprecate performance and coverage in favor of parition_quality.

  • [#4545] Deprecate generate_unique_node.

  • [#4599] Deprecate empty_generator.

  • [#4600] Deprecate default_opener.

  • [#4617] Deprecate hub_matrix and authority_matrix

  • [#4629] Deprecate the Ordered graph classes.

  • [#4802] The nx_yaml function has been removed along with the dependency on pyyaml. Removal implemented via module __getattr__ to patch security warnings related to pyyaml.Loader.

  • [#4826] Deprecate preserve_random_state.

  • [#4827] Deprecate almost_equal.

  • [#4833] Deprecate run.

  • [#4829] Deprecate assert_nodes_equal, assert_edges_equal, and assert_graphs_equal.

  • [#4850] Deprecate adj_matrix.

  • [#4841] Deprecate simrank_similarity_numpy.


<output of>

Merged PRs

<output of>