# Moving towards Smart Cities: A Selection of Middleware for Fog-to-Cloud Services +
## 3 Preliminary Foglet-Middleware Design
### Ranking Fog/Cloud Services  
On having the architecture of the proposed solution and selection criteria, the next step is to devise the ranking that will be used within the Rank of services component of the foglet architecture (Figure 1). This section is devoted to the description of the process of rating the alternatives, while Section 4 guides the reader through a specific computation of the ranking tables, together with the validation of the results.  
Based on Table 1 and our previous study [11] in which we described how the most certain and uncertain MCDA methods enhance the offloading process in mobile cloud computing as well as the selection of cloud services in general, we found that the TOPSIS is the most proposed ranking approach in the literature, since it is one of the famous fundamental multi-criteria decision-making ranking approaches in MCDA. The main features of TOPSIS [56] are chosen as the alternatives that simultaneously have the shortest distance from the ideal solution and the farthest distance from the  
\begin{table}
\begin{tabular}{c p{284.5 pt}} \hline \hline
**Criteria** & **Description** \\ \hline
**Availability** & It refers to the guarantee of the level of availability in the edge/cloud services. \\ \hline
**Usability** & It describes the use of fog/cloud services to support users’ requirements. \\ \hline
**Scalability** & It is the capacity of fog/cloud services to fit a given problem and use resources effectively. \\ \hline
**Adaptability** & It is the ability of fog/cloud services to adjust according to users’ requests. \\ \hline
**Performance** & It defines the quality of service provided by the fog/cloud providers. \\ \hline
**Proximity** & It describes the closeness relationship between the users and fog/cloud services by using geographic information to satisfy different users’ demands at different locations. \\ \hline
**Mobility** & It is the ability to provide suitable fog/cloud services to support timely the high mobility of applications. \\ \hline
**Cost** & It represents the cost of fog/cloud resources. \\ \hline
**Network** & It refers to different network types that have a large impact on the communication between users and services. \\ \hline
**Security** & It is the ability of fog/cloud providers to keep the high confidence of privacy and data safety that could be attained by the fog/cloud services. \\ \hline \hline \end{tabular}
\end{table}
Table 2: Criteria.  
Figure 2: Advantages of selecting decentralized and centralized services.  
anti-ideal solution. Also, among the selected works, we notice that the fuzzy method is prevalently used in mobile cloud offloading since this method is characterized by using linguistic variables to describe fuzzy terms that are then mapped to numerical variables. Moreover, it deals effectively with uncertain and imprecise information to solve real-world problems in different domains including cloud computing. Furthermore, the success of fuzzy and TOPSIS methods is measured by solving several MCDA problems, such as management of research and development projects as a portfolio of investments [57]. Accordingly, in this paper, we focus on using the benefits of these MCDA methods to solve the selection of services in the fog-to-cloud environment. Note that for understanding the space and time complexity of the solution, existing works on MCDAs can be consulted [12; 56; 58].  
To do that, our computational procedure of the ranking consists of two parts. Part 1 applies fuzzy similarity [58] to deal with the imprecise or vague nature of linguistic assessment through a trapezoidal fuzzy number (Figure 3). Then, we calculate the fuzzy weight of each criterion identified for the decision problem. Part 2 applies the fuzzy weight of each criterion for the TOPSIS based model to rate and select the best candidate based on the score of each alternative (Figure 4). In the next section, the computation is demonstrated on a numerical example via MATLAB (see Appendix A).