diff --git a/docs/Project.toml b/docs/Project.toml index dea978a5e..b54c85a8e 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -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" diff --git a/docs/make.jl b/docs/make.jl index 0eb9a74a0..30797f0f3 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,5 +1,7 @@ using Documenter using Graphs +using IGraphs: IGraphs +using NautyGraphs: NautyGraphs # same for contributing and license cp( @@ -40,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", diff --git a/docs/src/ecosystem/graphalgorithms.md b/docs/src/ecosystem/graphalgorithms.md new file mode 100644 index 000000000..044febf8d --- /dev/null +++ b/docs/src/ecosystem/graphalgorithms.md @@ -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() +``` diff --git a/test/Project.toml b/test/Project.toml index 5ae3fa603..e386e377c 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -6,10 +6,12 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +IGraphs = "647e90d3-2106-487c-adb4-c91fc07b96ea" Inflate = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" +NautyGraphs = "7509a0a4-015a-4167-b44b-0799a1a2605e" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SharedArrays = "1a1011a3-84de-559e-8e89-a11a2f7dc383" diff --git a/test/runtests.jl b/test/runtests.jl index 321ce7e87..c4da7ef47 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -174,7 +174,9 @@ tests = [ Aqua.test_all(Graphs; ambiguities=false) end - doctest(Graphs) + if !Sys.iswindows() + doctest(Graphs) + end @testset verbose = true "Actual tests" begin for t in tests