Skip to content

Detect cycles #32

@thiagodp

Description

@thiagodp

Add methods for cycles:

/** Indicates whether the graph has cycles. */
hasCycles(): boolean;
/** Returns a matrix with any cycles found, such as [ [ "a, "b", "a", ], [ "a", "b", "c", "a" ] ] */
cycles(): Array< Array< string > >;

DFS could be adapted for that purpose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions