Swimming performance of spermatozoa is an important index for the success of fertilization. For many years, numerous studies have reported the optimal swimming of flagellar organisms. Nevertheless, there is still a question as to which is optimal among planar, circular helical and ellipsoidal helical beating. In this paper, we use a genetic algorithm to investigate the beat pattern with the best swimming efficiency based on hydrodynamic dissipation and internal torque exertion. For the parameters considered, our results show that the planar beat is optimal for small heads and the helical flagellum is optimum for a larger heads, while the ellipsoidal beat is never optimal. Also, the genetic optimization reveals that the wavenumber and shape of wave envelope are relevant parameters, whereas the wave shape and head geometry have relatively minor effects on efficiency. The optimal beat with respect to the efficiency based on the internal torque exertion of an active elastic flagellum is characterized by a small-wave number and large-amplitude wave in a lower-viscosity medium. The obtained results on the optimal waveform are consistent with observations for planar waveforms, but in many respects, the results suggest the necessity of a detailed flagellar structure-fluid interaction to address whether real spermatozoa exhibit hydrodynamically efficient swimming. The evolutional optimization approach used in this study has distinguished biologically important parameters, and the methodology can potentially be applicable to various swimmers. (C) 2016 Elsevier Ltd. All rights reserved.