# Use Reinforcement Learning instead of genetic algorithm for optimization

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,data)$$ x,y and z are some integeres from 1 to 50. So I can say I have a 3-dimensional array which is a way to save fitness values: $$parameters=[[1..50], [1..50], [1..50]]$$ The $$data$$ is another input which is the f needed to do some calculation on.

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

any value for x,y, and z will result in a cost for example: $$f(1, 5, 8, X) = 15$$ $$parameters: [1, 5, 8] = 15$$ or $$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.

Thanks.

• 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. – Brale Apr 7 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. – Arta Asadi Apr 8 at 8:22
• Hi. Could you please put your specific question in the title? I understand you want to use RL instead of GA, but that's not specific enough. – nbro Apr 9 at 13:14

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.