# Is it possible to optimize a multi-variable function with a reinforcement learning method?

I want to use RL instead of genetic or any other evolutionary algorithm in order to find the best parameter for a function.

Here is the problem:

Given a function $$f(x,y,z, \text{data}),$$ where $$x$$, $$y$$ and $$z$$ are some integers from 1 to 50.

So I can say I have a 3-dimensional array which is a way to save fitness values:

$$\text{parameters} = [[1..50], [1..50], [1..50]]$$

The $$\text{data}$$ is another input which is the $$f$$ needed to do some calculation on.

Currently, I am optimizing it using a genetic algorithm with $$\text{cost}(\text{fitness}) = f(x,y,z,data)$$ which is a customized cost function.

Any value for $$x$$, $$y$$, and $$z$$ will result in a cost for example:

$$f(1, 5, 8, X) = 15$$

$$\text{parameters}: [1, 5, 8] = 15$$

or

$$\text{parameters}: [2, 9, 11] = 30$$

In the provided example 2, 9, and 11 is a better set of parameters.

So I run a genetic algorithm and make some children with a sequence of x,y, and z. Then I calculate the cost(fitness) and then select them and so on.

I want to know is there any alternative or method in reinforcement learning which I can use instead of a genetic algorithm? If yes, please provide the name or any helpful link.

Note that F is completely defined by the user and should be changed in other contexts.

• Reinforcement learning is not an optimization method, it's a data driven approach to optimal control. There is no notion of state or action in your problem nor there is sequential decision making involved. It's a wrong tool to use here. Apr 7, 2021 at 20:04
• @Brale yeah I know it's not right, but I want to know if there any way to solve this problem in a some customized approach. Apr 8, 2021 at 8:22
• if you insist on using RL, maybe adaptive operator selection of GA (or population metaheuristic in general) using RL? Oct 22, 2021 at 8:01

In order to have anything resembling reinforcement learning you must at the very least have a set of states $$S$$ and a set of actions $$A$$.
In your formulation I can vaguely identify the set of states $$S$$ as all possible $$(x,y,z)$$ triplets. But don't see anything in your description that could be interpreted as a set of actions $$A$$. You either oversimplified the description of your problem or reinforcement learning is not applicable here by lack of very basic ingredients for it.