From 55d39728c2fb68953fa0377008360fbcca040b16 Mon Sep 17 00:00:00 2001 From: Aleksandr Date: Mon, 18 Sep 2023 07:52:13 +0300 Subject: [PATCH] Update dfs-based.md --- docs/docs/algorithms/cycle-detection/dfs-based.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/algorithms/cycle-detection/dfs-based.md b/docs/docs/algorithms/cycle-detection/dfs-based.md index a5e99b12..43cdf4d0 100644 --- a/docs/docs/algorithms/cycle-detection/dfs-based.md +++ b/docs/docs/algorithms/cycle-detection/dfs-based.md @@ -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.