This chapter presents recent solutions to the optimal power flow (OPF) problem in the presence of renewable energy sources (RES), such as solar photo-voltaic and wind generation. After introducing the original formulation of the problem, arising from the combination of economic dispatch and power flow, we provide a brief overview of the different solution methods proposed in the literature to solve it. Then, we explain the main difficulties arising from the increasing RES penetration, and the ensuing necessity of deriving robust solutions. Finally, we present the state-of-the-art techniques, with a special focus on recent methods we developed, based on the application on randomization-based methodologies.