# A Residual Resource Fitness-Based Genetic Algorithm for a Fog-Level Virtual Machine Placement for Green Smart City Services

^{1}

^{2}

^{3}

^{4}

^{5}

^{6}

^{7}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Related Works

#### 2.1. VM Configuration of an Energy Consumption Model

#### 2.2. Constraints Plan

#### 2.3. Genetic Algorithm

#### 2.4. Research Motivations

- Instead of working out the enormous energy recipe, we lessen the fitness function calculation by utilising a straightforward calculation to decrease the complete iteration of the GA in a timely manner;
- Our review outlines the necessary conditions and numerical formulations to ensure a successful GA computation attempt;
- This suggests a framework to measure and evaluate physical machines legacy holdings;
- We reduce the complexity by limiting the number of generations (combination).

## 3. Analysis of the Prerequisites for the Fitness Function in a GA

## 4. Essential Functioning Fitness Function Prerequisites

#### 4.1. Fitness Function

#### 4.1.1. Prerequisite I

#### 4.1.2. Prerequisite II

#### 4.1.3. Prerequisite III

#### 4.1.4. Prerequisite IV

#### 4.2. The Suggested Fitness Function

#### 4.2.1. Prerequisite I

#### 4.2.2. Prerequisite II

#### 4.2.3. Prerequisite III

#### 4.2.4. Prerequisite IV

#### 4.3. Using the Taylor Expansion to Derive the Proposed Fitness Function

#### 4.4. Simplifying the Proposed Fitness Function Even Further

## 5. Design and Complexity of the Algorithms

Algorithm 1: Formulation of a Fitness Function Computation |

Input: A strategy for deploying virtual machines that details where and how each one will be used. Output: The sum of the plan’s potential leftover resources. Initialisation: PM usage set with no items. Do this for each virtual machine in the specified strategy. Increase the use of the located PM by including this VM. Change the status of any applicable active PMs. end for Do the following for each instance of using PMs that are shown in the PM uses table: Use of PMs, If 0, then To what extent may PMs be used once all other resources have been exhausted? Include this PM’s leftover resource when calculating the sum of all leftovers. end if end for Return the sum of the plan’s potential leftover resources. |

Algorithm 2: Evaluation of the Power Consumption |

Input: We have a whole new strategy for deploying our virtual machines, complete with details on how and where each one will be used. Output: Total amount of energy needed for this strategy. Initialisation: PM usage set with no items. Do this for each virtual machine in the specified strategy. Increase the use of the located PM by including this VM. Increase the use of the located PM by including this VM. end for Do the following for each instance of using PMs that are listed in the PM uses table: If there is no use of PMs, then Please use the following Equation (6) to determine the power draw of this PM. Take into account the PM’s energy needs in addition to the plan’s potential fitness benefits. end if end for Return the total amount of energy used. |

Algorithm 3: Virtual Machine (VM) Task Allocation |

I/P: Applications for all tasks. O/P: A strategy for assigning applications to virtual machines. Initialisation: A set of vacant virtual computers are employed for each work for each task that is available. A VM of the proper size should be given this job. Add this VM to the existing group of VMs. end for Perform the assignment plan conversion on the VM set. Return the assignment plan for the application. |

## 6. Dataset

## 7. Results

#### 7.1. The Normal GA Execution Time in Little, Medium, and Large Scopes

#### 7.2. The Typical Number of Active PMs in Each Scope Size, Including Small, Medium, and Large

#### 7.3. In Small, Medium, and Large Scopes, the Typical Generational Count

#### 7.4. The Typical Energy Measurement in Small, Medium, and Large Scopes

## 8. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## Abbreviations

Symbols | Meaning |

${p}_{total}$ | Overall data-centre power |

${e}_{total}$ | Overall consumption of energy |

${s}_{total}$ | Total removed constants from energy total |

e | Optimisation of energy |

${n}_{t}$ | Time period |

k | Time slot |

${p}^{cpu}$ | The power of cpu |

f; g | Fitness function |

$f0$; $g0$ | Defined function |

x | Fitness function input |

${r}_{total}$ | Overall residual resources |

${p}^{min}$; | Base power |

${p}_{j}^{max}$; ${p}_{j}^{min}$ | Max, min jth PMs power |

