Genetic algorithm is a constrained stochastic optimization method. Compared with traditional deterministic optimization method, it has the merits of realizing overall convergence with no need of calculating partial derivatives of objective functions; compared with traditional stochastic optimization method, it has the advantages of high search efficiency and implication parallel calculation. The present paper deals with the basic principles of genetic algorithm and procedures of iterative calculation, followed by a discussion on the application results of this method in the constrained inverse problem of magnetic intensity.