MayWin: Nurse Scheduling Problem Optimization Project
Introduction
The healthcare sector in Thailand faces a critical challenge: Nurse Scheduling. Traditional manual methods are complex and often result in unfair shift distributions, leading to nurse fatigue, high turnover, and decreased service quality.
MayWin is a fully functional scheduling platform designed specifically for Thai hospitals. It replaces manual, bias-prone processes with a reliable, fast, and transparent system. By balancing hospital rules with nurse preferences, MayWin increases staff satisfaction and saves hospitals significant time and resources.
Key Features
AI-Powered Optimization: Uses advanced Constraint Programming (CP-SAT) to generate schedules that respect labor laws, staffing requirements, and senior nurse presence.
LINE Chatbot Integration: Nurses can submit shift preferences and leave requests through a familiar LINE interface, powered by Natural Language Understanding (NLU) to interpret casual Thai and English messages.
Fairness-First Modeling: A multi-layered algorithm specifically designed to distribute "undesirable" shifts (like night shifts) evenly across the team.
Head Nurse Dashboard: A centralized web interface for administrators to review, adjust, and override AI-generated schedules with real-time feedback.
Automated Conflict Resolution: The system handles "NP-Hard" complexity, instantly solving billions of possible shift combinations to find the most feasible and satisfying result.
Development and Innovation
The innovation of MayWin lies in its Hybrid Optimization Engine and its seamless user experience.
The Hybrid Solver: CP-SAT & MILP
The system treats scheduling as a mathematical puzzle. It uses Constraint Programming (CP) to ensure all "Hard Constraints" (legal and safety rules) are met 100% of the time. Simultaneously, it uses Mixed-Integer Linear Programming (MILP) to handle "Soft Constraints" (personal preferences), applying a penalty scoring system to minimize dissatisfaction.
Multi-Tier Architecture
MayWin is built on a scalable, decoupled architecture that ensures high performance even for large hospitals:
Frontend Tier: Next.js web app and LINE Chatbot.
BFF (Backend-for-Frontend): Manages authentication and rate limiting.
Core Backend & Solver: A high-speed Python/NestJS environment where the optimization and NLU (Rasa) processing occur.
Intelligent Interaction (NLU)
Using the DIET (Dual Intent and Entity Transformer) architecture, the system accurately extracts dates and shift types from unstructured text, allowing nurses to "talk" to the scheduler as if they were messaging their supervisor.
Impact and Future Directions
MayWin bridges the gap between advanced academic research and practical, commercial application in Thailand.
For Nurses: Improved work-life balance through fair shift distribution and respected personal requests.
For Head Nurses: Reduction of manual scheduling workload from days to minutes, eliminating the stress of "puzzle-solving" every month.
For Hospitals: Reduced costs associated with nurse turnover and training, alongside improved patient safety through guaranteed staff coverage.
Future Roadmap:
Scalability: Horizontal expansion to support massive hospital networks through microservice replication.
Advanced Fairness: Implementation of a fairness-aware post-processing step to intelligently assign overtime based on historical satisfaction levels.
Market Expansion: Tailoring the platform for the broader Southeast Asian market, where similar scheduling challenges exist.