graph-toolkit
    Preparing search index...

    Function hasCycle

    • Whether the graph contains a cycle (self-loops count). $O(V + E)$ directed, ~$O(E)$ undirected.

      Parameters

      Returns boolean