software · Q976
NetworkX
Python graph data structures and algorithms for network analysis and manipulation.
Overview
NetworkX is a Python package for constructing, manipulating and analyzing graphs. It supplies graph classes, generators, algorithms, file interchange and basic drawing facilities. It is a programming library rather than a complete interactive network-analysis desktop, making data modeling and reproducible scripts central to its use.[1][2]
Choose the graph model
Graph and DiGraph represent undirected and directed graphs without parallel edges, while MultiGraph and MultiDiGraph preserve multiple edges between endpoints. Nodes can be any hashable Python objects, and attributes can hold arbitrary data. This flexibility makes graph-class choice important: loading repeated relationships into a simple graph does not represent the same structure as retaining distinct multiedges.[2]
Scripts and dependencies
NetworkX 3.7 documents Python 3.12–3.14 support. The base package is pure Python without hard dependencies, but drawing and several analytical facilities use optional scientific-Python packages. Additional integrations include Graphviz-based drawing through PyGraphviz. An environment that can import NetworkX therefore does not necessarily contain everything needed to run an existing plotting or numerical workflow.[3]
GraphML import details
The reader chooses directed or undirected graph classes from the file and returns a multigraph when parallel edges are present or requested. Default node and edge attributes remain in graph-level dictionaries rather than being copied onto every element. Downstream code that only inspects an element's own attribute dictionary may consequently need to apply those defaults explicitly.[4]
Interchange limitations
The documented GraphML implementation does not cover mixed directed and undirected edges, hyperedges, nested graphs or ports. The writer can infer a common numeric attribute type when requested, rather than treating all Python values as automatically serializable. A graph's in-memory flexibility should not be confused with complete preservation through a particular exchange format.[4][5]
Backends and cached conversions
Optional third-party backends can supply different implementations and may require specialized hardware, operating systems or services. Backend fallback is disabled by default. Converted graph caching can improve repeated calls but consumes memory; directly mutating attribute dictionaries can leave a cached conversion stale, whereas documented graph mutation methods clear it. Backend configuration and data-update patterns are therefore part of the reproducibility context.[3][6]
Licensing and substitution
NetworkX uses the three-clause BSD license and is a candidate substitute for igraph for supported scripted graph analyses. The choice depends on needed algorithms, data representation and deployment requirements. This is not a claim of equivalent performance, identical defaults or source-code compatibility; representative analyses should retain their graph model and parameter choices during migration.[1][2][7]
Capabilities & limitations
Programmatic network analysis
supportedGraph classes and algorithms support scripted graph construction, manipulation and analysis.[1][2]
Programmatic graph construction and network-analysis pipelines · Windows, macOS, Linux · Version, build and integration requirements apply
2 sources · check evidence
Graph algorithms, portability and BSD license
vendor · checked 2026-10-07Graph classes, hashable nodes, attributes and live views
vendor · checked 2026-10-07Complete GraphML interchange
unsupportedThe implementation excludes mixed directed/undirected graphs, hyperedges, nested graphs and ports.[4][5]
Programmatic graph construction and network-analysis pipelines · Windows, macOS, Linux · Version, build and integration requirements apply
2 sources · check evidence
GraphML defaults, returned graph class and unsupported constructs
vendor · checked 2026-10-07Unsupported mixed graphs, hyperedges, nesting and ports
vendor · checked 2026-10-07Automatic backend fallback
limitedFallback to the NetworkX implementation is disabled by default and must be configured where needed.[6]
Programmatic graph construction and network-analysis pipelines · Windows, macOS, Linux · Version, build and integration requirements apply
1 source · check evidence
Fallback default and converted-graph cache consistency
vendor · checked 2026-10-07Can substitute for
These are products or services this entry can replace. Check the task and limitations for each comparison.
igraph for Programmatic graph construction and network-analysis pipelines
limitedCan replace supported programmatic graph-analysis workflows when Python graph objects and algorithms fit. Code, node identity, multiedge semantics and backend behavior require adaptation rather than assuming an API-compatible swap.[2][3][7]
Windows, macOS, Linux · Version, build and integration requirements apply
References
- NetworkX overview
Graph algorithms, portability and BSD license
vendor · retrieved 2026-10-07 - NetworkX introduction
Graph classes, hashable nodes, attributes and live views
vendor · retrieved 2026-10-07 - NetworkX installation and dependencies
3.7 Python requirements, optional scientific stack and backends
vendor · retrieved 2026-10-07 - NetworkX GraphML reader
GraphML defaults, returned graph class and unsupported constructs
vendor · retrieved 2026-10-07 - NetworkX GraphML writer
Unsupported mixed graphs, hyperedges, nesting and ports
vendor · retrieved 2026-10-07 - NetworkX backend configuration
Fallback default and converted-graph cache consistency
vendor · retrieved 2026-10-07 - Python igraph
Graph analysis, conversion and plotting
vendor · retrieved 2026-10-07
Discussion & disputes
Ask about unclear claims or explain a concern with supporting sources. If you have a specific fix, suggest a correction.
No discussion yet.
Revision history
Open a revision to read an earlier version of this article.
| Revision | Timestamp | Edit summary |
|---|---|---|
| 1024 | 2026-10-13 17:38:46 | /* wbeditentity-create-item:0| */ sf:2305fd0d-1913-45a1-a6a6-d89a6091c9f4:v1 | Adds NetworkX with explicit graph-class semantics, GraphML subset/default-attribute limits and optional backend caching/fallback behavior. | attribution: /proposals/2305fd0d-1913-45a1-a6a6-d89a6091c9f4 |