Recently, as the market share of electric vehicles (EVs) has increased, how to handle the increased electricity demand for EV charging in the power grid and how to use EV batteries from a grid-operating aspect have become more important. Also, from the perspective of individual EVs, Vehicle-to-Grid (V2G) technologies that reduce the cost for each vehicle's charging in conjunction with the power grid are significant. In this paper, the V2G control problem at the individual vehicle level is studied using a Dynamic Programming (DP) algorithm that considers EVs' charging efficiency. The DP algorithm is developed to generate an optimized charging/discharging power profile that minimizes electricity costs, while satisfying the constraints of the initial and final battery states of charge, for given a time-of-use electricity price. To show the effectiveness of the proposed algorithm, simulation is conducted for three different charging scenarios (unidirectional charging, bidirectional charging, and unidirectional charging with cost variations based on electricity usage), and the results showed that DP can achieve significant cost savings of about 30% compared to the normal charging method. Also, the result of DP is compared with that of Linear Programming, demonstrating that DP outperforms Linear Programming in cost savings for the V2G control problem.