# Optimized Scheduling of IoT Devices in Healthcare Facilities: Balancing Cost and Quality of Care
## 3 Materials and Methods
### Solution Method
\[pop\_size \sim \mathcal{U}_{d}\{50,100,150,200,250,300\} \tag{11}\] \[num\_gen \sim \mathcal{U}_{d}\{50,100,150,200,250,500\}\] (12) \[p_{c} \sim \mathcal{U}(0.7,0.9)\] (13) \[p_{m} \sim \mathcal{U}(0.01,0.1)\] (14) \[cross\_op \sim \mathcal{U}_{d}\{\text{OX, PMX, PBX, PPX}\}\] (15) \[mut\_op \sim \mathcal{U}_{d}\{\text{Swap, Insertion, Inversion}\}\] (16) \[sel\_method \sim \mathcal{U}_{d}\{\text{Binary Tournament, Random, Roulette Wheel}\} \tag{17}\]  
```
1:Input: List of patients, List of devices, Time limit \(time\_limit\)
2:Output: List of optimized assignments of devices to patients and Pareto optimal set
3: Define the patient and device classes with attributes
4: Define an Assignment class to store device-patient assignments
5: Define the fitness function:
6: Minimize total cost of device usage \(\gamma\)
7: Maximize quality of care \(\sigma\), based on patient priority and device quality
8: Respect time window constraints
9: Define the genetic representation of a solution:
10: A chromosome is a list of device-patient assignments
11: Each gene represents an assignment (device ID, patient ID, start time, end time)
12: Initialize storage for Pareto optimal solutions
13: Initialize the timer \(clock\)
14:while\(clock<time\_limit\)do
15: Randomly generate the NSGA-II parameters \(pop\_size\), \(num\_gen\), \(p\_c\), \(p\_m\), \(cross\_op\), \(mut\_op\), and \(sel\_method\) according to Equations (11)-(17). 16: Run Execution of NSGA-II with the generated parameters as detailed in Algorithm 2
17: Store the Pareto front and logbook obtained from the execution
18:endwhile
19: Return the final Pareto optimal set and logbook containing all evolutionary results
```  
**Algorithm 1** Optimization of IoT device assignment using NSGA-II. Algorithm 2 details the practical implementation of the NSGA-II optimization, including specific parameters such as population size and number of generations, and more. It methodically walks through the evolutionary process, highlighting how NSGA-II applies tournament selection with Pareto dominance ranking to effectively navigate the multi-objective solution space. The genetic operators--crossover, mutation, and elitism--work in concert to explore diverse assignment possibilities while preserving high-quality solutions. This implementation demonstrates how evolutionary algorithms can tackle complex healthcare resource allocation problems by mimicking natural selection processes to iteratively improve assignments across multiple competing objectives. For further details regarding the developed code, refer to Appendix A. For a comprehensive description of the system architecture and workflow, consult Appendix B. A systematic benchmark analysis was conducted, comparing our proposed NSGA-II-based heuristic algorithm against the exact solver SCIP in terms of solution quality, computational efficiency (runtime), and scalability (performance on increasing problem sizes). SCIP was chosen as a benchmark for comparison against the metaheuristic algorithm due to its capability to find high-quality, and ideally provably optimal, solutions for mixed integer programming problems [33]. Unlike metaheuristics, which provide approximate solutions, SCIP strives to find the absolute best possible outcome within the given time constraints. However, it also allows a maximum time limit to be set, enabling the retrieval of a high-quality solution even if its optimality is not fully proven.