NetworkX

From Wikipedia the free encyclopedia

NetworkX
Original author(s)Aric Hagberg
Pieter Swart
Dan Schult
Developer(s)Many others
Initial release11 April 2005; 19 years ago (2005-04-11)[1][2]
Stable release
3.3[3] Edit this on Wikidata / 6 April 2024; 22 days ago (6 April 2024)
Repository
Written inPython
Operating systemCross-platform
TypeSoftware library
LicenseBSD-new license
Websitenetworkx.github.io

NetworkX is a Python library for studying graphs and networks. NetworkX is free software released under the BSD-new license.

History[edit]

NetworkX began development in 2002 by Aric A. Hagberg, Daniel A. Schult, and Pieter J. Swart.[4] It is supported by the National Nuclear Security Administration of the U.S. Department of Energy at Los Alamos National Laboratory.

The package was crafted with the aim of creating tools to analyze data and intervention strategies for controlling the epidemic spread of disease, while also exploring the structure and dynamics of more general social, biological, and infrastructural systems.[4]

The initial implementation drew inspiration from Guido van Rossum's 1998 essay[5] on Python graph representation. The package's public debut was made during the 2004 SciPy annual conference.[4] In April of 2005, NetworkX was made available as open source software.[1]

In 2008, SageMath, an open source mathematics system, incorporated NetworkX into its package and added support for more graphing algorithms and functions.[4]

Major NetworkX Releases
Version Release Date
0.22[6]
17 June 2005
0.99[6]
18 November 2008
1.0[6]
8 January 2010
2.0[6]
20 September 2017
3.0[7]
7 January 2023

Features[edit]

Supported Graph Types[edit]

Overview[edit]

Graphs, in this context, represent collections of vertices (nodes) and edges (connections) between them. NetworkX provides support for several types of graphs, each suited for different applications and scenarios.

Directed Graphs (DiGraph)[edit]

Directed graphs, or DiGraphs, consist of nodes connected by directed edges. In a directed graph, edges have a direction indicating the flow or relationship between nodes. [8]

Directed graph made using NetworkX

Undirected Graphs (Graph)[edit]

Undirected graphs, simply referred to as graphs in NetworkX, are graphs where edges have no inherent direction. The connections between nodes are symmetrical, meaning if node A is connected to node B, then node B is also connected to node A. [9]

Undirected graph made using NetworkX

MultiGraphs[edit]

MultiGraphs allow multiple edges between the same pair of nodes. In other words, MultiGraphs permit parallel edges, where more than one edge can exist between two nodes. [10]

MultiGraph made using NetworkX

MultiDiGraphs[edit]

MultiDiGraphs are directed graphs that allow multiple directed edges between the same pair of nodes. Similar to MultiGraphs, MultiDiGraphs enable the modeling of scenarios where multiple directed relationships exist between nodes. [11]

MultiDiGraph made using NetworkX

Suitability[edit]

NetworkX is suitable for operation on large real-world graphs: e.g., graphs in excess of 10 million nodes and 100 million edges.[clarification needed][12] Due to its dependence on a pure-Python "dictionary of dictionary" data structure, NetworkX is a reasonably efficient, very scalable, highly portable framework for network and social network analysis.[4]

Applications[edit]

NetworkX was designed to be easy to use and learn, as well as a powerful and sophisticated tool for network analysis. It is used widely on many levels, ranging from computer science and data analysis education to large-scale scientific studies.[4]

NetworkX has applications in any field that studies data as graphs or networks, such as mathematics, physics, biology, computer science and social science.[13] The nodes in a NetworkX graph can be specialized to hold any data, and the data stored in edges is arbitrary, further making it widely applicable to different fields. It is able to read in networks from data and randomly generate networks with specified qualities. This allows it to be used to explore changes across wide amounts of networks.[4]

Graph representations of several spanning tree networks in Karger's algorithm

NetworkX has many network and graph analysis algorithms, aiding in a wide array of data analysis purposes. For example, in one study, it was used to analyze the resilience of livestock production networks to the spread of epidemics. In this study, NetworkX was used to find information on degree, shortest paths, clustering, and k-cores.[14]

In addition to network creation and analysis, NetworkX also has many visualization capabilities. It provides hooks into Matplotlib and GraphViz for 2D visuals, and VTK and UbiGraph for 3D visuals.[4] This makes the package useful in easily demonstrating and reporting network analysis and data, and allows for the simplification of networks for visual processing.

Integration[edit]

NetworkX is integrated into SageMath.[15]

See also[edit]

References[edit]

  1. ^ a b NetworkX first public release (NX-0.2), From: Aric Hagberg, Date: 12 April 2005, Python-announce-list mailing list
  2. ^ NetworkX initial release, NX-0.2, hagberg – 2005-04-11, Project Info – NetworkX, Registered: 2004-10-21, SourceForge.net
  3. ^ "Release 3.3". 6 April 2024. Retrieved 8 April 2024.
  4. ^ a b c d e f g h Aric A. Hagberg, Daniel A. Schult, Pieter J. Swart, Exploring Network Structure, Dynamics, and Function using NetworkX, Proceedings of the 7th Python in Science conference (SciPy 2008), G. Varoquaux, T. Vaught, J. Millman (Eds.), pp. 11–15.
  5. ^ van Rossum, Guido (February 1998). "Python Patterns - Implementing Graphs". Python.
  6. ^ a b c d "Old Release Log". NetworkX. 22 August 2020. Retrieved 24 April 2024.
  7. ^ "NetworkX 3.0". NetworkX. 7 January 2023. Retrieved 24 April 2024.
  8. ^ "DiGraph—Directed graphs with self loops — NetworkX 3.3 documentation". networkx.org. Retrieved 2024-04-24.
  9. ^ "Graph—Undirected graphs with self loops — NetworkX 3.3 documentation". networkx.org. Retrieved 2024-04-24.
  10. ^ "MultiGraph—Undirected graphs with self loops and parallel edges — NetworkX 3.3 documentation". networkx.org. Retrieved 2024-04-24.
  11. ^ "MultiDiGraph—Directed graphs with self loops and parallel edges — NetworkX 3.3 documentation". networkx.org. Retrieved 2024-04-24.
  12. ^ Aric Hagberg, Drew Conway, "Hacking social networks using the Python programming language (Module II – Why do SNA in NetworkX)", Sunbelt 2010: International Network for Social Network Analysis.
  13. ^ Hadaj, P.; Strzałka, D.; Nowak, M. (19 October 2022). "The use of PLANS and NetworkX in modeling power grid system failures". Sci Rep. 12.
  14. ^ Wiltshire, Serge W. (March 9, 2018). "Using an agent-based model to evaluate the effect of producer specialization on the epidemiological resilience of livestock production networks". PLOS ONE.
  15. ^ "SageMath Mathematical Software System - Sage".

External links[edit]