Add DFS algorithm for graph traversal