Filter path from explored states