Another ghost has trespassed into your haunted mansion. You are able to force him out, but only once you've caught up to him.
Both you and the other ghost take turns. During your turn, you may either stay in the same room, or move through a wall ceiling or floor to an adjacent room within the mansion (no moving diagonally). The other ghost does the same. You can sense each other's positions. The other ghost chooses the starting positions.
Given the above map of the mansion, can you catch the trespasser, or can he evade you indefinitely? Show a way to figure out the outcome of any given mansion.
The other ghost "prey" can be caught.
Now use that to show safe avenues for the prey.
If there exists a prey option that the predator does not have, then it is safe.
So obviously, the prey can be trapped in H with the predator in F, G, or J. So the prey does not want to move to H if the predator can get to F, G, or H. This makes the chart look like.
Continuing, we see now that the prey does not want to move to F if the predator can reach I, and I is reachable from F, G, or J.
Continuing, we see now that the prey does not want to move to B if the predator can reach A, and A is reachable from I.
Continuing, we see now that the prey does not want to move to C if the predator can reach D, and D is reachable from A. Note also that D is reachable from G and that there is nowhere left for the prey to go other than C if the predator is on G.
The prey is always catchable, the predator just needs to get to G.
This process can be applied for any mansion.