  Motivated by the need to ensure timely delivery of information (e.g., status
updates) in the Internet-of-things (IoT) paradigm, this paper investigates the
role of an Unmanned aerial vehicle (UAV) as a mobile relay to minimize the
average Peak Age-of-information (PAoI) for a source-destination pair. For this
setup, we formulate an optimization problem to jointly optimize the UAV's
flight trajectory as well as energy and service time allocations for packet
transmissions. In order to solve this non-convex problem, we propose an
efficient iterative algorithm and establish its convergence analytically.
Closed-form solutions for some sub-problems are also provided. One of the
sub-problems we solve in this procedure is to jointly optimize the energy and
service time allocations for a given trajectory of the UAV. This problem is of
interest on its own right because in some cases we may not be able to alter the
UAV's trajectory based on the locations of the IoT devices (especially when its
primary mission is something else). Our numerical results quantify the gains
that can be achieved by additionally optimizing the UAV's trajectory.
