The expectation of a huge number of Electric Vehicles (EVs) into the market creates multiple technical problems. The power system is at risk due to the unsecured and unreliable operation resulting from unplanned charging and discharging. The unplanned EV charging and discharging change the load profile of the electric grid. Hence, it is required to develop an effective scheduling scheme for charging and discharging EVs. This research focuses on the minimization of the charging cost of a large number of Electric Vehicles (EVs) in a residential area and parking station. When a huge number of EVs are aggregated in the residential and parking stations, charging and discharging power should be a significant and viable contributor to the power grid. V2G (Vehicle-to-Grid) technology offers additional potential benefits to improve power quality and also system reliability. EVs can also supply G2V (Grid-to-Vehicle) power through the discharge of the battery, which benefits both EV owners and electric utilities. It is very difficult to schedule the configurations of EV charging and discharging in an optimized way so as to decrease the charging cost of EVs. The usage of renewable energy sources like solar Photovoltaic (PV) power, reduces the burden on the grid. The solar PV systems are likely to have significant surplus power during the daytime. In this research, optimal charging and discharging scheduling schemes for EVs are developed and the proposed work is carried out under the MATLAB environment with and without Photovoltaic (PV) systems. The realistic load data is collected from Transmission Corporation of Andhra Pradesh (APTRANSCO), India and the solar data is taken from the Indian Solar Resource Data website. The effectiveness of the scheduling scheme is rated according to its capability to reduce the total cost. Extensive simulation studies have been performed on the distribution system under consideration and the results have been presented. The results demonstrate that the charging cost of EVs can be reduced significantly with the use of solar PV power.