Modularized Artificial Intelligence Services for Multiple Patients’ Medical Resource Sharing and Scheduling
Abstract
1. Introduction
2. Related Works
2.1. Algorithms
2.2. Time Complexity
- Polynomial-Time Problems: Solvable efficiently in polynomial time;
- NP (Non-deterministic Polynomial-Time) Problems: Verifiable in polynomial time but not necessarily solvable in that time frame [3].
2.3. Intelligence Algorithms
Intelligent Heuristic Algorithms
2.4. Related Problem Domains
3. Proposed Modularized Artificial Intelligent Services
3.1. Definition
3.1.1. Patient Flow Scenarios
- Scenario 1: The patient receives only an outpatient consultation and is discharged.
- Scenario 2: The patient receives an initial consultation followed by a diagnostic procedure. The case is complete pending diagnostic report results.
- Scenario 3: The patient undergoes a consultation, examination, and immediate follow-up consultation within the same visit.These scenarios form the foundation for modeling task dependencies and temporal constraints in our scheduling algorithm.
3.1.2. Scheduling Dynamics Example
- After the consultation with Patient 1-1,it is necessary to determine whether an examination is needed. Then, it is necessary to determine whether the examination room is currently occupied. In the figure, no one is currently being examined, so the examination can be performed immediately. When Patient 1-1 is undergoing an examination, time cannot be wasted. We need to maximize the use of medical institutions, so Patient 1-2 is arranged to be examined in outpatient clinic 1.
- When arranging an immediate follow-up consultation for Patient 1-1, the immediate follow-up consultation can only be arranged after the consultation of Patent 1-3 is finished.
- For Patient 2-1, the initial consultation ends just before the examination room becomes available. Suppose that an examination step is required. However, since the examination room is occupied at that moment, the patient must wait until it becomes available. In other words, Patient 2-1 should wait and have additional delay time.
3.2. Subjective Constraints
- Overlapping States for the Same PatientThis issue occurs when a single patient is scheduled for two different activities that overlap in time. For example, Patient 1 from Consultation Room 1 has two distinct activities: an initial consultation and a follow-up consultation (after examination). If the follow-up consultation starts before the initial consultation has finished, this overlap clearly indicates a conflict, as a patient cannot logically be in both states simultaneously. This represents a single-patient overlap problem. In this section, we assume the following:
- : The set of patients;
- : Resources (outpatient clinic and examination room);
- : The patient’s medical service required (consultation (con), examination (exam), or follow-up consultation (fcon));
- : Time for the medical service;
- : The exact starting time of the corresponding medical service in the schedule.
- Overlapping Consultations for Different Patients This issue involves multiple patients being scheduled in the same consultation room at overlapping times. For example, in Consultation Room 2, both Patients 2-1 and 2-2 are scheduled for consultations when Patient 2-2 is scheduled to begin a consultation while Patient 2-1’s session is still ongoing. This scheduling conflict violates the exclusivity requirement of consultation rooms and defines a multi-patient overlap problem.
- Examination Room Overlap A third conflict type involves the diagnostic examination room being scheduled for multiple patients at the same time. Suppose that Patients 1-1 from Consultation Room 1 and 2-2 from Consultation Room 2 are both scheduled for examinations with overlapping time intervals. This implies that one patient begins the examination before another patient has completed the examination. This leads to a diagnostic resource contention problem.
- Incorrect Consultation–Examination OrderThe fourth issue arises when a patient’s stages are incorrectly sequenced. In practice, an examination should occur after the consultation that orders it. Moreover, for patients requiring a follow-up consultation, the correct sequence should always be initial consultation → examination → follow-up consultation. Any deviation from this flow represents a consultation sequence error. Hence, normally, a single patient would need to spend more time waiting in the outpatient consulting room or examination room if there exists another patient.
3.3. Objective Function
- Let represent the percentage of patients with consultation only;
- represents the percentage of patients who require consultation and examination;
- represents the percentage of patients who require consultation, examination, and immediate follow-up consultation.
3.4. Intelligent Heuristic Algorithm Framework and Execution Process
3.4.1. Genetic Algorithm (GA)
- Initialization and Representation: Define and initialize the dataset, generate the initial population, and set algorithm parameters. The code or chromosome used in the GA should be defined and represented corresponding to the possible solution. Each chromosome indicates a possible solution.
- Termination Check: Evaluate whether the termination conditions (e.g., number of generations, convergence, etc.) are satisfied or not. When stopping, the rank 1 or the chromosome with the minimal fitness value would be the solution.
- Selection: Select individuals from the current population based on fitness scores to participate in reproduction. The selected chromosomes will be used in the crossover process.
- Crossover: Perform crossover (recombination) operations on selected individuals to produce offspring. The partial genes of the parent chromosome will be exchanged. Therefore, the new offspring will have partial genes from one parent chromosome and partial genes from another.In this research, the crossover procedure could be partially matched crossover (PMX) or Partial Attribute/Gene crossover (PAX). PMX was proposed for and is generally used in the genetic algorithm. Considering the representation of the chromosome, there are sequential numbers, where each number indicates an individual patient number. By using PMX, the new chromosome corresponding to the possible optimal solution would be created. Furthermore, each patient would possibly have three clinic statuses according to function 3: consultation, examination, and immediate follow-up consultation. Hence, we propose Partial Attribute/Gene crossover (PAX), which will only cross over genes with the same clinic status. This means that only the order of the same clinic status would change during the PAX crossover. In addition, to combine these two crossover methods, we adopt the two crossover steps depending on the probability [25]. Suppose that the probability of PMX crossover execution is q. In opposition, the probability of PMX crossover not being executed is 1−q. Considering PAX crossover, we assume that the probability of PAX crossover execution after PMX crossover execution would be 1−q. In opposition, the probability of PAX crossover not being executed is q. Hence, at least one crossover method would be selected for the new chromosome creation. The PMX and PAX crossover methods are established in individual containers. In other words, the crossover method of the genetic algorithm can now be modularized and independently executed. The containers are parallel-processed on the cloud. The XML-formatted chromosomes are received and delivered between the steps of the genetic algorithm and the corresponding containers. The following figure presents the hybrid crossover flowchart.The following is the pseudocode of the proposed genetic algorithm. Based on the hybrid crossover methods, at least one crossover method would be chosen. In other words, the genetic algorithm could keep searching the global optimal solution through enlarging the solution searching space.
- Mutation: With a defined mutation probability, randomly alter certain genes to maintain diversity.
- Fitness Evaluation: The fitness value corresponding to the objective function for each individual chromosome will be computed. All chromosomes will be ranked and sorted according to the fitness value. Only the chromosomes with a better fitness value will enter into the next generation or iteration.
- Iteration: Repeat steps 2 through 6 until the termination condition in step 2 is met.
3.4.2. Simulated Annealing (SA)
- Initialization: Set initial parameters, including the starting temperature, cooling schedule, and initial solution.
- Fitness Evaluation: The system will calculate the fitness value of the initial data.
- Termination Check: Evaluate whether the termination conditions (e.g., number of iterations, temperature, etc.) are satisfied or not.
- Generate New Solution: Create a neighboring solution by making small changes corresponding to the current solution. In other words, the fitness of the new solution will be different from the current one.
- Evaluate New solution: Compute the fitness value of the new candidate solution.
- Acceptance Decision: If the fitness value of new solution is better, the system will accept the new solution for the next iteration. If not, in this research, we propose the limited tree simulated annealing structure based on the container to enlarge the possible solution searching space. Instead of the traditional solution selection procedure, we could change the difference in the temperature, reducing wd to limited the solutions kept. The following is the pseudocode of the limited tree annealing structure. Otherwise, the new solution would be rejected.
- Cooling Schedule: Reduce the temperature according to the predefined cooling function.
- Iteration: Repeat steps 3 through 7 until the termination condition in step 3 is satisfied.
| Algorithm 1: Genetic algorithm (GA) workflow |
Input size of population New offspring rate p of generation rate of mutation numbers of generation Result: Output Solution T |
// Initialization 1. generate feasible solutions randomly; 2. save them in the population Pop; // Loop until terminal condition 3. for i = 1 to do 4. total numbers of offspring nc = ( * p)/2; 5. for j = 1 to nc do //Selection 6. select two parent solution TA and TB from Pop based on Tournament selection; //Crossover 7. generate TC and TD by Hybrid Crossover Method to TA and TB; 8. TC and TD fixed/repaired 9. save TC and TD to Pop2; 10. endfor //Mutation 11. for j = 1 to nc do 12. select a solution Tj from Pop2; 13. randomly mutate an attribute of Tj under the rate and generate a new solution Tj′; 14. if Tj′ is unfeasible 15. update Tj′ with a feasible solution by repairing Tj′; 16. endif 17. update Tj with Tj′ in Pop2; //updating 18. sort Pop and Pop2 together based on the fitness value according to the objective function and only leave the best individual in Pop // The current best solution is T′ 19. T = T′ 20. endfor //Returning the best solution 21. return the best solution T in Pop; |
| Algorithm 2: Simulated annealing (SA) workflow |
Data: Probability of worse solution keeping Initial temperature w Temperature reducing in each iteration Difference of the temperature reducing () Numbers of iteration Result: Output Solution T |
// Initialization 1. generate feasible solutions randomly T and compute the fitness ; // Loop until terminal condition 2. while current iteration <= ; 3. current iteration +1; 4. T’ = new feasible solution from the neighbor 5. compute the fitness f(T′) //Selection 6. If f(T′) is better than f(T) 7. T = T′ // limited tree annealing structure 8. else 9. for i = wd to wr do 10. T″ = new feasible solution from the neighbour of at T′ 11. If f(T″) is better than f(T′) 12. T′ = T″ 13. else 14. accept T′ = T″ with prob. 15. endif 16. endfor 17. If f(T′) is better than f(T) 18. accept T = T′ with prob. 19. endif 20. endif 21. w = w − wr; 22. endwhile 23. return the best solution T; |
3.4.3. Ant Colony Optimization (ACO) Workflow
- Initialization: Set parameters, including pheromone levels and heuristic factors, and initialize the ant population.
- Solution Construction: Each artificial ant constructs a solution path probabilistically based on pheromone levels and heuristic information.
- Fitness Evaluate: Evaluate the quality of each initial solution using a fitness function.
- Termination Check: Determine whether the termination criteria (e.g., number of iterations and convergence) have been satisfied.
- Pheromone Update: Update pheromone trails, which are used to indicate the quality of the found solutions. Evaporation is applied to reduce the influence of suboptimal paths.
- IterationL: Repeat steps 3 through 5 until the stopping condition in step 4 is met.The primary objective of the optimization, and therefore the core of the fitness function, is the minimization of overall patient waiting time. A solution’s fitness is evaluated based on the total waiting time produced by the schedule it represents. A lower total waiting time indicates a higher fitness. This is directly referenced in the “Total Waiting Time and Objective Function Evaluation” Section, which states that this metric “directly corresponds to the objective function of this study.”A solution in this context is a complete schedule for all patients. In the ACO framework, each “ant” constructs a potential solution by navigating the solution space and making a series of probabilistic decisions. The construction process is guided by two key factors:
- Pheromone Influence: This factor determines how much the existing pheromone trails influence an ant’s decision. A stronger pheromone trail on a path indicates that it has been part of successful solutions in previous iterations, making it a more attractive choice.
- Heuristic Desirability: This factor, represented as the “waiting time influence factor”, provides heuristic information to guide the ants. It encourages ants to prioritize paths that are known to lead to a reduction in patient waiting time, directly aligning their choices with the overall fitness function.
The pheromone trails are updated after each iteration to guide subsequent ants toward more promising areas of the solution space. This process involves two mechanisms:- Pheromone Evaporation: To avoid getting stuck in local optima and to encourage exploration, a portion of the pheromone evaporates from all paths. The “Pheromone Evaporation Rate” is set to 0.9, which means that 90% of the pheromone is retained and 10% evaporates after each iteration.
- Pheromone Reinforcement (Deposition): Ants deposit pheromone on the paths they have traveled to construct their solutions. The amount of pheromone deposited is proportional to the quality (fitness) of the solution found. The “pheromone reinforcement” value could be set by the system user, controlling how strongly these successful paths are positively reinforced. This ensures that paths leading to schedules with lower patient waiting times become more attractive for future ants.
| Algorithm 3: Ant colony optimization |
Data: Graph , Parameters Result: Best found solution Initialize pheromones for all 1. while Termination condition not met 2. for ant k = 0 to m do 3. Place ant k on starting node 4. while Solution for ant k is not complete do Select next node j from current node i with probability: = is the set of feasible neighbors for ant 5. end while 6. if < then 7. 8. end if 9. end for 10. for each edge () do Evaporation: Deposition: Calculate total deposited pheromone 11. 12. where if used edge (), else 0 13. 14. end for 15. end while 16. return |
4. Experiments and Validation
- 1 3 1 2 4 1 2 5 5 6 5 6
| State: | State: | State: | State: | State: | State: | State: |
| consultation | consultation | Follow-up | consultation | consultation | examination | examination |
| PtID: 1 | PtID: 3 | PtID: 1 | PtID: 2 | PtID: 4 | PtID: 1 | PtID: 2 |
| DID: clinic1 | DID: clinic1 | DID: clinic1 | DID: clinic2 | DID: clinic2 | DID: examine | DID: examine |
| Time: 15 ± 5 | Time: 15 ± 5 | Time: 10 ± 5 | Time: 15 ± 5 | Time: 15 ± 5 | Time: 20 ± 5 | Time: 20 ± 5 |
- Total Processing Time refers to the cumulative time required to complete all patients.
- Total Waiting Time in a single generation or iteration denotes the cumulative idle time for all patients, calculated from the following:
- –
- The delay between consultation and examination for those requiring examination;
- –
- The delay between consultation and examination plus the delay between examination and follow-up for those requiring both.
4.1. Configurations and Parameters of Intelligent Heuristic Algorithms
- Maximum Iterations: 1,000,000;
- Initial Temperature: 1.0;
- Cooling Rate: 0.9999;
- Final Temperature: 0.
- Population Size: 100;
- Maximum Generations: 1000;
- Crossover Rate: 0.8;
- Mutation Rate: 0.1;
- Elitism Rate: Top 10%;
- Stopping Criterion: No improvement for 100 generations;
- Selection Strategy: Tournament Selection (two-way).
- Iterations: 1,000,000;
- Pheromone Reinforcement: 0.002;
- Pheromone Evaporation Rate: 0.9;
- Pheromone Influence Factor : 1;
- Waiting Time Influence Factor : 3.
Experiments and Validation Results
4.2. Comparative Analysis of Intelligent Heuristic Algorithms
5. Conclusions
6. Discussion
- Inter-container Communication: The modular design requires data (like intermediate solutions) to be exchanged between different containers, which introduces latency and adds to the computational cost.
- Orchestration Overhead: The system incurs overhead from scheduling containers, allocating resources (CPU and memory), and synchronizing their states.
- Network and I/O Overhead: Context-switching and network I/O also contribute to delays, especially in multi-node cloud environments.
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Wang, C.H. Heuristic Algorithm for Solving the Scheduling Problem of Shared Resources Among Multiple Patients. Master’s Thesis, National Taiwan University of Science and Technology, Taiwan, China, 2025. [Google Scholar]
- Jian, M.S.; Shen, J.H.; Lee, K.W.; Jhou, Y.C.; Mai, C.T. Cloud Based Software Computing as a Service in Hybrid Evolution Algorithm with Feedback Assistance. J. Electron. Sci. Technol. 2016, 14, 362–369. [Google Scholar] [CrossRef]
- Jian, M.S.; You, M.S. Cloud Based Hybrid Evolution Algorithm for NP-Complete Pattern in Nurse Scheduling Problem. Int. J. Innov. Manag. Technol. 2016, 7, 234–237. [Google Scholar] [CrossRef]
- Zhu, P.; Chen, X.; Zhang, Z.; Li, P.; Cheng, X.; Dai, Y. AI-driven hypergraph neural network for predicting gasoline price trends. Energy Econ. 2025, 151, 108895. [Google Scholar] [CrossRef]
- El-Dosuky, M.A. CACO: Competitive Ant Colony Optimization, A Nature-Inspired Metaheuristic For Large-Scale Global Optimization. arXiv 2013, arXiv:1312.4044. [Google Scholar] [CrossRef]
- Yang, W.; Zhai, H.; Cui, L.; Guo, T. Research on Shared Vehicle Parking Location Optimization using Improved Simulated Annealing Algorithm. In Proceedings of the 5th International Conference on Neural Networks, Information and Communication Engineering (NNICE), Guangzhou, China, 10–12 January 2025; pp. 48–53. [Google Scholar] [CrossRef]
- Yang, X.; Liao, Z.; Hu, M.; Qian, B.; Song, J. Research on Agricultural Machinery Transportation Scheduling with an Improved Simulated Annealing Particle Swarm Optimization Algorithm. In Proceedings of the 5th International Conference on Neural Networks, Information and Communication Engineering (NNICE), Guangzhou, China, 10–12 January 2025; pp. 928–932. [Google Scholar] [CrossRef]
- Zhang, B.; Chen, X.; Chen, J.; Li, J.; Wang, X.; Jian, X. Path Planning for Distribution Network Robots with Adaptive Simulated Annealing-Enhanced Artificial Potential Field Method. In Proceedings of the IEEE International Conference on Industrial Technology (ICIT), Wuhan, China, 26–28 March 2025; pp. 1–7. [Google Scholar] [CrossRef]
- Jian, M.S.; Wang, C.H.; Wu, W.S.; Huang, T.W. Pipeline Based Genetic Algorithm for Patient Scheduling in Hospital Outpatient Department and Laboratory. In Proceedings of the 26th International Conference on Advanced Communications Technology (ICACT), PyeongChang, Republic of Korea, 4–7 February 2024; pp. 163–167. [Google Scholar] [CrossRef]
- Altamimi, M.; Ramaha, N. 0-1 Knapsack Problem Solving using Genetic Optimization Algorithm. Eng. Technol. J. 2024, 9, 4412–4426. [Google Scholar] [CrossRef]
- Guedan-Pecker, F.; Ramirez-Atencia, C. Airport take-off and landing optimization through genetic algorithms. Expert Syst. 2024, 41, e13565. [Google Scholar] [CrossRef]
- Guerrero, C.; Lera, I.; Juiz, C. Genetic Algorithm for Multi-Objective Optimization of Container Allocation in Cloud Architecture. J. Grid Comput. 2018, 16, 113–135. [Google Scholar] [CrossRef]
- Sayah, A.; Aqil, S.; Lahby, M. Hybrid Metaheuristics-Driven Distributed Task Scheduling for Latency-Sensitive Edge Data Processing. In Proceedings of the 12th IFIP International Conference on New Technologies, Mobility and Security (NTMS), Paris, France, 18–20 June 2025; pp. 129–135. [Google Scholar] [CrossRef]
- Shiraishi, M.; Takeuchi, R.; Nakagawa, H.; Nishimura, S.I.; Awazu, A.; Nishimori, H. Diverse stochasticity leads a colony of ants to optimal foraging. J. Theor. Biol. 2019, 465, 7–16. [Google Scholar] [CrossRef] [PubMed]
- Christensen, J.; Bastien, C. Chapter Seven—Heuristic and Meta-Heuristic Optimization Algorithms. In Nonlinear Optimization of Vehicle Safety Structures; Butterworth-Heinemann: Oxford, UK, 2016; pp. 277–314. [Google Scholar] [CrossRef]
- Jacob, M.; Gopika, S.; Cheripurathu, K.G. Multi-Constraint Multicast Routing for VANET using Hybridized Ant Colony with Artificial Bee Colony Optimization Algorithm. In Proceedings of the 3rd International Conference on Self Sustainable Artificial Intelligence Systems (ICSSAS), Erode, India, 11–13 June 2025; pp. 626–634. [Google Scholar] [CrossRef]
- Takagi, T.K.; Moriya, N.; Aoki, S.; Endo, K.; Muramatsu, M.; Fukagata, K. Implementation of spectral methods on Ising machines: Toward flow simulations on quantum annealer. Fluid Dyn. Res. 2024, 56. [Google Scholar] [CrossRef]
- Liu, Y.; Zhang, J.; Chan, F.T.S. AI-enhanced robust method for integrated healthcare resource pre-positioning and patient scheduling. Int. J. Prod. Res. 2024, 63, 729–757. [Google Scholar] [CrossRef]
- El Baz, N.; Mostafa, K. Applying Artificial Intelligence Algorithms for Optimized Hospital Resource Distribution and Improved Patient Flow Management. J. Comput. Intell. Hybrid Cloud Edge Comput. Netw. 2024, 8, 1–13. [Google Scholar]
- Semiz, F.; Polat, F. A Job-Assignment Heuristic for Lifelong Multi-Agent Path Finding Problem with Multiple Delivery Locations. arXiv 2020, arXiv:2003.07108. [Google Scholar] [CrossRef]
- Wang, Y.; Guo, T.; Liu, Z. An Expectation-Maximization Algorithm-based Autoregressive Model for the Fuzzy Job Shop Scheduling Problem. arXiv 2025, arXiv:2502.00018. [Google Scholar] [CrossRef]
- Jian, M.S.; Jhou, Y.C.; You, M.S. Modular Feedback Assistance Hybrid Evolution Algorithm Based on Cloud Environment for Job Shop Scheduling Problem Optimization. In Frontiers in Artificial Intelligence and Applications; IOS Press: Amsterdam, The Netherlands, 2015; Volume 275, pp. 205–215. [Google Scholar] [CrossRef]
- Wang, Z.; Li, J.; Chen, X.; Duan, P.; Li, J. Uncertain Interruptibility Multiobjective Flexible Job Shop via Deep Reinforcement Learning Based on Heterogeneous Graph Self-Attention. IEEE Trans. Neural Netw. Learn. Syst. 2025, 36, 18598–18612. [Google Scholar] [CrossRef] [PubMed]
- Li, Y.; Li, L.; Yang, X.; Zhao, B. Flexible Job Shop Scheduling Based On Energy Consumption of Method Research. IEEE Access 2025, 13, 127885–127901. [Google Scholar] [CrossRef]
- Jian, M.S.; Wu, W.S.; Lin, Y.H.; Wu, X.M.; Wang, P.W. Multi-Objective Optimization Based on Adaptive Evolution Algorithm for Disassembly Line Network Problems. In Proceedings of the 2022 24th International Conference on Advanced Communication Technology (ICACT), PyeongChang, Republic of Korea, 13–16 February 2022; pp. 524–533. [Google Scholar] [CrossRef]






