  Task offloading is a key component in mobile edge computing. Offloading a
task to a remote server takes communication and networking resources. An
alternative is device-todevice (D2D) offloading, where a task of a device is
offloaded to some device having computational resource available. The latter
requires that the devices are within the range of each other, first for task
collection, and later for result gathering. Hence, in mobility scenarios, the
performance of D2D offloading will suffer if the contact rates between the
devices are low. We enhance the setup to base station (BS) assisted D2D
offloading, namely, a BS can act as a relay for task distribution or result
collection. However, this would imply additional consumption of wireless
resource. The associated cost and the improvement in completion time of task
offloading compose a fundamental trade-off. For the resulting optimization
problem, we mathematically prove the complexity, and propose an algorithm using
Lagrangian duality. The simulation results demonstrate not only that the
algorithm has close-to-optimal performance, but also provide structural
insights of the optimal trade-off.
