This study is concerned with the numerical analysis of the inverse problem in electrocardiography. We propose a new method (two-step algorithm) based on the application of genetic algorithm with the Tikhonov method to calculate the electrical sources on the heart. In the literature, the solution reconstructed by the classical Tikhonov method is based on the minimum energy norm using a closed geometry. This solution could be very different from the original source on the heart. Compared with the classical inverse problem method, the two-step algorithm improves the accuracy of the solution with respect to the original distribution. Finally, to validate our results, we create a distribution over the heart by using a model of electrical activity (Monodomain model), and then using our method, we make the reconstruction of the potential distribution.