Using genetic algorithm, we studied the evolution of strategies in the iterated prisoner's dilemma on complex networks. It is found that the agents located on complex networks can naturally develop some self-organization mechanics of cooperation by genome reproduction, recombination, mutation and selection, which can not only result in the emergence of cooperation, but also strengthen and sustain the persistent cooperation. At the same time, such mechanics punishes and takes revenge on defective agents, leading to a high cooperation rate on complex networks.