Programmatic graph construction, analysis and visualization limited
igraph → NetworkX
Can replace supported scripted network analyses and provides Python conversion helpers. Algorithms, node identity and component versions need checking; it is not a drop-in replacement for NetworkX APIs or every arbitrary Python attribute.
Platforms: Windows, macOS, Linux · Region: Version, build and integration requirements apply
Programmatic graph construction and network-analysis pipelines limited
NetworkX → igraph
Can 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.
Platforms: Windows, macOS, Linux · Region: Version, build and integration requirements apply
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
supported
Graph 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