The Optimal Power Flow (OPF) is a vital issue in electrical networks to ensure the economical and safe operation to transfer electrical energy that is very complex, non-linear, and limited. In the electrical networks with Renewable Energy Sources (RES), the OPF problem is a much more complex and constrained optimization problem because incorporating the intermittent nature of RESs, including Wind Turbine (WT) and Photovoltaic (PV), which have been used in this article, and OPF is often used to optimize various problems. In this research, an effort has been made to modify and improve the performance of a new algorithm named Circulatory System-Based Optimization (CSBO) to a more powerful algorithm for complex OPF problems, and the result of this research was to present a more effective and powerful algorithm named Gaussian Bare-bones Levy CSBO (GBLCSBO). CSBO mimics the mating behavior of the circulatory system in the body. The IEEE 30-bus and 118-bus test networks are adopted to validate the capability of the suggested approach in minimizing four objectives, which include the total generation cost, voltage deviation, power loss, and pollution emission.Finally, to know the performance and strength of GBLCSBO for solving various OPF problems, several new powerful algorithms include Seagull Optimization Algorithm (SOA), Teaching-Learning-Based Optimization (TLBO), Gray Wolf Optimizer (GWO), Multi-Verse Optimizer (MVO) have been used to compare with GBLCSBO. Also, the CEC 2017 test functions were used to measure the performance of GBLCSBO in a broader range of optimization problems.The optimization results in both topics of OPF problems and various test functions compared with various algorithms showed that GBLCSBO is both strong and robust and has a suitable and comparative performance in a wide range of different optimization problems such as OPF. According to the obtained results, the GBLCSBO demonstrates high potential in solving OPF problems.