${p}_{np}^{max}$; ${p}_{np}^{min}$ | Max, min PMs npth PM power |

${p}_{np+1}^{max}$; ${p}_{np+1}^{min}$ | Max, min $(np+1)$th PM power |

r | Fitness function output as real number |

n | Approximate number of physical machines |

${e}_{j}$; ${p}_{j}$ | jth PM’s energy and power |

t | Rate of change of the virtual machine’s duration |

${t}_{j}$ | Rate of change of the jth virtual machine’s duration |

u | Overall use of processor time |

${u}^{ij}$j | Use of the ith VM in jth PM |

${u}_{jk}$ | Using the jth PM in the kth time slot |

${u}^{max}$; ${u}^{min}$ | Use of the machine at its max and lowest capacity |

${n}_{v}$; ${n}_{p}$ | Quantity of virtual and activated physical machines |

$u{}_{n}{}_{v}$; $u{}_{n}{}_{p}$ | Use of the nth VMs with nth hosts |

$\alpha $ | Constant representing of the distribution of the cpu speed |

$cj$ | Parameter for the fitness function constant lower-bounded |

${p}_{j}^{wcpu}$; ${p}_{j}^{pcpu}$ | Processing Time and CPU load for the jth PM |

${n}_{vj}$ | Proportion of VMs running on the jth host |

${n}_{vjk}$ | Nos. of VMs active in the jth period in time slot kth |

V; $Vi$ | Composed of every virtual machine and the ith VM |

$\Delta {u}_{j}$; $\Delta {u}_{np}$ | Using the jth and $\left(np\right)$th hosts |

## References

