This study proposes a priority weight design for solving the nurse scheduling problem. Based on the fairness for each nurse's work shift, an optimal number of historical periods are inferred according to recently working data and priority weight setting records. In addition, we construct a mathematical model for nurse scheduling problem. By integrating the optimal number of historical periods, the designed weight for each nurse, and the proposed mathematical model, the nurse scheduling problem can be solved efficiently and easily. Nursing supervisors can adjust the computerized nurse scheduling output based on specific conditions and practical needs. Thus, the proposed model is flexible and effective in clinical applications.