My genetic algorithm converges to an optimal solution (Global min known beforehand) after a very small number of iterations (4 to 5) is it considered a premature convergence?????
Asolutely Not. Premature convergence is an unwanted situation when your GA due to a lack of diversity is trapped in a local optimum. Your GA has found the global optimum. Is it unwanted to find the global optimum?
In order to be sure that your code is correct, why not test a few more examples? If you think that the output makes sense, you might have a good software - and otherwise you can try to start at the point at which the code stopped, and start another method there - just to see if you have found a local minimum. As we do not know how you have implemented the method, we have no chance to guess what has gone right, or perhaps gone wrong! :-)
Since you know the global minimum beforehand and the obtained result is in agreement the implementation is correct. I guess you are using local optimization along with global optimization.