Mobile edge computing (MEC) has been attracting significant research interest over the past few years[1, 2, 3]. By distributing computation-intensive tasks to the edge cloud server, mobile devices can collaboratively handle low-latency applications (such as augmented/virtual reality (AR/VR) and online gaming) which require huge computational and storage capacity. In fact, the success and performance of MEC depend heavily on the computational model of tasks. The earlier works[4, 5, 6, 3] considered several simplified computational models, which were very far from the actual tasks.
Recently, the MapReduce framework has been proposed as a realistic model for distributed computing [7, 8]. In MapReduce framework, a large dataset is split into multiple data chunks and stored distributively across multiple wireless devices (WDs). Then Map, Shuffle, and Reduce phases are implemented to compute several task functions. Specifically, in the Map phase, each map task of the WDs locally reads one data chunk and generates an intermediate value (IVA) in parallel. These IVAs are then exchanged by the WDs via the wireless network in the Shuffle phase. Finally, in the Reduce phase, the WDs fetch the IVAs from the assigned subset of the dataset and apply the Reduce function to produce the final results. However, such uploading of IVAs in the Shuffle phase will consume valuable communication resources in mobile networks, and it is critical to determine which IVAs to upload and when to upload them to strike a balance between computational performance and communication overhead.
In the literature, there have been some works on resource optimization in MapReduce to improve communication efficiency in the Shuffle phase. For example, the works [9, 10, 11] focused on coded distributed computing (CDC) schemes to reduce the communication load (i.e., the number of information bits) of the Shuffle phase via coding, at the expense of increasing the computational load of the Map phase. The work  proposed a joint mapping and data shuffling scheme for a general heterogeneous CDC systems, with the aim of achieving a upper bound of the optimal communication load. Based on a low-rank optimization model for wireless MapReduce systems, the work 
aimed to maximize the achieved degree-of-freedom via building the interference alignment condition for data shuffling, where a difference-of-convex-function algorithm was developed. In the presence of full-duplex radios and imperfect channel state information, the work proposed a superposition based scheme to simultaneously deliver coded multicasting massages and cooperatively precoded message in the Shuffle phase. Also, the work 
investigated MapReduce over multihop device-to-device networks, and proposed an analog multi-level over-the-air (OTA) aggregation scheme for collecting IVAs in the Shuffle phase. The analog OTA aggregation technique that exploits the signal superposition property of wireless channels has been investigated in various applications such as IoT/sensor networks and edge machine learning[16, 17, 18, 19, 20]. However, a homogeneous wireless network was assumed in all these works for MapReduce computation, and the communication cost in the Shuffle phase was assumed to be uniform.
In reality, modern wireless communication networks usually consist of multiple radio access technologies (multi-RATs) as illustrated in Fig. 1. For example, a 5G base station (i.e., gNB) and WiFi access points (APs) can be deployed in a cell, and a WD can use either the 5G network or WiFi network to access the internet. However, the associated communication costs across these multi-RAT networks are, in fact, different. For instance, the WiFi network (such as a campus network) may be free of charge but suffer from limited coverage. On the other hand, using the 5G RAT incurs a higher cost but benefits from a much broader coverage area. Most of the existing investigation works on the multi-RAT heterogeneous networks focused on improving the spectral/energy efficiency issues for generic wireless data transmissions[23, 21, 26]. The work in  proposed an MEC-centric offloading decision scheme for the multi-RAT heterogeneous network, in which the WDs’ usage cost and quality of service (QoS) are balanced by using the multi-armed bandit framework. Under the MapReduce framework, in addition to determining the dataset placement, transmission power, scheduling of the WDs and the computation tasks, we should also dynamically determine which RAT the WD should use to upload the IVAs for more efficiency over the multi-RAT networks. However, such aspects have not been explored before.
In this paper, we study the dynamic resource allocation and RAT selection for MapReduce computation over multi-RAT networks. As shown in Fig. 1, one 5G NB and several WiFi APs are deployed to provide wireless access services to multiple WDs in a single cell, and all the WDs are scheduled to collectively compute multiple data-processing functions under the MapReduce framework. The following summarizes the key contributions.
Dynamic Multi-RAT Selection for WDs: The RAT selection provides an additional freedom for the WDs’ IVA transmissions in achieving better system performance. The 5G gNB first performs dataset placement by splitting the dataset into multiple sub-datasets and assigning each to a WD. During the Shuffle phase of uploading the IVAs to the remote MEC server, each WD performs RAT selection by dynamically selecting either the 5G gNB or a WiFi AP to send IVAs to the MEC server over the air. The WiFi AP is low-cost in terms of data communication, but only a limited number of WDs can simultaneously access the WiFi AP due to its small coverage area. On the other hand, all the WDs in the cell can directly access the 5G gNB, but this incurs a higher data communication cost. Based on channel fading and cost variation, this RAT selection procedure is dynamic on a transmission time interval basis, and such dynamic selection enables a highly efficient MapReduce solution.
OTA Aggregation for Nomographic Function Computing Under MapReduce Framework: Under MapReduce framework for computing nomographic functions, the WDs are responsible for computing the Map functions based on their stored data files and producing IVAs, while the MEC server is responsible for computing the Reduce functions, whose input arguments are the aggregated IVAs. In order to enhance spectral efficiency for uploading IVAs to the MEC server, the analog OTA aggregation technique is employed to allow multiple WDs to simultaneously transmit their aggregated IVAs via the 5G and/or WiFi networks, by exploiting the signal superposition property of multiple access channels.
Joint RAT Selection and Transceiver Optimization for Multi-RAT OTA Aggregation of IVAs: We aim to minimize the weighted sum of the gNB/APs receivers’ computational mean squared error (MSE) of the aggregated IVAs, the transmission cost, and the time delay in multi-RAT OTA aggregation of IVAs, which can provide a complete Pareto optimal solution set
. Under the energy budgets for the WDs’ Map function computation and IVA transmission, we jointly optimize the RAT selection, the transmit coefficient per WD, and the gNB/APs’ receive beamforming vectors for the reconstructed input of each Reduce function. Note that the RAT selection and the transceiver design for OTA aggregation are closely coupled in the MSE term and the transmit energy constraints. The formulated joint design problem is a nonconvex mixed-integer optimization problem.
Efficient Algorithm: Based on the minimum MSE principle, we obtain the optimal receiver beamforming vectors at the gNB/APs, and then transform the original problem into a joint RAT selection and transmit optimization problem. To handle the variable coupling and reduce computational complexity, we propose an efficient algorithm to obtain a stationary solution by employing Lagrange dual decomposition and primal decomposition to separate the original problem into two levels for optimizing the RAT selection and transmit coefficients, respectively. Extensive numerical results are provided to reveal the effectiveness of the proposed joint algorithm.
The remainder of the paper is organized as follows. Section II introduces the wireless MapReduce system model. Section III presents the RAT selection scheme for wireless MapReduce computing with OTA aggregation of IVAs. Section IV formulates the joint RAT selection and transceiver design problem to minimize the weighted sum of computational MSE, transmission cost, and time delay. Section V presents a low-complexity algorithm based on the Lagrange duality method and primal decomposition. Section VI provides numerical results to demonstrate the effectiveness of the proposed algorithm, followed by concluding remarks in Section VII.
Notation: For an arbitrary-size matrix , and denote the transpose and Hermitian transpose, respectively. and denote the space of matrices with complex and real entries, respectively. For a complex number , denotes its absolute value, denotes its conjugate, and and denote its real and imaginary parts, respectively. denotes the Euclidean norm of a complex vector ; denotes the cardinality of a set . and
denote an identity matrix and an all-zeros vector/matrix, respectively, with appropriate dimensions;
denotes the distribution of a circular symmetric complex Gaussian (CSCG) random variablewith mean
and variance, denotes the distribution of a uniform random variable within an interval . Finally, denotes the statistical expectation.
Ii System Model
We consider a wireless MapReduce computation system in which one 5G gNB and WiFi APs are deployed to serve WDs, as illustrated in Fig. 1. The gNB and APs are connected to a common MEC server via optical fiber lines, where the data communication latency between the gNB/APs and the MEC server is negligible. The gNB and each AP are equipped with and antennas, respectively, and each WD is equipped with a single antenna. The WDs are equipped with both 5G and WiFi interfaces so that they can communicate using either RAT. In addition, each WD is assumed to have communication, computing, and storage capabilities. Let and be the sets of APs and WDs, respectively.
In this paper, we focus on the nomographic function computation job of processing a dataset which consists of data files , where . Denote by the index set of the data files. Each data file is assumed to have a size of bits, . The WDs are scheduled to collectively compute a total of nomographic functions , where each function maps all the data files into a complex value . Typically, these nomographic functions under consideration can be decomposed as[16, 17]
where denotes the pre-processing function which maps the input data file into a complex-valued IVA, i.e., , , and denotes the post-processing function which maps the aggregated IVA associated with the -th output function (i.e., ) into the value of nomographic function .
Example 1 (Nomographic Function in WordCount Problem)
In a typical WordCount problem in data analytics, one needs to count the number of occurrences of every word in a dataset including files , where the different words are indexed by . The nomographic function is the number of occurrences of word , which can be computed by executing the pre-processing function (to count the number of occurrences of word based on the file ) and post-processing function (to aggregate the pre-processed results based on the individual files).
Example 2 (Nomographic Function in Sensor Networks)
In environmental sensing/monitoring applications, some relevant statistics of sensor readings during a week or a month can be modelled as nomographic functions, such as the arithmetic mean ( with and ), geometric mean (
), geometric mean (with and ), and Euclidean norm ( with and ), where serves as the data filtering vector.
Ii-a Distributed Wireless MapReduce Framework
Following the distributed MapReduce framework, the pre-processing functions and the post-processing functions are referred to as the Map functions and the Reduce functions, respectively. As illustrated in Fig. 1, the MEC server and the WDs are responsible for computation of the Reduce functions and Map functions, respectively. Due to the limited storage capacity for each WD, we suppose that the dataset is split and evenly distributed over the WDs. Denote by the index set of data files stored at WD , . To fully utilize the storage resources of WDs, we assume that each data file is exclusively stored at one WD during the dataset placement phase. Since the data file number for the WDs’ MapReduce computation is generally larger than the WD number [8, 10, 9], it is assumed that can be treated as an integer number. Therefore, we have data files per set , .
Under the dataset placement strategy , the MapReduce decomposition (II) of nomographic function can be re-expressed as
From (2), it follows that, under the MapReduce framework, each nomographic function can be collaboratively computed by the WDs via resorting to the computation of its associated Reduce function , as well as the collection of the IVAs . For each , the is generated as the output of WD ’s local computation for Map function . Instead of accessing all data files to directly compute the output function , each can be computed by one WD based on the data file in a distributed computing fashion. Clearly, the MapReduce decomposition (2) includes two computation phases (Map function computation and Reduce function computation) and one communication phase (the collection of IVAs).
Ii-B Proposed Wireless MapReduce Protocol
Fig. 2 presents the proposed wireless Mult-RAT MapReduce computation protocol for the WDs to compute the nomographic functions in a distributed fashion. It consists of five phases, introduced as follows.
Dataset Placement Phase: In this phase, the dataset is divided into disjoint subsets of equal cardinality, and each subset of data files is assigned to be stored at each WD . The index sets of the data files are determined for the WDs.
WDs’ Map Function Computation Phase: In this phase, the WDs are enabled to locally compute the Map functions based on their respectively stored data files and generate the aggregated IVAs. Specifically, for each stored data file with , WD completes the computation of the Map functions and then outputs IVAs, i.e., , where . By aggregating the obtained IVAs based on the nomographic function index , each WD obtains a set of aggregated IVAs .
WDs’ IVA Uploading Phase: In this phase, via accessing to either the 5G gNB or one WiFi AP, the WDs can upload their aggregated IVAs to the MEC server for the Reduce function computation therein. Since the 5G gNB and WiFi APs respectively operate in the licensed and unlicensed frequency bands, there exists no interference between the IVA transmission from the WDs to the 5G gNB and that to the WiFi AP.
MEC Server’s Reduce Function Computation Phase: In this phase, having obtained the aggregated IVAs from the WDs, the MEC server computes a total of Reduce functions (i.e., ) so as to generate the targeted nomographic function values , .
Computed Result Downloading Phase: In this phase, each WD downloads the MEC server’s computed results of the nomographic functions by accessing to either the gNB or its associated WiFi AP.
Motivated by the limited communication and computation resources of WDs, in this paper we focus on the energy consumption and communication cost of the WDs in the WDs’ Map function computation phase and the communication phase of upload IVAs from the WDs to the MEC server.
Ii-C Map Function Computation at WDs
As illustrated in Fig. 2, the WDs have the same time budget to complete the computation of their Map functions. We denote by the time budget allocated for the WDs’ Map function computation in parallel. Let denote the number of central processing unit (CPU) cycles required to compute one bit of a data file in WD ’s computation of the Map function , , . Recall that the size of each data file is bits. Therefore, each WD needs to execute a total of CPU cycles to complete the computation of Map functions , where . Without loss of generality, we assume that the data files are consecutively assigned to WD , i.e., . In order to successfully compute these Map functions within the time duration , the CPU frequency of WD to execute each CPU cycle is adjusted as . Accordingly, the amount of energy consumed by WD ’s Map function computation is given as [31, 3]
where denotes the effective capacitance coefficient of WD ’s CPU chip architecture. At the end of the Map function computation phase, each WD has obtained the individual IVAs .
Iii RAT Selection for MapReduce with OTA Aggregation
In this section, we first introduce the RAT selection of each WD, and then present the OTA aggregation of IVAs from the WDs to the MEC server via accessing the 5G or WiFi networks. Fig. 3 illustrates the WDs’ RAT selection and OTA aggregation of IVAs via 5G or WiFi for wireless MapReduce computing.
Iii-a RAT Selection for IVA Transmission
As discussed in the previous section, the individual IVAs are locally generated at WD as the output of its Map functions . Furthermore, by linearly combining the IVAs according to the Reduce function index , the aggregated IVAs of WD , denoted by , are locally generated at WD , where , ,
. Let a binary variabledenote WD ’s RAT selection for uploading the aggregated IVA to the MEC server for performing the -th Reduce function computation. For WD and time slot , we are ready to have
Iii-B OTA Aggregation of IVAs from WDs to MEC Server via 5G
Denote by the complex-valued transmit coefficient of WD during the transmission of aggregated IVA to the 5G gNB. Let be the received signal at the 5G gNB. Note that all the WDs can directly communicate with the 5G gNB. Then, we have
where denotes the 5G gNB’s receive aggregation vector; denotes the channel coefficient vector for IVA transmission from WD to the 5G gNB; and denotes the AWGN vector of the 5G gNB’s receiver with zero-mean and variance .
Iii-C OTA Aggregation of IVAs from WDs to MEC Server via WiFi APs
Let be the WD set associated with the -th WiFi AP for implementing the -th Reduce function, and its cardinality is denoted by . Due to the smaller coverage area of WiFi APs when compared to the 5G gNB, the whole cell cannot be fully covered by these APs, i.e., , . As a result, depending on whether they stay in the WiFi coverage, the WDs can be divided into the following two types:
Definition iii.1 (Type-I WD with Direct WiFi Connectivity)
Each WD is referred to as a type-I WD under the WiFi coverage for the -th Reduce function, if it can directly communicate with one WiFi AP, where .
Definition iii.2 (Type-II WD without Direct WiFi Connectivity)
Each WD is referred to as a type-II WD for the -th Reduce function, if it is out of the WiFi coverage and cannot directly communicate with one WiFi AP.
We allow D2D communications for implementing the -th Reduce function such that the type-II WD is allowed to communicate with another WD in its neighborhood. The communication network consisting of the WDs can be modelled as an undirected graph whose vertices are the WDs and whose edge set includes all the available D2D communication links among the WDs. Denote by the shortest path from WD to WD . To guarantee the WiFi connectivity for each type-II WD , we assume there exists at least one (single-hop or multi-hop) communication path to one type-I WD . For a type-II WD , the closest type-I WD is defined as such that
where denotes the length (i.e., edge number) of path from WD to WD .
In the following, we introduce the OTA aggregation of IVAs via WiFi for type-I and type-II WDs, respectively. Fig. 4 illustrates the OTA aggregation of IVAs for type-I and type-II WDs.
Iii-C1 OTA Aggregation of IVAs for Type-I WDs via WiFi
As shown in Fig. 4(a), for each type-I WD , denote by its complex-valued transmit coefficient to send the aggregated IVA to its associated WiFi AP at the -th time slot. Given the WD set being associated with the -th WiFi AP for the -th Reduce function, the received signal of the -th WiFi AP is expressed as
where , denotes the -th WiFi AP’s receive aggregation vector, denotes the channel coefficient vector from WD to its associated WiFi AP , and denotes the AWGN vector of WiFi AP ’s receiver.
Iii-C2 OTA Aggregation of IVAs for Type-II WDs via WiFi
As shown in Fig. 4(b), for each type-II WD and each Reduce function , the number of time slots for IVA transmission to its closest type-I WD is assumed to be equal to the number of edges of path . Recall that the duration of each time slot is for one-hop D2D communication. As a result, there exists an additional time latency for each type-II WD . For the -th Reduce function, we denote by the set of the closest neighbor type-I WDs associated with WiFi AP for type-II WDs’ IVA uploading, and let the set collect all the type-II WDs which have a common closest neighbor type-I WD associated with WiFi AP .
Based on the OTA aggregation principle, the corresponding signal received by WiFi AP is expressed as
where and denote the transmit coefficient and channel vector from WD to its associated WiFi AP , respectively; and denote the receive aggregation vector and the AWGN vector at the WiFi AP , respectively.
Iii-D Aggregated IVA Reconstruction at MEC Server
Let be the aggregated IVA to be reconstructed from the received signals at the gNB and APs, which serves as the input argument of the Reduce function for the MEC server. In order to approximate the targeted , we employ the linear combination principle to aggregate the received signals in (5), in (III-C1), and in (III-C2). As a result, the reconstructed is given as
Based on (9), the MEC server performs the Reduce function computation and generates the final results .
Iv Problem Formulation
In this section, we first elaborate the reward and penalty for 5G/WiFi RAT selection for the WDs’ OTA aggregation of IVAs. Then we derive the computation MSE of the reconstructed input for the Reduce functions at the MEC server, and finally present the weighted MSE-cost-delay minimization problem.
Iv-a Reward and Penalty for 5G and WiFi RATs
Iv-A1 Energy Consumption for OTA Aggregation of IVAs
Let be the amount of transmit energy of WD for OTA aggregation of IVAs associated with the -th Reduce function. Each type-I WD , in addition to uploading its own aggregated IVA to the MEC server via 5G or WiFi, is also responsible to upload the aggregated IVAs of the type-II WDs in set . Therefore, based on the signal models (5), (III-C1), and (III-C2), the amount of transmit energy of each WD is given as
The type-I WD is only responsible to send its aggregated IVA to the MEC server via 5G gNB or WiFi AP , . Therefore, based on (5) and (III-C1), the amount of energy consumption for OTA aggregation of IVAs for WD is given as
Each type-II WD , meanwhile, can either select the 5G RAT for IVA uploading or transmit its aggregated IVA to its closest neighbour type-I WD via D2D communication links with full transmit power . Therefore, for each type-II WD , the amount of transmit energy for OTA aggregation of IVAs for the -th Reduce function is given as
Iv-A2 Cost for 5G and WiFi RATs
For each WD’s OTA aggregation of IVAs, denote by and the communication cost of accessing one WiFi AP and the 5G gNB, respectively, where the communication cost may be charged by the corresponding network service provider. Since WiFi operates over the unlicensed frequency bands, it is reasonably assumed that . Denote by the communication cost of the WDs to upload the aggregated IVAs which are associated with the -th Reduce function. Based on the WDs’ RAT selection profiles , their communication cost is expressed as
Iv-A3 Time Delay Penalty for WiFi RAT
Note that the coverage of the 5G gNB is the whole cell. For each Reduce function to be computed by the MEC server, any WD can directly send its aggregated IVA to the MEC server within one time slot by accessing the 5G gNB. By employing the OTA aggregation method, the WDs selecting the 5G RAT can then simultaneously transmit their aggregated IVAs to the 5G gNB in one time slot. Therefore, the time delay for the OTA aggregation of IVAs associated with each Reduce function via 5G gNB is .
On the other hand, the time delay for the OTA aggregation of IVAs via WiFi is dependent on the WD type. In the following, we consider type-I WDs with direct WiFi connectivity in set and type-II WDs without direct WiFi connectivity for the -th Reduce function, respectively.
For the type-I WDs to send their aggregated IVAs for one Reduce function computation at the MEC server, the time delay to implement the OTA aggregation of IVAs by accessing their associated WiFi APs is .
For the type-II WDs to select the WiFi RAT, due to the lack of direct WiFi connectivity, each type-II WD has to first transmit the aggregated IVA to its closest type-I WD via the shortest (single-hop or multi-hop) communication path . The required communication time is proportional to the path length and is given as . After having received and decoded the aggregated IVAs from the type-II WDs, the closest type-I WDs employ the OTA aggregation of IVAs for the associated WiFi APs. As such, the total time delay penalty associated with the -th Reduce function computation for IVA uploading from the type-II WDs to the MEC server via WiFi is expressed as
It is important to note that the time delay for all the WDs’ OTA aggregation of IVAs is dominated by the type-II WDs’ IVA aggregation selecting the WiFi RAT, i.e., . In this paper, we focus on the minimization of the time delay for the -th Reduce function, .
Iv-B Computational MSE
Suppose that the Reduce function is Lipschitz continuous at point , . This implies that there is a constant such that for all sufficiently near . To measure the approximation performance of with respect to the -th Reduce function value , we adopt the computational MSE between the obtained and the ground truth as the figure of merit for the WDs’ OTA aggregation of IVAs, which is defined as
Iv-C MSE-Cost-Delay Minimization Problem
In this paper, subject to the energy constraints for the WDs’ Map function computation and OTA aggregation of IVAs, our goal is to minimize the weighted sum of the computational MSE in (15), the communication cost in (13), and the time delay penalty in (14). We pursue the joint optimization of the RAT selection of the WDs and the transceiver variables for all WDs’ OTA aggregation of IVAs via 5G, and the transceiver variables for type-I WDs’ OTA aggregation of IVAs via WiFi APs, the transceiver variables for type-II WDs’ OTA aggregation of IVAs via WiFi APs.
Furthermore, we define the following three functions: , , and , which correspond to the computational MSE, cost, and delay performance, respectively, under a certain RAT selection and transceiver design scheme. To achieve a tradeoff among the three objectives [23, 27, 28], we formulate the following weighted sum minimization problem:
where collects all the WDs’ binary RAT selection variables; collects all the WDs’ transmit coefficients in OTA aggregation of IVAs with , , , , and ; and denotes the nonnegative weight for , which specifies the priority of the -th objective and reflects the system operator’s preference. By varying the weights , we can obtain a complete Pareto optimal set which corresponds to a set of RAT selection and transceiver designs for OTA aggregation of IVAs. In this paper, we refer to problem (P1) as the weighted sum of MSE-cost-delay (WS-MCD) minimization problem.
For the WS-MCD problem (P1), the constraints in (19b) denote the binary RAT selections in uploading their aggregated IVAs to the MEC server, and the -th constraint of (19c) represents that the amount of energy consumed due to WD ’s Map function computation and IVA transmission cannot exceed its energy budget . Note that, due to the variable coupling in the and the binary variables , problem (P1) is a mixed-integer and non-convex optimization problem.
V Proposed Solution for Problem (P1)
In this section, we present the proposed joint RAT selection and transceiver design solution for problem (P1).
V-a Problem Transformation for Problem (P1)
Note that the constraints (19c) and (19d), as well as the cost functions and the delay functions in the objective function of problem (P1), are independent of the receive aggregation vectors . In addition, the given in (15c) is a convex quadratic function of , and there exists no coupling between and for . Therefore, we can obtain the optimal solution of for problem (P1) by setting the first-order derivative of with respect to