Skip to content

Commit

Permalink
Update dfs-based.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Hromz authored Sep 18, 2023
1 parent 68c2c2b commit 55d3972
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/algorithms/cycle-detection/dfs-based.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 1

# DFS Based Cycle Detection
A DFS based cycle detection algorithm is used to identify cycles in graphs, both directed and undirected.
The algorithm doesn't work on edges with weight and therefore cannot be used for negative weight cycles.
The algorithm can be used to detect cycles in the structure of a graph, as it does not consider edge weights.

# Directed graph
The key idea is that when a vertex is processed, mark it as: UNVISITED, VISITED and NO_CYCLE.
Expand Down

0 comments on commit 55d3972

Please sign in to comment.