In this paper, the optimal dynamic scheduling of electric vehicles (EVs) in a parking lot (PL) is proposed to minimize the charging cost. In static scheduling, the PL operator can make the optimal scheduling if the demand, arrival, and departure time of EVs are known well in advance. If not, a static charging scheme is not feasible. Therefore, dynamic charging is preferred. A dynamic scheduling scheme means the EVs may come and go at any time, i.e., EVs’ arrival is dynamic in nature. The EVs may come to the PL with prior appointments or not. Therefore, a PL operator requires a mechanism to charge the EVs that arrive with or without reservation, and the demand for EVs is unknown to the PL operator. In general, the PL uses the first-in-first serve (FIFS) method for charging the EVs. The well-known optimization techniques such as particle swarm optimization and shuffled frog leaping algorithms are used for the EVs’ dynamic scheduling scheme to minimize the grid’s charging cost. Moreover, a microgrid is also considered to reduce the charging cost further. The results obtained show the effectiveness of the proposed solution methods.