  Fog computing is an emerging distributed computing model for the Internet of
Things (IoT). It extends computing and caching functions to the edge of
wireless networks. Uncrewed Aerial Vehicles (UAVs) provide adequate support for
fog computing. UAVs can not only act as a relay between mobile users and
physically remote edge devices to avoid costly long-range wireless
communications but also are equipped with computing facilities that can take
over specific tasks. In this paper, we aim to optimize the energy efficiency of
a fog computing system assisted by a single UAV by planning the trajectories of
the UAV and assigning computing tasks to different devices, including the UAV
itself. We propose two algorithms based on the classical Ant Colony and
Particle Swarm Optimization techniques and solve the problem by continuous
convex approximation. Unlike most existing studies where the trajectories are
assumed to be straight lines, we account for the effect of obstacles, such as
buildings, and deliberately avoid them during the trajectory planning phase.
Through extensive simulation experiments, we demonstrate that our proposed
approach can achieve significantly better energy efficiency than existing
benchmark algorithms.
