Genetic Algorithm and Newton Raphson (NR) based approach to Optimal Power Flow problem has been presented. Both algorithms were tested on a 14-bus IEEE test system. The Genetic Algorithm Optimization (GAs) is very efficient in solving the OPF problem.The traditional concepts and practices of power systems are superimposed by economic market management. So OPF has become complex, and classical optimization methods were used to solve OPF effectively. But, in recent years, Artificial Intelligence methods (GA, etc.) have emerged that can solve highly complex OPF problems. In this work two algorithms, were used for the solution of dynamic optimal power flow (OPF) problem taking the transmission losses and the cost of generation as the main constraints. Both algorithms were tested on a 14-bus IEEE test system. The contingency analysis was considered in the application of the algorithms. Additionally, a comparison was made between the two algorithms. The obtained results showed the effectiveness of the GA algorithm over the traditional algorithm.