  Mobile-edge computing (MEC) has recently emerged as a cost-effective paradigm
to enhance the computing capability of hardware-constrained wireless devices
(WDs). In this paper, we first consider a two-user MEC network, where each WD
has a sequence of tasks to execute. In particular, we consider task dependency
between the two WDs, where the input of a task at one WD requires the final
task output at the other WD. Under the considered task-dependency model, we
study the optimal task offloading policy and resource allocation (e.g., on
offloading transmit power and local CPU frequencies) that minimize the weighted
sum of the WDs' energy consumption and task execution time. The problem is
challenging due to the combinatorial nature of the offloading decisions among
all tasks and the strong coupling with resource allocation. To tackle this
problem, we first assume that the offloading decisions are given and derive the
closed-form expressions of the optimal offloading transmit power and local CPU
frequencies. Then, an efficient bi-section search method is proposed to obtain
the optimal solutions. Furthermore, we prove that the optimal offloading
decisions follow an one-climb policy, based on which a reduced-complexity Gibbs
Sampling algorithm is proposed to obtain the optimal offloading decisions. We
then extend the investigation to a general multi-user scenario, where the input
of a task at one WD requires the final task outputs from multiple other WDs.
Numerical results show that the proposed method can significantly outperform
the other representative benchmarks and efficiently achieve low complexity with
respect to the call graph size.
