JuliaGraphs / Graphs.jl

An optimized graphs package for the Julia programming language
http://juliagraphs.org/Graphs.jl/
Other
451 stars 87 forks source link

[FR] a function to efficiently check whether a graph is acyclic #385

Closed nsajko closed 1 month ago

nsajko commented 1 month ago

Something like:

"""
    has_cycles(graph)::Bool

Returns `false` iff `graph` is acyclic.
"""
function has_cycles end
gdalle commented 1 month ago

We already have

https://juliagraphs.org/Graphs.jl/stable/algorithms/traversals/#Graphs.is_cyclic

does it work with your problem?