graph traversal problems