In tree search, the algorithm does not keep track of visited states. It explores nodes without checking whether a similar state has been encountered before.
This can lead to revisiting the same state multiple times, which might result in inefficiency and redundant computations.
Tree search is more straightforward to implement but can be less efficient in terms of time and space.
In graph search, the algorithm keeps track of visited states to avoid revisiting them. This is typically done using a set or some data structure to store the explored states.
This ensures that the algorithm does not waste time revisiting the same states, improving both time and space efficiency.
The additional bookkeeping for visited states makes the implementation slightly more complex than tree search.