  Device-to-device (D2D) communications is expected to be a critical enabler of
distributed computing in edge networks at scale. A key challenge in providing
this capability is the requirement for judicious management of the
heterogeneous communication and computation resources that exist at the edge to
meet processing needs. In this paper, we develop an optimization methodology
that considers the network topology jointly with device and network resource
allocation to minimize total D2D overhead, which we quantify in terms of time
and energy required for task processing. Variables in our model include task
assignment, CPU allocation, subchannel selection, and beamforming design for
multiple-input multiple-output (MIMO) wireless devices. We propose two methods
to solve the resulting non-convex mixed integer program: semi-exhaustive search
optimization, which represents a "best-effort" at obtaining the optimal
solution, and efficient alternate optimization, which is more computationally
efficient. As a component of these two methods, we develop a novel coordinated
beamforming algorithm which we show obtains the optimal beamformer for a common
receiver characteristic. Through numerical experiments, we find that our
methodology yields substantial improvements in network overhead compared with
local computation and partially optimized methods, which validates our joint
optimization approach. Further, we find that the efficient alternate
optimization scales well with the number of nodes, and thus can be a practical
solution for D2D computing in large networks.
