Genetic algorithm (GA) is a kind of method to simulate the natural evolvement process to search the optimal solution, and the algorithm can be evolved by four operations including coding, selecting, crossing and variation. The particle swarm optimization (PSO) is a kind of optimization tool based on iteration, and the particle has not only global searching ability, but also memory ability, and it can be convergent directionally. By analyzing and comparing two kinds of important swarm intelligent algorithm, the selecting operation in GA has the character of directivity, and the comparison experiment of two kinds of algorithm is designed in the article, and the simulation result shows that the GA has strong ability of global searching, and the convergence speed of PSO is very quick without too many parameters, and could achieve good global searching ability.