Closed thiagodp closed 3 years ago
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.
Very cool idea!
PRs welcome :)
Done in https://github.com/datavis-tech/graph-data-structure/pull/42/files
Add methods for cycles:
DFS could be adapted for that purpose.