Skip to content

Commit 917d31f

Browse files
mxhblKrastanovclaude
authored
Documentation page for packages that extend Graphs.jl (#500)
Co-authored-by: Stefan Krastanov <github.acc@krastanov.org> Co-authored-by: Stefan Krastanov <stefan@krastanov.org> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 78818a0 commit 917d31f

File tree

5 files changed

+71
-2
lines changed

5 files changed

+71
-2
lines changed

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
4+
IGraphs = "647e90d3-2106-487c-adb4-c91fc07b96ea"
5+
NautyGraphs = "7509a0a4-015a-4167-b44b-0799a1a2605e"
46

57
[compat]
68
Documenter = "1"

docs/make.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using Documenter
22
using Graphs
3+
using IGraphs: IGraphs
4+
using NautyGraphs: NautyGraphs
35

46
# same for contributing and license
57
cp(
@@ -40,7 +42,11 @@ pages_files = [
4042
"first_steps/plotting.md",
4143
"first_steps/persistence.md",
4244
],
43-
"Ecosystem" => ["ecosystem/graphtypes.md", "ecosystem/interface.md"],
45+
"Ecosystem" => [
46+
"ecosystem/graphtypes.md",
47+
"ecosystem/graphalgorithms.md",
48+
"ecosystem/interface.md",
49+
],
4450
"Core API" => [
4551
"core_functions/core.md",
4652
"core_functions/interface.md",
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Graph algorithms
2+
3+
## Defined by Graphs.jl
4+
5+
_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.
6+
7+
## External algorithm packages
8+
9+
Several other packages implement additional graph algorithms:
10+
11+
- [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.
12+
- [GraphsFlows.jl](https://github.com/JuliaGraphs/GraphsFlows.jl) provides algorithms for graph flows.
13+
- [GraphsMatching.jl](https://github.com/JuliaGraphs/GraphsMatching.jl) provides algorithms for matchings on weighted graphs.
14+
- [GraphsOptim.jl](https://github.com/JuliaGraphs/GraphsOptim.jl) provides algorithms for graph optimization that rely on mathematical programming.
15+
16+
## Interfaces to other graph libraries
17+
18+
Several packages make established graph libraries written in other languages accessible from within Julia and the _Graphs.jl_ ecosystem:
19+
20+
- [IGraphs.jl](https://github.com/JuliaGraphs/IGraphs.jl) is a thin Julia wrapper around the C graphs library [igraph](https://igraph.org).
21+
- [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.
22+
23+
## Dispatching to algorithm implementations in external packages
24+
25+
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_.
26+
27+
For example, _NautyGraphs.jl_ provides a new backend for graph isomorphism calculations:
28+
29+
```jldoctest
30+
julia> using Graphs, NautyGraphs
31+
32+
julia> g = star_graph(5)
33+
{5, 4} undirected simple Int64 graph
34+
35+
julia> Graphs.Experimental.has_isomorph(g, g, NautyAlg())
36+
true
37+
```
38+
39+
Here, dispatching via `NautyAlg()` implicitly converts `g` to a _nauty_-compatible format and uses _nauty_ for the isomorphism computation.
40+
41+
### Functions extended by IGraphs.jl
42+
43+
A list of functions extended by _IGraphs.jl_ can be obtained with
44+
45+
```@example
46+
import IGraphs
47+
IGraphs.igraphalg_methods()
48+
```
49+
50+
### Functions extended by NautyGraphs.jl
51+
52+
A list of functions extended by _NautyGraphs.jl_ can be obtained with
53+
54+
```@example
55+
import NautyGraphs
56+
NautyGraphs.nautyalg_methods()
57+
```

test/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
66
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
77
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
88
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
9+
IGraphs = "647e90d3-2106-487c-adb4-c91fc07b96ea"
910
Inflate = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9"
1011
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
1112
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1213
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
14+
NautyGraphs = "7509a0a4-015a-4167-b44b-0799a1a2605e"
1315
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1416
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1517
SharedArrays = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ tests = [
174174
Aqua.test_all(Graphs; ambiguities=false)
175175
end
176176

177-
doctest(Graphs)
177+
if !Sys.iswindows()
178+
doctest(Graphs)
179+
end
178180

179181
@testset verbose = true "Actual tests" begin
180182
for t in tests

0 commit comments

Comments
 (0)