{"schemaVersion":"1.0","record":{"label":"NetworkX","description":"Python graph data structures and algorithms for network analysis and manipulation.","aliases":[],"kind":"software","website":"https://networkx.org/","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.","license":"Open-source software under the three-clause BSD license.","lifecycle":"active","example":false,"features":[{"name":"Programmatic network analysis","status":"supported","detail":"Graph classes and algorithms support scripted graph construction, manipulation and analysis.","useCase":"Programmatic graph construction and network-analysis pipelines","platforms":["Windows","macOS","Linux"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://networkx.org/en/","locator":"Graph algorithms, portability and BSD license","retrievedAt":"2026-10-07T16:39:34Z","kind":"vendor"},{"url":"https://networkx.org/documentation/stable/reference/introduction.html","locator":"Graph classes, hashable nodes, attributes and live views","retrievedAt":"2026-10-07T16:37:12Z","kind":"vendor"}]},{"name":"Complete GraphML interchange","status":"unsupported","detail":"The implementation excludes mixed directed/undirected graphs, hyperedges, nested graphs and ports.","useCase":"Programmatic graph construction and network-analysis pipelines","platforms":["Windows","macOS","Linux"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://networkx.org/documentation/stable/reference/readwrite/generated/networkx.readwrite.graphml.read_graphml.html","locator":"GraphML defaults, returned graph class and unsupported constructs","retrievedAt":"2026-10-07T16:36:59Z","kind":"vendor"},{"url":"https://networkx.org/documentation/stable/reference/readwrite/generated/networkx.readwrite.graphml.write_graphml.html","locator":"Unsupported mixed graphs, hyperedges, nesting and ports","retrievedAt":"2026-10-07T16:36:29Z","kind":"vendor"}]},{"name":"Automatic backend fallback","status":"limited","detail":"Fallback to the NetworkX implementation is disabled by default and must be configured where needed.","useCase":"Programmatic graph construction and network-analysis pipelines","platforms":["Windows","macOS","Linux"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://networkx.org/documentation/stable/reference/configs.html","locator":"Fallback default and converted-graph cache consistency","retrievedAt":"2026-10-07T16:36:29Z","kind":"vendor"}]}],"alternatives":[],"slug":"networkx","draftAlternatives":[{"targetSlug":"igraph","status":"limited","detail":"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.","useCase":"Programmatic graph construction and network-analysis pipelines","platforms":["Windows","macOS","Linux"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://networkx.org/documentation/stable/reference/introduction.html","locator":"Graph classes, hashable nodes, attributes and live views","retrievedAt":"2026-10-07T16:37:12Z","kind":"vendor"},{"url":"https://networkx.org/documentation/stable/install.html","locator":"3.7 Python requirements, optional scientific stack and backends","retrievedAt":"2026-10-07T16:36:46Z","kind":"vendor"},{"url":"https://python.igraph.org/en/stable/","locator":"Graph analysis, conversion and plotting","retrievedAt":"2026-10-07T16:37:12Z","kind":"vendor"}]}],"evidence":[{"url":"https://networkx.org/en/","locator":"Graph algorithms, portability and BSD license","retrievedAt":"2026-10-07T16:39:34Z","kind":"vendor"},{"url":"https://networkx.org/documentation/stable/reference/introduction.html","locator":"Graph classes, hashable nodes, attributes and live views","retrievedAt":"2026-10-07T16:37:12Z","kind":"vendor"}],"document":{"version":1,"references":[{"url":"https://networkx.org/en/","locator":"Graph algorithms, portability and BSD license","retrievedAt":"2026-10-07T16:39:34Z","id":"home","title":"NetworkX overview","kind":"vendor"},{"url":"https://networkx.org/documentation/stable/reference/introduction.html","locator":"Graph classes, hashable nodes, attributes and live views","retrievedAt":"2026-10-07T16:37:12Z","id":"intro","title":"NetworkX introduction","kind":"vendor"},{"url":"https://networkx.org/documentation/stable/install.html","locator":"3.7 Python requirements, optional scientific stack and backends","retrievedAt":"2026-10-07T16:36:46Z","id":"install","title":"NetworkX installation and dependencies","kind":"vendor"},{"url":"https://networkx.org/documentation/stable/reference/readwrite/generated/networkx.readwrite.graphml.read_graphml.html","locator":"GraphML defaults, returned graph class and unsupported constructs","retrievedAt":"2026-10-07T16:36:59Z","id":"reader","title":"NetworkX GraphML reader","kind":"vendor"},{"url":"https://networkx.org/documentation/stable/reference/readwrite/generated/networkx.readwrite.graphml.write_graphml.html","locator":"Unsupported mixed graphs, hyperedges, nesting and ports","retrievedAt":"2026-10-07T16:36:29Z","id":"writer","title":"NetworkX GraphML writer","kind":"vendor"},{"url":"https://networkx.org/documentation/stable/reference/configs.html","locator":"Fallback default and converted-graph cache consistency","retrievedAt":"2026-10-07T16:36:29Z","id":"configs","title":"NetworkX backend configuration","kind":"vendor"},{"url":"https://python.igraph.org/en/stable/","locator":"Graph analysis, conversion and plotting","retrievedAt":"2026-10-07T16:37:12Z","id":"igraph","title":"Python igraph","kind":"vendor"}],"overviewCitations":["home","intro"],"licenseCitations":["home"],"sections":[{"id":"model","heading":"Choose the graph model","paragraphs":[{"id":"model-detail","content":[{"text":"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."}],"citations":["intro"]}]},{"id":"workflow","heading":"Scripts and dependencies","paragraphs":[{"id":"workflow-detail","content":[{"text":"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."}],"citations":["install"]}]},{"id":"read","heading":"GraphML import details","paragraphs":[{"id":"read-detail","content":[{"text":"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."}],"citations":["reader"]}]},{"id":"exchange","heading":"Interchange limitations","paragraphs":[{"id":"exchange-detail","content":[{"text":"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."}],"citations":["reader","writer"]}]},{"id":"backends","heading":"Backends and cached conversions","paragraphs":[{"id":"backends-detail","content":[{"text":"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."}],"citations":["install","configs"]}]},{"id":"alternative","heading":"Licensing and substitution","paragraphs":[{"id":"alternative-detail","content":[{"text":"NetworkX uses the three-clause BSD license and is a candidate substitute for "},{"text":"igraph","targetSlug":"igraph"},{"text":" 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."}],"citations":["home","intro","igraph"]}]}]},"id":"Q976","revision":1024,"updatedAt":"2026-10-13T17:38:46Z","sourceUrl":"https://substitutefor.net/entities/Q976?revision=1024"}}