| Consultation | Examination | Follow-Up Consultation |
|---|---|---|
| 1 | 1 | 1 |
| 3 | ||
| 6 | 6 |
| Consultation | Examination | Follow-Up Consultation |
|---|---|---|
| 2 | 2 | |
| 4 | ||
| 5 | 5 | 5 |
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. |
© 2025 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.
Share and Cite
Jian, M.-S.; Chen, P.-H.; Wang, C.-H.; Huang, B.-Y. Modularized Artificial Intelligence Services for Multiple Patients’ Medical Resource Sharing and Scheduling. Electronics 2026, 15, 31. https://doi.org/10.3390/electronics15010031
Jian M-S, Chen P-H, Wang C-H, Huang B-Y. Modularized Artificial Intelligence Services for Multiple Patients’ Medical Resource Sharing and Scheduling. Electronics. 2026; 15(1):31. https://doi.org/10.3390/electronics15010031
Chicago/Turabian StyleJian, Ming-Shen, Pei-Han Chen, Cheng-He Wang, and Bo-Yuan Huang. 2026. "Modularized Artificial Intelligence Services for Multiple Patients’ Medical Resource Sharing and Scheduling" Electronics 15, no. 1: 31. https://doi.org/10.3390/electronics15010031
APA StyleJian, M.-S., Chen, P.-H., Wang, C.-H., & Huang, B.-Y. (2026). Modularized Artificial Intelligence Services for Multiple Patients’ Medical Resource Sharing and Scheduling. Electronics, 15(1), 31. https://doi.org/10.3390/electronics15010031

