For conventional buses, based on the decades of their operational knowledge, public transport companies are able to optimize their cost of operation. However, with recent trend in the usage of electric buses, cost optimal operation can become challenging. In this paper an offline optimal charging strategy is developed to minimize the energy cost. This is done by exploiting the periodicity and predictable operation of the city buses. For effective usage of the developed offline strategy, the actual energy demand of the electric bus must be known a-priori, which can be demanding. In order to address this issue, a predictor is designed. The neural network based predictor is able to estimate the energy demand for the next day. Using this, three different optimal charging strategies are implemented. Initially, only the operational constraints are considered to ensure the completion of a trip, later, a more involved problems consisting of battery state of charge (SoC) constraints and temperature constraints are included for the second and third optimization problems, respectively. All the three approaches result in significant energy cost minimization when compared to the non-optimal strategy of charging the electric bus to the full capacity at every available opportunity. Additionally, for the second and third formulations, namely, SoC and temperature constraints, by using a qualitative aging approach, some enhancements in the battery health is observed when compared to the non-optimal charging strategy.