NetworkX 3.0 (unreleased)#

Release date: TBD

Supports Python …

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:

  • Better syncing between G._succ and G._adj for directed G. And slightly better speed from all the core adjacency data structures. G.adj is now a cached_property while still having the cache reset when G._adj is set to a new dict (which doesn’t happen very often). Note: We have always assumed that G._succ and G._adj point to the same object. But we did not enforce it well. If you have somehow worked around our attempts and are relying on these private attributes being allowed to be different from each other due to loopholes in our previous code, you will have to look for other loopholes in our new code (or subclass DiGraph to explicitly allow this).

  • If your code sets G._succ or G._adj to new dictionary-like objects, you no longer have to set them both. Setting either will ensure the other is set as well. And the cached_properties G.adj and G.succ will be rest accordingly too.

  • If you use the presence of the attribute _adj as a criteria for the object being a Graph instance, that code may need updating. The graph classes themselves now have an attribute _adj. So, it is possible that whatever you are checking might be a class rather than an instance. We suggest you check for attribute _adj to verify it is like a NetworkX graph object or type and then type(obj) is type to check if it is a class.


  • [#5663] Implements edge swapping for directed graphs.

  • [#5883] Replace the implementation of lowest_common_ancestor and all_pairs_lowest_common_ancestor with a “naive” algorithm to fix several bugs and improve performance.

  • [#5912] The mapping argument of the relabel_nodes function can be either a mapping or a function that creates a mapping. relabel_nodes first checks whether the mapping is callable - if so, then it is used as a function. This fixes a bug related for mapping=str and may change the behavior for other mapping arguments that implement both __getitem__ and __call__.

  • [#5898] Implements computing and checking for minimal d-separators between two nodes. Also adds functionality to DAGs for computing v-structures.

  • [#5943] is_path used to raise a KeyError when the path argument contained a node that was not in the Graph. The behavior has been updated so that is_path returns False in this case rather than raising the exception.

API Changes#


Merged PRs#

<output of>


<output of>