|
| 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 | +``` |
0 commit comments