Two techniques were presented to solve an economic dispatch problem. An iterative technique, represented by Lagrange relaxation algorithm, was implemented. The algorithm was based on selecting initial guess and continuing until fining the best iteration with the optimal solution. The iterative technique was compared to a stochastic one represented by genetic algorithm. This algorithm was based on principles inspired from the biological evolution using natural selection, genetic recombination and survival of the fittest. The objective was to minimize the total generation fuel cost and keep the power flows within the security limits. The two techniques were compared for solving an economic dispatch problem with two generators. Results showed that the genetic algorithm was efficient and reliable optimization technique. The stochastic nature of the genetic algorithm could provide higher optimal solution and less computation time when compared to those of the iterative method.