| Approach | Notes |
|---|---|
| BFS for shortest-path variants | Guarantees shortest path in unweighted graphs; uses more memory (queue + visited set) than DFS but avoids stack overflow on large inputs. |
| DFS with recursion | Simple to implement for connectivity/reachability problems; risk of stack overflow on very deep graphs; may explore non-optimal paths first. |