Current version: 1.7

Get NetworkX from the Python Package Index, or install it with:

easy_install networkx

Questions? Suggestions?

Join the Google group:

You can also open a ticket at the NetworkX Developer Zone.

High productivity software for complex networks

NetworkX is a Python language software package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.

Quick Example

>>> import networkx as nx

>>> G=nx.Graph()
>>> G.add_node("spam")
>>> G.add_edge(1,2)
>>> print(G.nodes())
[1, 2, 'spam']
>>> print(G.edges())
[(1, 2)]



  • Python language data structures for graphs, digraphs, and multigraphs.
  • Nodes can be "anything" (e.g. text, images, XML records)
  • Edges can hold arbitrary data (e.g. weights, time-series)
  • Generators for classic graphs, random graphs, and synthetic networks
  • Standard graph algorithms
  • Network structure and analysis measures
  • Basic graph drawing
  • Open source BSD license
  • Well tested: more than 1500 unit tests
  • Additional benefits from Python: fast prototyping, easy to teach, multi-platform