Conserving energy resources and enhancing computation capability have been the key design challenges in the era of the Internet of Things (IoT). The recent development of energy harvesting (EH) and Mobile Edge Computing (MEC) technologies have been recognized as promising techniques for tackling such challenges. Computation offloading enables executing the heavy computation workloads at the powerful MEC servers. Hence, the quality of computation experience, for example, the execution latency, could be significantly improved. In a situation where mobile devices can move arbitrarily and having multi servers for offloading, computation offloading strategies are facing new challenges. The competition of resource allocation and server selection becomes high in such environments. In this paper, an optimized computation offloading algorithm that is based on integer linear optimization is proposed. The algorithm allows choosing the execution mode among local execution, offloading execution, and task dropping for each mobile device. The proposed system is based on an improved computing strategy that is also energy efficient. Mobile devices, including energy harvesting (EH) devices, are considered for simulation purposes. Simulation results illustrate that the energy level starts from 0.979% and gradually decreases to 0.87%. Therefore, the proposed algorithm can trade-off the energy of computational offloading tasks efficiently. © 2020 by the authors. Licensee MDPI, Basel, Switzerland.