In my project i face a scenario where i have a function with numerous inputs. At a certain point i am provided with an result and i need to find one combination of inputs that generates that result.
Here is some pseudocode that illustrates the problem:
Double y = f(x_0,…, x_n)
I am provided with y and i need to find any combination that fits the input.
I tried several things on paper that could generate something, but my each parameter has a range of 6.5 x 10^9 possible values – so i would like to get an optimal execution time.
Can someone name an algorithm or a topic that will be useful for me so i can read up on how other people solved simmilar problems.
I was thinking along the lines of creating a vector from the inputs and judjing how good that vektor fits the problem. This sounds awful lot like an NN, but there is no training phase available.
Edit:
Thank you all for the feedback. The comments sum up the Problems i have and i will try something along the lines of hill climbing.
The general case for your problem might be impossible to solve, but for some cases there are numerical methods that can help you solve your problem.
For example, in 1D space, if you can find a number that is smaller then
yand one that is higher theny– you can use the numerical method regula-falsi in order to numerically find the “root” (which isyin your case, by simply invoking the method onf(x) -y).Other numerical method to find roots is newton-raphson
I admit, I am not familiar with how to apply these methods on multi dimensional space – but it could be a starter. I’d search the literature for these if I were you.
Note: using such a method almost always requires some knowledge on the function.
Another possible solution is to take
g(X) = |f(X) - y)|, and use some heuristical algorithms in order to find a minimal value ofg. The problem with heuristical methods is they will get you “close enough” – but seldom will get you exactly to the target (unless the function is convex)Some optimizations algorithms are: Genethic Algorithm, Hill Climbing, Gradient Descent (where you can numerically find the gradient)