# Optimized Scheduling of IoT Devices in Healthcare Facilities: Balancing Cost and Quality of Care
## 3 Materials and Methods
### Solution Method
Each candidate solution encodes device assignments across time windows, with objectives that aim to minimize operational costs while maximizing the quality of care based on patient priorities and device capabilities. Through evolutionary mechanisms--such as crossover, mutation, and elitism--NSGA-II continuously refines the population of solutions, ultimately producing a Pareto front that captures a range of trade-offs. This allows decision-makers to choose from multiple high-quality solutions rather than being forced to accept a single, potentially suboptimal result. Unlike existing methods that often optimize a single objective or rely on rigid heuristics, this approach offers several key innovations. By dynamically adjusting NSGA-II parameters across multiple runs and incorporating domain-specific constraints--such as device compatibility, setup time, and battery limits--the algorithm adapts to the real-world variability of clinical environments. Its multi-run design and time-bound execution also make it highly practical for deployment in resource-constrained healthcare settings, where timely decisions are crucial. In doing so, the approach overcomes the limitations of static or overly simplified models, offering a flexible, scalable, and interpretable solution framework. The anticipated benefits include more efficient use of healthcare facility resources, improved patient outcomes through better device matching, and greater transparency in the decision-making process through access to a spectrum of optimal solutions. Algorithm 1 outlines the optimization process for assigning IoT devices to patients using the NSGA-II algorithm. The procedure begins by receiving input lists of patients and devices, along with a time constraint (line 1). The goal is to produce an optimized set of device-patient assignments and a final Pareto-optimal front (line 2). The algorithm first defines the attributes of both patients and devices (line 3) and introduces an assignment class to manage their pairings (line 4). A multi-objective fitness function is then defined (lines 5-8), which aims to minimize the overall cost (\(\gamma\)), maximize quality of care (\(\sigma\))--based on patient priority and device quality--and respect time window constraints. The genetic representation of a solution is set up next (lines 9-11): each chromosome is a list of assignment objects, where each gene includes the device ID, patient ID, and corresponding assignment time window. Storage for Pareto-optimal solutions is initialized (line 12), and a timer is started (line 13). The main loop runs until the specified time limit is reached (line 14). Within this loop, NSGA-II parameters--_pop_size_, _num_gen_, _p_c_, _p_m_, _cross_op_, _mut_op_, and _sel_method_ --are randomly generated as defined in Equations (11)-(17) (line 15), and the algorithm (as detailed in Algorithm 2) is executed using these parameters (line 16). The resulting Pareto front and logbook from each execution are stored (line 17). Once the time limit expires, the algorithm returns the accumulated set of Pareto-optimal solutions and the complete logbook of all evolutionary runs (line 19).