Analyze the time and space complexity of your chosen graph traversal algorithm under memory constraints.