With the emergence of Microgrid, the penetration of renewable energy resources into the power system, along with the existing conventional generation systems has increased, thereby decreasing the cost of power generation, low grid dependency, and minimum environmental pollution. The DGs (Distributed Generators) are expected to optimally cater to the demand with the help of optimal scheduling using AI techniques, which will result in a minimized cost of operation. The various DGs considered for the realization of this Microgrid are solar PV, wind turbines, fuel cells, microturbines, and diesel generators. This paper focuses on Microgrid working in a grid-connected mode of operation. The unpredictable nature of the loads and nonlinearity of the components of the Microgrid makes the optimal scheduling of Microgrid more complex. This paper incorporates MATLAB simulations, to realize the optimal scheduling of Microgrid and the power to be generated by various DGs throughout the day so that the main aim of cost minimization can be achieved. It considers the day to be divided into twenty-four intervals of one hour each, in which the power is to be scheduled. Here, various cases are considered, based on the interaction and dynamic pricing behavior of the Microgrid, the results are obtained using the PSO method and compared with the already published work. Results show that PSO obtained better results than other techniques.