Looking for some logic advice. I am running a depth limited search in order to get from a start state to an end state. I am expanding all possible moves from each node which at depths > 0 includes the source node (this is the problem).
I have tried storing previous states and including it as a condition for not expanding. However, this also negates the ability of other expansion branches to pass through this state.
From a logic perspective, how can I avoid this problem and at the same time avoid back-peddling?
@acelent comment (here) gave me an idea to create a configDepth class which stores each visited state and its corresponding depth. Then in the next recursion -
IF newState(depth) == state(depth-1) THEN !expand
What are your thoughts on this solution? I have gone down many blind alleys and need fresh opinions and ideas.
Thank you.