On this page
Overview
NetworkX is a Python library for representing people, devices, roads, dependencies, and other systems as nodes and edges. One API covers graph construction, format conversion, algorithms, and data preparation for visualization.
Features and best fit
Hands-on tested within the scope below · Content checked:
Key features
Represent attributed graphs as Python objects
It supports undirected and directed graphs as well as graphs with parallel edges, with arbitrary attributes on nodes and edges. Adjacency lists, common file formats, and tabular data help turn existing datasets into relationship models.
Best fit
Explore questions where relationships drive the answer
It fits communication routes, organizational ties, software dependencies, transportation networks, and other analyses where connectivity matters more than isolated rows. Models and hypotheses can be changed quickly in Python for research, teaching, and prototypes.
Before adoption
Estimate graph size and algorithmic complexity
Its Python object model can make memory and execution time limiting for very large graphs or low-latency workloads. NetworkX can use several backends, but supported algorithms and behavior must be checked and measured on representative data. GitHub reports NOASSERTION, while LICENSE.txt at the fixed tag explicitly states the 3-clause BSD license.
3.6.1 / Python virtual environment on local host
Installed the pinned package and ran the documented graph example, checking shortest path, degree centrality, and GraphML output.
Official sources
- [1]NetworkX 3.6.1 README(2026-10-04)
- [2]NetworkX 3.6.1 tutorial(2026-10-04)
- [3]NetworkX 3.6.1 backend documentation(2026-10-04)
- [4]NetworkX 3.6.1 license(2026-10-04)
Supplemental curator note
NetworkX makes relationship-heavy questions approachable from a few lines of Python. For large graphs, evaluate the complexity of the chosen algorithm and available alternative backends before committing to an architecture.
Try it in 3 steps
- 1
Install 3.6.1 in an isolated environment
With Python 3.11 or later available, install the pinned release into a working virtual environment.
python3 -m venv networkx-demo && . networkx-demo/bin/activate && python -m pip install 'networkx==3.6.1' - 2
Calculate a path and centrality
Build a small network and print the shortest path from backup to server plus degree centrality for every node. Confirm the path crosses switch and router and switch tie for the highest centrality.
python -c "import networkx as nx; g=nx.Graph([('router','switch'),('switch','server'),('router','backup')]); print('path:', nx.shortest_path(g,'backup','server')); print('centrality:', sorted(nx.degree_centrality(g).items(), key=lambda x: -x[1]))" - 3
Write an interchange file
Save the same graph as GraphML, read it back, and confirm that all four nodes and three edges remain.
python -c "import networkx as nx; g=nx.Graph([('router','switch'),('switch','server'),('router','backup')]); nx.write_graphml(g,'network.graphml'); h=nx.read_graphml('network.graphml'); print('nodes:', sorted(h.nodes())); print('edges:', sorted(tuple(sorted(e)) for e in h.edges()))"
Growth
Growth trends · Last 30 days
17,310 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 31
- Open PRs
- 184
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- python
- complex-networks
- graph-theory
- graph-algorithms
- graph-analysis
- graph-generation
- graph-visualization
- Stars
- 17,310
- Forks
- 3,629
- Watchers
- 279
- Open issues
- 130
- Contributors
- 857
- Owner type
- Organization
- Primary language
- Python
- License
- Not determined
- Repository last updated
- Oct 2, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- SymPy14,987 Stars
2 shared tag(s) · 1 shared category(s) · Same language
keep mathematics symbolic and transform or solve it in Python
Python - JupyterLab15,331 Stars
2 shared tag(s) · 1 shared category(s)
keep code, explanation, results, and files in one workspace
TypeScript - Streamlit45,893 Stars
2 shared tag(s) · Same language
Turn Python scripts into interactive data apps with widgets, dataframes, charts, multipage navigation, and chat
Python - NumPy32,930 Stars
2 shared tag(s) · Same language
provide N-dimensional arrays, broadcasting, linear algebra, FFTs, and random-number primitives for the Python numerical ecosystem
Python - NetBox21,652 Stars
2 shared tag(s) · Same language
manage network assets and IP data as a source of truth for automation
Python - LangChain147,418 Stars
1 shared tag(s) · 1 shared category(s) · Same language
compose models, tools, retrieval, and middleware into agents
Python
Report incorrect information
Tell us if any listing information is incorrect or outdated.