Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ We follow SemVer as most of the Julia ecosystem. Below you might see the "breaki

## unreleased
- `is_articulation(g, v)` for checking whether a single vertex is an articulation point
- Added documentation stubs for `community_leiden`, `modularity_matrix`, `sir_model`, `layout_kamada_kawai`, and `layout_fruchterman_reingold` pointing users to `IGraphs.jl`.


## v1.14.0 - 2026-02-26
Expand Down
12 changes: 12 additions & 0 deletions docs/src/advanced/experimental.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,16 @@ Pages = [
"Experimental/Traversals/Traversals.jl",
]

```

## External Algorithm Stubs

The following algorithms are not implemented natively in Graphs.jl but define documentation stubs guiding users to external wrapper packages like `IGraphs.jl`.

```@docs
Graphs.community_leiden
Graphs.modularity_matrix
Graphs.sir_model
Graphs.layout_kamada_kawai
Graphs.layout_fruchterman_reingold
```
20 changes: 20 additions & 0 deletions docs/src/ecosystem/graphalgorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ true

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

Similarly, _IGraphs.jl_ provides a backend for algorithms like `pagerank` and `betweenness_centrality`. You can dispatch to the C implementation by passing `IGraphs.IGraphAlgorithm()`:

```julia
julia> using Graphs, IGraphs

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

julia> pagerank(g, IGraphs.IGraphAlgorithm())
5-element Vector{Float64}:
...
```

To quickly convert a _Graphs.jl_ graph to an _IGraphs.jl_ structure, you can use `IGraphs.igraph(g)`.

### Functions extended by IGraphs.jl

A list of functions extended by _IGraphs.jl_ can be obtained with
Expand All @@ -47,6 +62,11 @@ import IGraphs
IGraphs.igraphalg_methods()
```

### Exclusive algorithms provided by IGraphs.jl

_IGraphs.jl_ also provides algorithms that are not natively available in _Graphs.jl_ (e.g., `community_leiden`, `sir_model`, `modularity_matrix`, and various layout algorithms such as `layout_kamada_kawai`). Users looking for these functionalities should use `IGraphs.jl` directly.


### Functions extended by NautyGraphs.jl

A list of functions extended by _NautyGraphs.jl_ can be obtained with
Expand Down
10 changes: 9 additions & 1 deletion src/Graphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export
# diffusion
diffusion,
diffusion_rate,
sir_model,

# eulerian
eulerian,
Expand Down Expand Up @@ -320,6 +321,8 @@ export

# community
modularity,
modularity_matrix,
community_leiden,
core_periphery_deg,
local_clustering,
local_clustering_coefficient,
Expand Down Expand Up @@ -454,7 +457,11 @@ export

# planarity
is_planar,
planar_maximally_filtered_graph
planar_maximally_filtered_graph,

# Layouts
layout_kamada_kawai,
layout_fruchterman_reingold
"""
Graphs

Expand All @@ -478,6 +485,7 @@ and tutorials are available at the
"""
Graphs
include("interface.jl")
include("igraphs_stubs.jl")
include("utils.jl")
include("frozenvector.jl")
include("deprecations.jl")
Expand Down
64 changes: 64 additions & 0 deletions src/igraphs_stubs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
"""
community_leiden(g::AbstractGraph; resolution=1.0, beta=0.01)

Find communities in a graph using the Leiden algorithm.
This algorithm is not implemented natively in Graphs.jl.
Please load `IGraphs.jl` to use this function.
"""
function community_leiden(g::AbstractGraph; kwargs...)
error(
"community_leiden is not implemented natively in Graphs.jl. Please use IGraphs.jl: `community_leiden(g; kwargs...)`",
)
end

"""
modularity_matrix(g::AbstractGraph)

Calculate the modularity matrix of a graph.
This algorithm is not implemented natively in Graphs.jl.
Please load `IGraphs.jl` to use this function.
"""
function modularity_matrix(g::AbstractGraph; kwargs...)
error(
"modularity_matrix is not implemented natively in Graphs.jl. Please use IGraphs.jl: `modularity_matrix(g; kwargs...)`",
)
end

"""
sir_model(g::AbstractGraph, beta, gamma; no_sim=100)

Simulate a SIR (Susceptible-Infected-Recovered) model on a graph.
This algorithm is not implemented natively in Graphs.jl.
Please load `IGraphs.jl` to use this function.
"""
function sir_model(g::AbstractGraph, beta, gamma; kwargs...)
error(
"sir_model is not implemented natively in Graphs.jl. Please use IGraphs.jl: `sir_model(g, beta, gamma; kwargs...)`",
)
end

"""
layout_kamada_kawai(g::AbstractGraph)

Calculate a graph layout using the Kamada-Kawai algorithm.
This algorithm is not implemented natively in Graphs.jl.
Please load `IGraphs.jl` to use this function.
"""
function layout_kamada_kawai(g::AbstractGraph; kwargs...)
error(
"layout_kamada_kawai is not implemented natively in Graphs.jl. Please use IGraphs.jl: `layout_kamada_kawai(g; kwargs...)`",
)
end

"""
layout_fruchterman_reingold(g::AbstractGraph)

Calculate a graph layout using the Fruchterman-Reingold algorithm.
This algorithm is not implemented natively in Graphs.jl.
Please load `IGraphs.jl` to use this function.
"""
function layout_fruchterman_reingold(g::AbstractGraph; kwargs...)
error(
"layout_fruchterman_reingold is not implemented natively in Graphs.jl. Please use IGraphs.jl: `layout_fruchterman_reingold(g; kwargs...)`",
)
end
Loading