Photovoltaic (PV) forecasting, another term for solar power prediction, is the practice of predicting the quantity of electricity that a solar power system will generate in the future. It is employed in grid operations management, energy system optimization, and even dynamic evaluation techniques, such as Time-of-Use (ToU) optimization. The current models for predicting solar power have several issues, including weather-related variations in solar radiation, inaccurate acquisition devices, and the intricacy of the models, which might make deployment on some systems difficult. Furthermore, advancements in machine learning, particularly deep learning-based forecasting models, have emerged as promising approaches for handling complex solar radiation fluctuations and improving prediction accuracy. Numerous optimization techniques based on solar power prediction have been investigated by researchers to solve this problem and ensure a continuous power supply. By using these techniques, system stability is preserved, and the negative consequences of the solar power forecast model are minimized. Hybrid approaches integrating statistical models with artificial intelligence methods have shown significant improvements in short-term and long-term solar power predictions, enabling more resilient energy system designs. To give an extensive overview of the current research, we performed a literature review that concentrated on the most important papers that were published in IEEE, Google Scholar, Science Direct, and Springer journals between 2015 and 2024. These investigations were examined using methods that take into consideration convergence time, tracking efficiency, and error metrics. To promote future developments in PV-based optimization, this survey aims to identify current challenges and constraints.