pypi / networkx
networkx
What changed in networkx 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
17 breaking3 deprecations32 new APIs and options7 performance6 behavior and defaults1 tooling33 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initnetworkx 399 changes
Breaking changes 17
Removes deprecated could-be isomorphism aliases.
Raises an error when a negative cycle is found.
Decoders now reject out-of-range bytes.
Deprecated aliases for isomorphism checking are removed.
Now returns a set instead of a list.
Python 3.11 is dropped from supported versions.
The random lobster dependency is expired.
The map returned by vf2pp functions is reversed.
Raises ValueError for mixed typed attributes.
Its deprecation expires, so the deprecated API is removed.
Raises an error when called on directed graphs.
Removes the unused dissuade_hubs keyword argument.
Replaces maybe_regular_expander.
This API is removed.
The deprecated link keyword argument is removed from node-link functions.
Updates semantics for nonisomorphic trees with order 0 or 1.
Replaces random_lobster.
Deprecations 3
A proposal to deprecate this API is noted.
The p2g module is deprecated.
The function is deprecated.
New APIs and options 32
Adds a format parameter.
Adds Barber's bipartite modularity quality function.
Adds butterflies() to the bipartite cluster module.
Flow algorithms accept a callable capacity parameter.
Adds centroid as an alias for barycenter.
Adds an optional sp argument.
Adds DAG antichain width functionality.
Floyd-Warshall accepts a callable as the weight parameter.
Adds a nonedge argument to support completing the roundtrip.
Adds description and keywords support.
Adds Leiden-based community detection as an alternative to Louvain functions.
Adds Leiden-based community detection as an alternative to Louvain functions.
Adds magnetic_laplacian_matrix.
Adds a sample-count parameter for multi-sample averaging in rich_club_coefficient.
Adds a generator for a random k-lift of a d-regular graph.
Adds basic random walk utilities.
Adds Shen's overlapping modularity quality function.
VF2++ adds subgraph isomorphism checking.
VF2++ adds subgraph monomorphism checking.
Supports nodelists when creating a graph from a biadjacency matrix.
Adds greedy bipartition using node swaps.
Adds spectral bipartition community finding.
Adds a generator yielding all unique triangles in a graph.
Adds a method providing basic information about graphs.
Adds a directed star graph generator.
Adds missing connection styles.
Adds a directed keyword argument.
Graph classes can be dispatched using a backend argument.
Adds the hyper_wiener_index function.
Adds is_perfect_graph using SPGT.
Adds panther++.
Implements an algorithm to find the centroid or centroids of a tree.
Performance 7
Uses linear algebra to compute communicability.
Fixes an accidentally quadratic use of a list as a queue.
Bidirectional Dijkstra is optimized, with reported speedups from 1.1x to 25x.
Optimizes harmonic centrality.
Optimizes is_reachable.
Short-circuits the check for directed graphs.
Dijkstra paths to a target are optimized, with graphs having multiple-hop shortest paths reported as about 50 times faster.
Behavior and default changes 6
Aligns the keys default with kruskal and prim.
Power iteration becomes the default HITS implementation.
Symmetry-aware isomorphism and subgraph checks now support directed and multigraphs, as well as non-induced subgraph monomorphism.
A proposal suggests adding density to the defaults; the notes do not establish that it shipped.
Adds GEXF 1.3 to the recognized GEXF versions.
Adds support for directed graphs and multigraphs.
Tooling 1
The library is provided via pip with wheels that include GraphViz binaries, making the NetworkX interface easier to use for layout and rendering.
Fixes and other changes 33
Fixes ARF layout behavior with zero iterations.
Fixes edge cases for n < 2.
Fixes errors for null graphs.
Fixes handling of non-array complete initial positions.
Fixes incorrect values and path counting, adjustments for zero sigma, KeyErrors, and normalization when endpoints is true.
Handles small graphs.
Handles empty candidate sets.
Avoids infinite loops in Louvain.
Escapes quotes and backslashes in Pajek string output.
Fixes the cost function.
Fixes node connectivity and node cuts for directed graphs.
Handles insufficient degree Pearson samples.
Adds support for Python 3.15.
Preserves all attributes in dispatch conversions.
Fixes an AttributeError when calling next() directly.
Handles dim >= len(G).
Fixes layouts with an empty list of fixed nodes.
Fixes spring energy layout behavior with zero iterations.
Preserves string positions when converting to a graphviz AGraph.
Fixes handling of isolated subgraph nodes.
Writes dynamic GEXF boolean attribute values using xsd:boolean true/false.
Fixes handling of a list for node_shape when drawing nodes.
Allows graph subclasses to have additional arguments.
Updates the computation to use k directly.
Backend names are validated as Python identifiers.
Pins the last value to 1.0 to address floating-point errors.
Adds a check for isolated nodes.
Makes the functions consistent with their definitions.
Fixes scaling when k is less than the number of nodes.
Allows graphs with nonstandard node labels.
Adds input validation and clarifies its behavior.
Fixes handling of self-loops.
Improves the error message for the removed function.