https://github.com/JuliaGraphs/Graphs.jl
An optimized graphs package for the Julia programming language
https://github.com/JuliaGraphs/Graphs.jl
data-structures datastructures graph graph-algorithms graph-analytics graph-theory graphs hacktoberfest julia juliagraphs
Last synced: about 16 hours ago
JSON representation
An optimized graphs package for the Julia programming language
- Host: GitHub
- URL: https://github.com/JuliaGraphs/Graphs.jl
- Owner: JuliaGraphs
- License: other
- Created: 2021-10-11T21:25:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2026-02-19T20:50:17.000Z (8 days ago)
- Last Synced: 2026-02-19T22:30:49.180Z (8 days ago)
- Topics: data-structures, datastructures, graph, graph-algorithms, graph-analytics, graph-theory, graphs, hacktoberfest, julia, juliagraphs
- Language: Julia
- Homepage: http://juliagraphs.org/Graphs.jl/
- Size: 19.2 MB
- Stars: 525
- Watchers: 13
- Forks: 122
- Open Issues: 147
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Citation: CITATION.bib
Awesome Lists containing this project
- awesome-julia - An optimized graphs package for the Julia programming language
README
# Graphs.jl
[](https://juliagraphs.org/Graphs.jl/stable/)
[](https://juliagraphs.org/Graphs.jl/dev/)
[](https://github.com/JuliaGraphs/Graphs.jl/actions/workflows/ci.yml?query=branch%3Amaster)
[](https://codecov.io/github/JuliaGraphs/Graphs.jl?branch=master)
[](https://github.com/invenia/BlueStyle)
[](https://github.com/JuliaTesting/Aqua.jl)
[](https://github.com/SciML/ColPrac)
## Overview
The goal of _Graphs.jl_ is to offer a performant platform for network and graph analysis in Julia, following the example of libraries such as [NetworkX](http://networkx.github.io) in Python. To this end, _Graphs.jl_ offers:
- a set of simple, concrete graph implementations -- `SimpleGraph` (for undirected graphs) and `SimpleDiGraph` (for directed graphs)
- an API for the development of more sophisticated graph implementations under the `AbstractGraph` type
- a large collection of graph algorithms with the same requirements as this API.
## Installation
Installation is straightforward. First, enter Pkg mode by hitting `]`, and then run the following command:
```julia-repl
pkg> add Graphs
```
## Basic use
_Graphs.jl_ includes numerous convenience functions for generating graphs, such as `path_graph`, which builds a simple undirected [path graph](https://en.wikipedia.org/wiki/Path_graph) of a given length. Once created, these graphs can be easily interrogated and modified.
```julia-repl
julia> g = path_graph(6)
{6, 5} undirected simple Int64 graph
# Number of vertices
julia> nv(g)
6
# Number of edges
julia> ne(g)
5
# Add an edge to make the path a loop
julia> add_edge!(g, 1, 6);
```
## Documentation
The full documentation is available at [GitHub Pages](https://juliagraphs.org/Graphs.jl/dev/). Documentation for methods is also available via the Julia REPL help system.
Additional tutorials can be found at [JuliaGraphsTutorials](https://github.com/JuliaGraphs/JuliaGraphsTutorials).
## Citing
We encourage you to cite our work if you have used our libraries, tools or datasets. Starring the _Graphs.jl_ repository on GitHub is also appreciated.
The latest citation information may be found in the [CITATION.bib](https://raw.githubusercontent.com/JuliaGraphs/Graphs.jl/master/CITATION.bib) file within the repository.
## Contributing
We welcome contributions and bug reports!
Please see [CONTRIBUTING.md](https://github.com/JuliaGraphs/Graphs.jl/blob/master/CONTRIBUTING.md) for guidance on development and bug reporting.
JuliaGraphs development subscribes to the [Julia Community Standards](https://julialang.org/community/standards/).
## Related packages
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.
Additional functionality like advanced IO and file formats, weighted graphs, property graphs, and optimization-related functions can be found in the packages of the [JuliaGraphs organization](https://juliagraphs.org/).
## Project history
_Graphs.jl_ is the successor to _LightGraphs.jl_ (archived October 2021); see the [CHANGELOG](CHANGELOG.md) for the full transition history.