MATLAB: Is there a way to find a global minimum using genetic algorithm

genetic algorithmoptimization

As in the title : Is there a way to find a global minimum using genetic algorithm?
I've written a code to find a global minimum of a function f, but it returns a great number of local minimums. Is it possible to find the global minimum (on some interval) or create a graph, and obtain min using it.If it matters, the function f is depends on more than 1 variable.

Best Answer

Genetic algorithms use the function handles they are given as "black boxes" (ga cannot examine how the function works.) In all algorithms that treat the function as a black box, it is impossible for the algorithm to be sure that it has found a global minima.
There are certain kinds of functions for which ga has been proven to be able to find the global minima to within tolerences (given enough iterations.) But there are also certain kinds of functions for which fmincon has been proven to be able to find the global minima to within tolerences. But once you get beyond constrained multinomials in term degree no more than 2, it gets tricky to be sure you have a global minima.
There are some functions that can be analyzed using calculas techniques in order to find global minima -- but only if you use the Symbolic Toolbox.
In the general case, it has been proven that there are functions for which the only way to determine the global minima is to try all possibilities individually and compare the results (that is, there are functions for which knowing the result for one input does not help you know the output for a different value.)