Graphs offers both (a) a set of simple, concrete graph implementations -- Graph
(for undirected graphs) and DiGraph
(for directed graphs), and (b) an API for
the development of more sophisticated graph implementations under the AbstractGraph
type.
The project goal is to mirror the functionality of robust network and graph analysis libraries such as NetworkX. It is an explicit design decision that any data not required for graph manipulation (attributes and other information, for example) is expected to be stored outside of the graph structure itself. Such data lends itself to storage in more traditional and better-optimized mechanisms.
Additional functionality may be found in a number of companion packages, including:
- LightGraphsExtras.jl: extra functions for graph analysis.
- MetaGraphs.jl: graphs with associated meta-data.
- SimpleWeightedGraphs.jl: weighted graphs.
- GraphIO.jl: tools for importing and exporting graph objects using common file types like edgelists, GraphML, Pajek NET, and more.
Full documentation is available at GitHub Pages. Documentation for methods is also available via the Julia REPL help system. Additional tutorials can be found at JuliaGraphsTutorials.
Installation is straightforward: enter Pkg mode by hitting ]
, and then
(v1.0) pkg> add Graphs
- Graphs master is generally designed to work with the latest stable version of Julia (except during Julia version increments as we transition to the new version).
- The project was previously developed under the name LightGraphs and older versions of LightGraphs (≤ v1.3.5) must still be used with that name.
- There was also an older package also called Graphs (git tags
v0.2.5
throughv0.10.3
), but the current code base here is a fork of LightGraphs v1.3.5. - All older LightGraphs versions are tagged using the naming scheme
lg-vX.Y.Z
rather than plainvX.Y.Z
which is used for old Graphs versions (≤ v0.10) and newer versions derived from LightGraphs but released with the Graphs name (≥ v1.4). - If you are using a version of Julia prior to 1.x, then you should use LightGraphs.jl at
lg-v.12.*
or Graphs.jl atv0.10.3
- Later versions: Some functionality might not work with prerelease / unstable / nightly versions of Julia. If you run into a problem, please file an issue.
We welcome contributions and bug reports! Please see CONTRIBUTING.md for guidance on development and bug reporting.
JuliaGraphs development subscribes to the Julia Community Standards.
The Graphs project is a reboot of the LightGraphs package (archived in October 2021), which remains available on GitHub at sbromberger/LightGraphs.jl. If you don't need any new features developed since the fork, you can continue to use older versions of LightGraphs indefinitely. New versions will be released here using the name Graphs instead of LightGraphs. There was an older package also called Graphs. The source history and versions are still available in this repository, but the current code base is unrelated to the old Graphs code and is derived purely from LightGraphs. To access the history of the old Graphs code, you can start from commit 9a25019.
Transition from LightGraphs to Graphs:
LightGraphs and Graphs are functionally identical, still there are some steps involved making the change:
- Change
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
toGraphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
in your Project.toml. - Update your
using
andimport
statements. - Update your type constraints and other references to
LightGraphs
toGraphs
. - Increment your version number. Following semantic versioning, we suggest a patch release when no graphs or other
Graphs.jl
-objects can be passed through the API of your package by those depending on it, otherwise consider it a breaking release. "Passed through" entails created outside and consumed inside your package and vice versa. - Tag a release.
We encourage you to cite our work if you have used our libraries, tools or datasets, refer to CITATION.bib
.
Starring the repository on GitHub is also appreciated.