Existing studies on wireless sensor networks (WSNs) have revealed that the limited battery capacity of sensor nodes (SNs) hinders their perpetual operation. Recent findings in the domain of wireless energy transfer (WET) have attracted a lot of attention of academia and industry to cater the lack of energy in the WSNs. The main idea of WET is to restore the energy of SNs using one or more wireless mobile chargers (MCs), which leads to a new paradigm of wireless rechargeable sensor networks (WRSNs). The determination of an optimal order of charging the SNs (i.e., charging schedule) in an on-demand WRSN is a well-known NP-hard problem. Moreover, care must be taken while designing the charging schedule of an MC as requesting SNs introduce both spatial and temporal constraints. In this paper, we first present a Linear Programming (LP) formulation for the problem of scheduling an MC and then propose an efficient solution based on gravitational search algorithm (GSA). Our method is presented with a novel agent representation scheme and an efficient fitness function. We perform extensive simulations on the proposed scheme to demonstrate its effectiveness over two state-of-the-art algorithms, namely first come first serve (FCFS) and nearest job next with preemption (NJNP). The simulation results reveal that the proposed scheme outperforms both the existing algorithms in terms of charging latency. The virtue of our scheme is also proved by the well-known statistical test, analysis of variance (ANOVA), followed by post hoc analysis.