In this paper, a walking pattern optimization procedure is implemented to yield the optimal heel-strike and toe-off motions for different goal functions. To this end, first, a full dynamic model of a humanoid robot equipped with active toe joints is developed. This model consists of two parts: multi-body dynamics of the robot which is obtained by Lagrange and Kane methods and power transmission dynamic model which is developed using system identification approach. Then, a gait planning routine is presented and consistent parameters are specified. Several simulations and experimental tests are carried out on SURENA III humanoid robot which is designed and fabricated at the Center of Advanced Systems and Technologies located in the University of Tehran. Afterward, a genetic algorithm optimization is adopted to compute the optimal walking patterns for five different goal functions including energy consumption, stability margin, joint velocity, joint torque and required friction coefficient. Also, several parametric analyses are performed to characterize the effects of heel-strike and toe-off angle and toe link mass and length on these five goal functions. Finally, it is concluded that walking pattern without heel-strike and toe-off motions requires less friction coefficient than the pattern with heel-strike and toe-off motions. Also, heavier toe link lowers tip-over instability and slippage occurrence possibility, but requires more energy consumption and joint torque.