- Bibri, S.E. The IoT for smart sustainable cities of the future: An analytical framework for sensor-based big data applications for environmental sustainability. Sustain. Cities Soc.
**2018**, 38, 230–253. [Google Scholar] [CrossRef] - Bouzguenda, I.; Alalouch, C.; Fava, N. Towards smart sustainable cities: A review of the role digital citizen participation could play in advancing social sustainability. Sustain. Cities Soc.
**2019**, 50, 101627. [Google Scholar] [CrossRef] - Xia, X.; Wu, X.; BalaMurugan, S.; Karuppiah, M. Effect of environmental and social responsibility in energy-efficient management models for smart cities infrastructure. Sustain. Energy Technol. Assessments
**2021**, 47, 101525. [Google Scholar] [CrossRef] - Amirtharaj, I.; Groot, T.; Dezfouli, B. Profiling and improving the duty-cycling performance of Linux-based IoT devices. J. Ambient. Intell. Humaniz. Comput.
**2019**, 11, 1967–1995. [Google Scholar] [CrossRef] - Hormozi, E.; Hu, S.; Ding, Z.; Tian, Y.-C.; Wang, Y.-G.; Yu, Z.-G.; Zhang, W. Energy-efficient virtual machine placement in data centres via an accelerated Genetic Algorithm with improved fitness computation. Energy
**2022**, 252, 123884. [Google Scholar] [CrossRef] - Kozłowski, A.; Sosnowski, J. Energy Efficiency Trade-Off Between Duty-Cycling and Wake-Up Radio Techniques in IoT Networks. Wirel. Pers. Commun.
**2019**, 107, 1951–1971. [Google Scholar] [CrossRef] - Mishra, J.; Sheetlani, J.; Reddy, K.H.K. Data center network energy consumption minimization: A hierarchical FAT-tree approach. Int. J. Inf. Technol.
**2018**, 14, 507–519. [Google Scholar] [CrossRef] - Yang, G.; Shin, C.; Lee, J.; Yoo, Y.; Yoo, C. Prediction of the Resource Consumption of Distributed Deep Learning Systems. Proc. ACM Meas. Anal. Comput. Syst.
**2022**, 6, 1–25. [Google Scholar] - Dodge, J.; Prewitt, T.; Combes, R.T.D.; Odmark, E.; Schwartz, R.; Strubell, E.; Luccioni, A.S.; Smith, N.A.; DeCario, N.; Buchanan, W. Measuring the Carbon Intensity of AI in Cloud Instances. In Proceedings of the 2022 ACM Conference on Fairness, Accountability, and Transparency, Seoul, Republic of Korea, 21–24 June 2022. [Google Scholar] [CrossRef]
- Rbii, E.; Jemili, I. Leveraging SDN for smart city applications support. In International Workshop on Distributed Computing for Emerging Smart Networks; Springer: Berlin/Heidelberg, Germany, 2020; pp. 95–119. [Google Scholar]
- Hussain, M.W.; Reddy, K.H.K.; Rodrigues, J.J.P.C.; Roy, D.S. An Indirect Controller-Legacy Switch Forwarding Scheme for Link Discovery in Hybrid SDN. IEEE Syst. J.
**2020**, 15, 3142–3149. [Google Scholar] [CrossRef] - Mastelic, T.; Oleksiak, A.; Claussen, H.; Brandic, I.; Pierson, J.M.; Vasilakos, A.V. Cloud computing: Survey on energy efficiency. ACM Comput. Surv.
**2014**, 47, 1–36. [Google Scholar] [CrossRef] - Yamada, N.; Takeshita, H.; Okamoto, S.; Sato, T. Using Optical-Approaches to Raise Energy Efficiency of Future Central and/or Linked Distributed Data Center Network Services. Int. J. Netw. Comput.
**2014**, 4, 209–222. [Google Scholar] [CrossRef] [PubMed] - Roy, D.S.; Behera, R.K.; Reddy, K.H.K.; Buyya, R. A Context-Aware Fog Enabled Scheme for Real-Time Cross-Vertical IoT Applications. IEEE Internet Things J.
**2018**, 6, 2400–2412. [Google Scholar] [CrossRef] - Behera, R.K.; Reddy, K.H.K.; Roy, D.S. A Novel Context Migration Model for Fog-Enabled Cross-Vertical IoT Applications. In International Conference on Innovative Computing and Communications: Proceedings of ICICC 2019; Springer: Singapore, 2019; pp. 287–295. [Google Scholar] [CrossRef]
- Reddy, K.H.K.; Behera, R.K.; Chakrabarty, A.; Roy, D.S. A Service Delay Minimization Scheme for QoS-Constrained, Context-Aware Unified IoT Applications. IEEE Internet Things J.
**2020**, 7, 10527–10534. [Google Scholar] [CrossRef] - Chen, Q.; Grosso, P.; van der Veldt, K.; de Laat, C.; Hofman, R.; Bal, H. Profiling Energy Consumption of VMs for Green Cloud Computing. In Proceedings of the 2011 IEEE Ninth International Conference on Dependable, Autonomic and Secure Computing, Sydney, NSW, Australia, 12–14 December 2011; pp. 768–775. [Google Scholar] [CrossRef]
- Reddy, K.H.K.; Luhach, A.K.; Pradhan, B.; Dash, J.K.; Roy, D.S. A genetic algorithm for energy efficient fog layer resource management in context-aware smart cities. Sustain. Cities Soc.
**2020**, 63, 102428. [Google Scholar] [CrossRef] - Li, Z.; Yan, C.; Yu, X.; Yu, N. Bayesian network-based Virtual Machines consolidation method. Futur. Gener. Comput. Syst.
**2017**, 69, 75–87. [Google Scholar] [CrossRef] - Hallawi, H.; Mehnen, J.; He, H. Multi-Capacity Combinatorial Ordering GA in Application to Cloud resources allocation and efficient virtual machines consolidation. Futur. Gener. Comput. Syst.
**2017**, 69, 1–10. [Google Scholar] [CrossRef] - Jiang, J.; Feng, Y.; Zhao, J.; Li, K. DataABC: A fast ABC based energy-efficient live VM consolidation policy with data-intensive energy evaluation model. Future Gener. Comput. Syst.
**2017**, 74, 132–141. [Google Scholar] [CrossRef] - Yu, L.; Chen, L.; Cai, Z.; Shen, H.; Liang, Y.; Pan, Y. Stochastic Load Balancing for Virtual Resource Management in Datacenters. IEEE Trans. Cloud Comput.
**2016**, 8, 459–472. [Google Scholar] [CrossRef] - Bagheri, Z.; Zamanifar, K. Enhancing energy efficiency in resource allocation for real-time cloud services. In Proceedings of the 7’th International Symposium on Telecommunications (IST’2014), Tehran, Iran, 9–11 September 2014; pp. 701–706. [Google Scholar] [CrossRef]
- Makaratzis, A.T.; Khan, M.M.; Giannoutakis, K.M.; Elster, A.C.; Tzovaras, D. GPU Power Modeling of HPC Applications for the Simulation of Heterogeneous Clouds. In Parallel Processing and Applied Mathematics: 12th International Conference, PPAM 2017, Lublin, Poland, 10–13, September 2017, Revised Selected Papers, Part II 12; Springer International Publishing: Berlin/Heidelberg, Germany, 2018; pp. 91–101. [Google Scholar] [CrossRef]
- Li, Z.; Yan, C.; Yu, L.; Yu, X. Energy-aware and multi-resource overload probability constraint-based virtual machine dynamic consolidation method. Futur. Gener. Comput. Syst.
**2018**, 80, 139–156. [Google Scholar] [CrossRef] - Renuka, K.; Roy, D.S.; Reddy, K.H.K. An SDN empowered location aware routing for energy efficient next generation vehicular networks. IET Intell. Transp. Syst.
**2021**, 15, 308–319. [Google Scholar] [CrossRef] - Cao, G. Topology-aware multi-objective virtual machine dynamic consolidation for cloud datacenter. Sustain. Comput. Inform. Syst.
**2019**, 21, 179–188. [Google Scholar] [CrossRef] - Paulraj, G.J.L.; Francis, S.A.J.; Peter, J.D.; Jebadurai, I.J. A combined forecast-based virtual machine migration in cloud data centers. Comput. Electr. Eng.
**2018**, 69, 287–300. [Google Scholar] [CrossRef] - Haghighi, M.A.; Maeen, M.; Haghparast, M. An energy-efficient dynamic resource management approach based on clustering and meta-heuristic algorithms in cloud computing IaaS platforms. Wirel. Pers. Commun.
**2019**, 104, 1367–1391. [Google Scholar] [CrossRef] - Verma, S.; Kawamoto, Y.; Kato, N. Energy-Efficient Group Paging Mechanism for QoS Constrained Mobile IoT Devices Over LTE-A Pro Networks Under 5G. IEEE Internet Things J.
**2019**, 6, 9187–9199. [Google Scholar] [CrossRef] - Park, K.; Pai, V.S. CoMon: A mostly-scalable monitoring system for PlanetLab. ACM Sigops Oper. Syst. Rev.
**2016**, 40, 65–74. [Google Scholar] [CrossRef]

