OSS TanbouSign in with GitHub

build graphs in Python and analyze paths, centrality, and communities

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
17,310
Primary language
Python
License
Not determined
Repository last updated
Oct 2, 2026
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.

Sources: [1][2]

Measure paths, structure, and importance

Algorithms cover shortest paths, connected components, centrality, clustering, community detection, and isomorphism. Results are returned as mappings and iterables that can feed Pandas or visualization tools.

Sources: [1][2]

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.

Sources: [1][2]

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.

Sources: [3][4]

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. [1]NetworkX 3.6.1 README(2026-10-04)
  2. [2]NetworkX 3.6.1 tutorial(2026-10-04)
  3. [3]NetworkX 3.6.1 backend documentation(2026-10-04)
  4. [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. 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. 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. 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()))"
Check the official README

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

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
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?