Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# .git-blame-ignore-revs
# Initial converion to uniform formatting
ea6bcfeb71de9d1229bbd411ef9b10cac44fa795
# Formatter v1 improvements
5878e7be4d68b2a1c179d1367aea670db115ebb5
# updating to Formatter v2
f4b70cd8bbbcd43bf127bbe2acf3f7a11aef7942
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ docs/build/
docs/site/
benchmark/.results/*
benchmark/.tune.jld
benchmark/Manifest.toml
.benchmarkci
*.cov
/Manifest.toml
/docs/Manifest.toml
Manifest.toml
/docs/src/index.md
/docs/src/contributing.md
/docs/src/license.md
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml

This file was deleted.

84 changes: 84 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# News

We follow SemVer as most of the Julia ecosystem. Below you might see the "breaking" label even for minor version bumps -- we use it a bit more loosely to denote things that are not breaking by SemVer's definition but might cause breakage to people using internal or experimental APIs or undocumented implementation details.

## unreleased
- `is_articulation(g, v)` for checking whether a single vertex is an articulation point


## v1.14.0 - 2026-02-26
- **(breaking)** `neighbors`, `inneighbors`, and `outneighbors` now return an immutable `FrozenVector` instead of `Vector`
- Louvain community detection algorithm
- Graph views: `ReverseView` and `UndirectedView` for directed graphs
- New graph products: `strong_product`, `disjunctive_product`, `lexicographic_product`, `homomorphic_product`
- `maximum_clique`, `clique_number`, `maximal_independent_sets`, `maximum_independent_set`, `independence_number`
- `regular_tree` generator
- `kruskal_mst` now accepts weight vectors
- `is_planar` planarity test and `planar_maximally_filtered_graph` (PMFG) algorithm
- `count_connected_components` for efficiently counting connected components without materializing them
- `connected_components!` is now exported and accepts an optional `search_queue` argument to reduce allocations
- `is_connected` optimized to avoid allocating component vectors

## v1.13.0 - 2025-06-05
- **(breaking)** Julia v1.10 (LTS) minimum version requirement
- Non-allocating `enumerate_paths!`

## v1.12.0 - 2024-09-29
- New options for `BFSIterator`

## v1.11.0 - 2024-05-05
- DFS and BFS iterators
- Dorogovtsev-Mendes graph generator optimization

## v1.10.0 - 2024-04-05
- Longest path algorithm for DAGs
- All simple paths algorithm

## v1.9.0 - 2023-09-28
- Rewrite of `edit_distance` with edge costs
- Eulerian cycles/trails for undirected graphs
- `mincut` implementation
- `strongly_connected_components_tarjan`

## v1.8.0 - 2023-02-10
- `newman_watts_strogatz` graph generator
- Prufer coding for trees
- `isdigraphical`

## v1.7.0 - 2022-06-19
- Hierarchical documentation structure

## v1.6.0 - 2022-02-09
- **(breaking)** Requires Julia >= v1.6
- **(breaking)** `Base.zero` no longer mandatory for `AbstractGraph`
- Simplified `AbstractGraph` interface

## v1.5.0 - 2022-01-09
- **(breaking)** `merge_vertices` now only works on subtypes of `AbstractSimpleGraph`
- `rich_club` function
- `induced_subgraph` with boolean indexing
- Optional start vertex for `maximum_adjacency_search`

## v1.4.0 - 2021-10-17
- Initial release as Graphs.jl (successor to LightGraphs.jl)

The _Graphs.jl_ project is a reboot of the _LightGraphs.jl_ package (archived in October 2021), which remains available on GitHub at [sbromberger/LightGraphs.jl](https://github.com/sbromberger/LightGraphs.jl). If you don't need any new features developed since the fork, you can continue to use older versions of _LightGraphs.jl_ indefinitely. New versions will be released here using the name _Graphs.jl_ instead of _LightGraphs.jl_. There was an older package also called _Graphs.jl_. The source history and versions are still available in this repository, but the current code base is unrelated to the old _Graphs.jl_ code and is derived purely from _LightGraphs.jl_. To access the history of the old _Graphs.jl_ code, you can start from [commit 9a25019](https://github.com/JuliaGraphs/Graphs.jl/commit/9a2501948053f60c630caf9d4fb257e689629041).

### Transition from LightGraphs to Graphs

_LightGraphs.jl_ and _Graphs.jl_ are functionally identical, still there are some steps involved making the change:

- Change `LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"` to `Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"` in your Project.toml.
- Update your `using` and `import` statements.
- Update your type constraints and other references to `LightGraphs` to `Graphs`.
- 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.

### About versions

- The master branch of _Graphs.jl_ is generally designed to work with versions of Julia starting from the [LTS release](https://julialang.org/downloads/#long_term_support_release) all the way to the [current stable release](https://julialang.org/downloads/#current_stable_release), except during Julia version increments as we transition to the new version.
- Later versions: Some functionality might not work with prerelease / unstable / nightly versions of Julia. If you run into a problem, please file an issue.
- The project was previously developed under the name _LightGraphs.jl_ and older versions of _LightGraphs.jl_ (≤ v1.3.5) must still be used with that name.
- There was also an older package also called _Graphs.jl_ (git tags `v0.2.5` through `v0.10.3`), but the current code base here is a fork of _LightGraphs.jl_ v1.3.5.
- All older _LightGraphs.jl_ versions are tagged using the naming scheme `lg-vX.Y.Z` rather than plain `vX.Y.Z`, which is used for old _Graphs.jl_ versions (≤ v0.10) and newer versions derived from _LightGraphs.jl_ but released with the _Graphs.jl_ 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_ at `v0.10.3`
43 changes: 15 additions & 28 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,46 +1,33 @@
name = "Graphs"
uuid = "86223c79-3864-5bf0-83f7-82e725a168b6"
version = "1.13.0"
version = "1.14.0"

[deps]
ArnoldiMethod = "ec485272-7323-5ecc-a04f-4719b315124d"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Inflate = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SharedArrays = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
SimpleTraits = "699a6c99-e7fa-54fc-8d76-47d257e15c1d"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[weakdeps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
SharedArrays = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[extensions]
GraphsSharedArraysExt = "SharedArrays"

[compat]
Aqua = "0.6"
ArnoldiMethod = "0.4"
DataStructures = "0.17, 0.18"
Documenter = "0.27"
DataStructures = "0.19"
Distributed = "1"
Inflate = "0.1.3"
JuliaFormatter = "1"
SimpleTraits = "0.9"
StableRNGs = "1"
LinearAlgebra = "1"
Random = "1"
SharedArrays = "1"
SimpleTraits = "0.9.1"
SparseArrays = "1"
Statistics = "1"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[targets]
test = ["Aqua", "Base64", "DelimitedFiles", "Documenter", "JET", "JuliaFormatter", "LinearAlgebra", "Pkg", "Random", "SparseArrays", "StableRNGs", "Statistics", "Test", "Unitful"]
23 changes: 2 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,6 @@ It is an explicit design decision that any data not required for graph manipulat

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 status
## Project history

The _Graphs.jl_ project is a reboot of the _LightGraphs.jl_ package (archived in October 2021), which remains available on GitHub at [sbromberger/LightGraphs.jl](https://github.com/sbromberger/LightGraphs.jl). If you don't need any new features developed since the fork, you can continue to use older versions of _LightGraphs.jl_ indefinitely. New versions will be released here using the name _Graphs.jl_ instead of _LightGraphs.jl_. There was an older package also called _Graphs.jl_. The source history and versions are still available in this repository, but the current code base is unrelated to the old _Graphs.jl_ code and is derived purely from _LightGraphs.jl_. To access the history of the old _Graphs.jl_ code, you can start from [commit 9a25019](https://github.com/JuliaGraphs/Graphs.jl/commit/9a2501948053f60c630caf9d4fb257e689629041).

### Transition from LightGraphs to Graphs

_LightGraphs.jl_ and _Graphs.jl_ are functionally identical, still there are some steps involved making the change:

- Change `LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"` to `Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"` in your Project.toml.
- Update your `using` and `import` statements.
- Update your type constraints and other references to `LightGraphs` to `Graphs`.
- 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.

### About versions

- The master branch of _Graphs.jl_ is generally designed to work with versions of Julia starting from the [LTS release](https://julialang.org/downloads/#long_term_support_release) all the way to the [current stable release](https://julialang.org/downloads/#current_stable_release), except during Julia version increments as we transition to the new version.
- Later versions: Some functionality might not work with prerelease / unstable / nightly versions of Julia. If you run into a problem, please file an issue.
- The project was previously developed under the name _LightGraphs.jl_ and older versions of _LightGraphs.jl_ (≤ v1.3.5) must still be used with that name.
- There was also an older package also called _Graphs.jl_ (git tags `v0.2.5` through `v0.10.3`), but the current code base here is a fork of _LightGraphs.jl_ v1.3.5.
- All older _LightGraphs.jl_ versions are tagged using the naming scheme `lg-vX.Y.Z` rather than plain `vX.Y.Z`, which is used for old _Graphs.jl_ versions (≤ v0.10) and newer versions derived from _LightGraphs.jl_ but released with the _Graphs.jl_ 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_ at `v0.10.3`
_Graphs.jl_ is the successor to _LightGraphs.jl_ (archived October 2021); see the [CHANGELOG](CHANGELOG.md) for the full transition history.
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
IGraphs = "647e90d3-2106-487c-adb4-c91fc07b96ea"
NautyGraphs = "7509a0a4-015a-4167-b44b-0799a1a2605e"

[compat]
Documenter = "1"
16 changes: 15 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Documenter
using Graphs
using IGraphs: IGraphs
using NautyGraphs: NautyGraphs

# same for contributing and license
cp(
Expand All @@ -17,6 +19,11 @@ cp(
normpath(@__FILE__, "../src/index.md");
force=true,
)
cp(
normpath(@__FILE__, "../../CHANGELOG.md"),
normpath(@__FILE__, "../src/CHANGELOG.md");
force=true,
)

function get_title(markdown_file_path::AbstractString)
first_line = open(markdown_file_path) do io
Expand All @@ -35,7 +42,11 @@ pages_files = [
"first_steps/plotting.md",
"first_steps/persistence.md",
],
"Ecosystem" => ["ecosystem/graphtypes.md", "ecosystem/interface.md"],
"Ecosystem" => [
"ecosystem/graphtypes.md",
"ecosystem/graphalgorithms.md",
"ecosystem/interface.md",
],
"Core API" => [
"core_functions/core.md",
"core_functions/interface.md",
Expand All @@ -44,6 +55,7 @@ pages_files = [
"core_functions/persistence.md",
"core_functions/simplegraphs_generators.md",
"core_functions/simplegraphs.md",
"core_functions/wrappedgraphs.md",
],
"Algorithms API" => [
"algorithms/biconnectivity.md",
Expand Down Expand Up @@ -94,6 +106,7 @@ makedocs(;
canonical="https://gdalle.github.io/Graphs.jl",
),
sitename="Graphs.jl",
checkdocs=:public,
doctest=false,
expandfirst=[],
pages=[
Expand All @@ -109,3 +122,4 @@ deploydocs(; repo="github.com/JuliaGraphs/Graphs.jl.git", target="build")
rm(normpath(@__FILE__, "../src/contributing.md"))
rm(normpath(@__FILE__, "../src/license.md"))
rm(normpath(@__FILE__, "../src/index.md"))
rm(normpath(@__FILE__, "../src/CHANGELOG.md"))
1 change: 1 addition & 0 deletions docs/src/algorithms/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Pages = [
"community/clustering.jl",
"community/core-periphery.jl",
"community/label_propagation.jl",
"community/louvain.jl",
"community/modularity.jl",
"community/rich_club.jl",
]
Expand Down
2 changes: 2 additions & 0 deletions docs/src/algorithms/spanningtrees.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Pages = [
"spanningtrees/boruvka.jl",
"spanningtrees/kruskal.jl",
"spanningtrees/prim.jl",
"planarity.jl",
"spanningtrees/planar_maximally_filtered_graph.jl",
]

```
21 changes: 21 additions & 0 deletions docs/src/core_functions/wrappedgraphs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Graph views formats

*Graphs.jl* provides views around directed graphs.
`ReverseGraph` is a graph view that wraps a directed graph and reverse the direction of every edge.
`UndirectedGraph` is a graph view that wraps a directed graph and consider every edge as undirected.

## Index

```@index
Pages = ["wrappedgraphs.md"]
```

## Full docs

```@autodocs
Modules = [Graphs]
Pages = [
"wrappedGraphs/graphviews.jl",
]

```
57 changes: 57 additions & 0 deletions docs/src/ecosystem/graphalgorithms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Graph algorithms

## Defined by Graphs.jl

_Graphs.jl_ provides a number of graph algorithms, including [Cuts](@ref), [Cycles](@ref), and [Trees](@ref), among many others. The algorithms work on any graph type that conforms to the _Graphs.jl_ API.

## External algorithm packages

Several other packages implement additional graph algorithms:

- [GraphsColoring.jl](https://github.com/JuliaGraphs/GraphsColoring.jl) provides algorithms for graph coloring, _i.e._, assigning colors to vertices such that no two neighboring vertices have the same color.
- [GraphsFlows.jl](https://github.com/JuliaGraphs/GraphsFlows.jl) provides algorithms for graph flows.
- [GraphsMatching.jl](https://github.com/JuliaGraphs/GraphsMatching.jl) provides algorithms for matchings on weighted graphs.
- [GraphsOptim.jl](https://github.com/JuliaGraphs/GraphsOptim.jl) provides algorithms for graph optimization that rely on mathematical programming.

## Interfaces to other graph libraries

Several packages make established graph libraries written in other languages accessible from within Julia and the _Graphs.jl_ ecosystem:

- [IGraphs.jl](https://github.com/JuliaGraphs/IGraphs.jl) is a thin Julia wrapper around the C graphs library [igraph](https://igraph.org).
- [NautyGraphs.jl](https://github.com/JuliaGraphs/NautyGraphs.jl) provides graph structures compatible with the graph isomorphism library [_nauty_](https://pallini.di.uniroma1.it), allowing for efficient isomorphism checking and canonization, as well as computing the properties of graph automorphism groups.

## Dispatching to algorithm implementations in external packages

Apart from providing additional graph types and algorithms, many packages extend existing functions in _Graphs.jl_ with new backends. This can make it easier to use the algorithms from within _Graphs.jl_.

For example, _NautyGraphs.jl_ provides a new backend for graph isomorphism calculations:

```jldoctest
julia> using Graphs, NautyGraphs

julia> g = star_graph(5)
{5, 4} undirected simple Int64 graph

julia> Graphs.Experimental.has_isomorph(g, g, NautyAlg())
true
```

Here, dispatching via `NautyAlg()` implicitly converts `g` to a _nauty_-compatible format and uses _nauty_ for the isomorphism computation.

### Functions extended by IGraphs.jl

A list of functions extended by _IGraphs.jl_ can be obtained with

```@example
import IGraphs
IGraphs.igraphalg_methods()
```

### Functions extended by NautyGraphs.jl

A list of functions extended by _NautyGraphs.jl_ can be obtained with

```@example
import NautyGraphs
NautyGraphs.nautyalg_methods()
```
2 changes: 1 addition & 1 deletion docs/src/ecosystem/interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This section is designed to guide developers who wish to write their own graph s
All Graphs.jl functions rely on a standard API to function. As long as your graph structure is a subtype of [`AbstractGraph`](@ref) and implements the following API functions with the given return values, all functions within the Graphs.jl package should just work:

- [`edges`](@ref)
- [`edgetype`](@ref) (example: `edgetype(g::CustomGraph) = Graphs.SimpleEdge{eltype(g)})`)
- [`edgetype`](@ref) (example: `edgetype(g::CustomGraph) = Graphs.SimpleEdge{eltype(g)}`)
- [`has_edge`](@ref)
- [`has_vertex`](@ref)
- [`inneighbors`](@ref)
Expand Down
1 change: 0 additions & 1 deletion docs/src/first_steps/paths_traversal.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Any graph traversal will traverse an edge only if it is present in the graph. Wh

1. distance values for undefined edges will be ignored;
2. any unassigned values (in sparse distance matrices) for edges that are present in the graph will be assumed to take the default value of 1.0;
3. any zero values (in sparse/dense distance matrices) for edges that are present in the graph will instead have an implicit edge cost of 1.0.

## Graph traversal

Expand Down
Loading
Loading