Cloudlet-based optimization involves deploying a set of cloudlets in an environment and assigning user tasks to optimize various metrics, including energy consumption, quality of service (QoS), and cost. Typically, approaches deal with them separately, which might cause sub-optimality. Furthermore, assuming the fixed location of the cloudlets will limit the dynamic adaptability of the problem. Enabling more optimality and adaptability to the dynamic nature of cloudlet-based computing, we propose a novel Variable-Length multi-objective Whale optimization Integrated with Differential Evolution designated as VL-WIDE. Unlike the existing optimization algorithm, VL-WIDE features the capability of searching different lengths of solutions to cover the variable number of cloudlets for deployment. Furthermore, it enables a non-dominated evaluation of solutions based on four objectives using crowding distance for selection. It provides an application-oriented solutions repair operator for repairing non-valid solutions and assuring that all solutions are generated in the feasible region. The proposed algorithm enables moving the cloudlets among pre-defined locations to increase the quality of service according to the change in the user density caused by user mobility. Comparing this developed algorithm with other algorithms shows its superiority in multi-objective optimization (MOO) evaluation metrics. VL-WIDE has provided the best in a number of non-dominated solutions and delta metrics and was competitive in other metrics.INDEX TERMS Mobile edge computing environment, cloudlet deployment, task offloading, multi-objective optimization, variable-length optimization.