**Figure 10.**Scales and algorithms for calculating the data-centre power usage over the course of a full day.

Parameters | Scale |
---|---|

Count | 55 |

Dimensions | 13 |

Exclusiveness | true |

Equal Tariff | 0.5 |

Mutation Rate | 0.015 |

Runs | 100 |

Maximum Iterations | 1000 |

Cluster Trace (G) | Small | Medium | Large |
---|---|---|---|

Assignment of Virtual Machines | 1200 | 2400 | 4500 |

Physical Machines | 800 | 1000 | 2000 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Choudhury, S.; Luhach, A.K.; Rodrigues, J.J.P.C.; AL-Numay, M.; Ghosh, U.; Sinha Roy, D.
A Residual Resource Fitness-Based Genetic Algorithm for a Fog-Level Virtual Machine Placement for Green Smart City Services. *Sustainability* **2023**, *15*, 8918.
https://doi.org/10.3390/su15118918

**AMA Style**

Choudhury S, Luhach AK, Rodrigues JJPC, AL-Numay M, Ghosh U, Sinha Roy D.
A Residual Resource Fitness-Based Genetic Algorithm for a Fog-Level Virtual Machine Placement for Green Smart City Services. *Sustainability*. 2023; 15(11):8918.
https://doi.org/10.3390/su15118918

**Chicago/Turabian Style**

Choudhury, Sanjoy, Ashish Kumar Luhach, Joel J. P. C. Rodrigues, Mohammed AL-Numay, Uttam Ghosh, and Diptendu Sinha Roy.
2023. "A Residual Resource Fitness-Based Genetic Algorithm for a Fog-Level Virtual Machine Placement for Green Smart City Services" *Sustainability* 15, no. 11: 8918.
https://doi.org/10.3390/su15118918