Graph traversal using various algorithms.