This paper presents a multi-unmanned aerial vehicle (UAV)-assisted mobile edge computing (MEC) system, where multiple UAVs (variable number of UAVs) are deployed to serve Internet of Things devices (IoTDs). We aim to minimize the sum of hovering and flying energies of UAVs by optimizing the trajectories of UAVs. The problem is very complicated as we have to consider the deployment of stop points (SPs), the association between UAVs and SPs, and the order of SPs for UAVs. To solve the problem, this paper proposed a novel genetic trajectory planning algorithm with variable population size (GTPA-VP), which consists of two phases. In the first phase, operators of GA with a variable population size are used to update the deployment of SPs. Accordingly, multi-chrome GA is adopted to find the association between UAVs and SPs, an optimal number of UAVs, and the optimal order of SPs for UAVs. The effectiveness of the proposed GTPA-VP is demonstrated through several experiments on a set of ten instances with up to 200 IoTDs. It is evident from the experimental results that the proposed GTPA-VP outperforms the benchmark algorithms in terms of the energy consumption of the system. INDEX TERMS Mobile edge computing, unmanned aerial vehicle, evolutionary algorithm, multi-chrome genetic algorithm.