# Data Mining Method of Enterprise Human Resource Management Based on Simulated Annealing Algorithm

Authors: Mingwei Xu; Chuang Li
Journal: Security and Communication Networks
 (2021)

---

## Abstract

The human resources department of an enterprise relies on the “mining” of big data when carrying out human resource management and proposes a data mining method for enterprise human resource management based on the simulated annealing algorithm. Applying the simulated annealing algorithm, using the Metropolis algorithm to generate the sequence of solutions to the combinatorial optimization problem, finding the overall optimal solution of the combinatorial optimization problem, using big data directional mining and analysis to help companies establish and find a “radar” system suitable for talents, the maximum tree method is adopted; that is, a special graph is constructed to realize the effective application of data mining technology in enterprise human resource management. The optimization of nurse scheduling in a hospital was used for case analysis. The results show that the target value of the nurse scheduling model is 43.43% lower than the actual manual scheduling target value, the salary cost is reduced by 10.8%, and the nurse’s satisfaction with the shift is increased by 35.24%. After several iterations based on the simulated annealing algorithm, the optimal value of the solution of the simulated annealing algorithm remains unchanged at the 60th generation. Then, the search process is stopped when the 100th generation is reached, and the solution at this time is the optimal optimization value found by the algorithm.


---

## Body

## 1. Introduction

The development of the social economy brings opportunities and challenges to the development of enterprises. Enterprises must adopt effective management methods, especially the city’s human resources management methods, so as to improve their competitiveness. At this stage, with the advent of the era of big data, enterprise human resource management is gradually using big data “mining” management methods. Through the scientific and effective extraction and analysis of huge and fragmented data, greater management wisdom and value can be generated, and it can provide decision-making reference for enterprise human resource management. Adapting to the changes of the times and innovating the means and methods of human resource management is the biggest challenge and opportunity faced by enterprise human resource managers in the era of big data, and it is also the key for enterprises to maintain their competitiveness in the fierce market competition. The simulated annealing (SA) algorithm [1] is an algorithm suitable for solving large-scale combinatorial optimization problems. The simulated annealing algorithm is derived from the simulation of the cooling process of solid annealing, using Metropolis criteria, including state space, state generation function, cooling schedule, Metropolis criteria, and internal and external cycle termination criteria. It is suitable for enterprise human resource management data mining.Reference [2] relies on the multimode fuzzy logic control algorithm, evaluates the comprehensive level of employees’ competence by establishing the degree of membership of workability, etc., and uses fuzzy sets and other methods to optimize the overall work efficiency, aiming to evaluate the effective support of enterprise human resource management. In order to realize the optimization of enterprise human resources optimal allocation management and improve the efficiency of enterprise human resources management, [3] designed an enterprise human resources optimal allocation model based on particle swarm optimization and proposed an enterprise human resources optimal scheduling and adaptive allocation method based on particle swarm optimization.


## 2. Simulated Annealing Algorithm

The goal of combinatorial optimization problems is to find the optimal solution from the feasible solution space of the combinatorial problem. Generally, it contains three basic elements: variables, constraints, and objective functions. The basic parameters selected in the solution process are called variables. Various restrictions on the value of variables are called constraints. The function that represents the measurement standard of the feasible solution is called the objective function. Solving combinatorial optimization problems is to find the most suitable solution in the solution set of the objective function, which inevitably requires the use of certain algorithms to reduce the time complexity and space complexity of the solution process. In 1982, Kirkpatrick et al. combined the idea of state changes in the solid annealing process and proposed an effective approximation algorithm similar to the solid de-temperature process—Simulate Anneal (SA) to solve the bottleneck encountered in large-scale combinatorial optimization problems. A simulated annealing algorithm is an algorithm to solve combinatorial optimization problems. It uses Metropolis acceptance criteria to make the algorithm escape the trap of local “optimum”, use the “cooling schedule” to control the entire algorithm implementation process, and finally enable the algorithm to get an approximate optimal solution in polynomial time [4].


### 2.1. The Similarity between Combinatorial Optimization and Solid Annealing

The annealing process of a metal object is actually a process in which the metal changes from a high-energy disordered state to a low-energy ordered solid crystalline state as the temperature slowly decreases. Similar physical processes have brought new solutions to the study of combinatorial optimization problems and combined with Metropolis criteria [5] to solve and analyze combinatorial optimization problems. Then, there is a certain similarity between the combinatorial optimization process based on the Metropolis criterion and the physical annealing process, as shown in Table 1.Table 1
Comparison table of solution of the combinatorial optimization problem and physical annealing.
Combinatorial optimization problemPhysical annealingUntieStateObjective functionEnergy functionOptimal solutionThe lowest energy stateSet the initial high temperatureHeating processSearch based on Metropolis criteriaIsothermal processDecrease of temperature parameter tCooling processIt can be seen from Table1 that when in a high-temperature state, since the physical state can be in any energy state, the corresponding simulated annealing algorithm can be regarded as a wide-area search in the solution space to avoid falling into the situation of locally optimal solutions. When it is in a low-temperature state, S can only be in a state with small energy. At this time, the simulated annealing algorithm can be regarded as a local domain search in the solution space in order to refine the feasible solution. When the annealing temperature is infinitely close to zero, S can only be in the minimum energy state and then the simulated annealing algorithm obtains the global optimal solution in the understanding space at this time.


### 2.2. Metropolis Guidelines

In view of the fact that the physical system tends to be in a state of lower energy and thermal motion prevents it from accurately falling into the lowest state of the image sampling, focusing on those states that have important contributions can quickly achieve better results. In 1953, Metropolis et al. proposed the importance sampling method [6]. They used the following method to generate a sequence of solid states.First, given the initial state I characterized by the relative position of the particles, as the current state of the solid, the energy of this state isEi. Then, a perturbation device is used to make a small change in the displacement of a randomly selected particle randomly, and a new state j, the energy of the new state Ej, is obtained. If Ej < Ei, the new state is regarded as an “important” state. If Ej > Ei, considering the influence of thermal motion, whether the new state is an “important” state, it should be judged based on the probability of the solid being in this state. It can be seen from pi=1/zexp−Ei/κT that the ratio of the probability that the solid is in the states i and j is equal to the ratio of the corresponding Boltzmann factor, namely,(1)γ=expEi−Ej/κT,where γ represents a number less than 1. The random number generator is used to generate a random number ξ in the interval of 0,1. If γ>ξ, the new state j is regarded as an important state; otherwise, it is discarded.If the new state is an important state, takej as the current state; otherwise, still take i as the current state, and repeat the above new state generation process. After a large amount of migration of the solid state is called migration, the system tends to a lower energy equilibrium state, and the probability distribution of the solid state tends to the pi=1/Zexp−Ei/κT-type Gibbs regular distribution.It can be seen from equations (3) and (4) that a new state with a large difference from the current state can be accepted at high temperature, and it is an important state, while at low temperature, only a new state with a small difference from the current state can be accepted as an important state. It is completely consistent with the effect of thermal movement at different temperatures. When the temperature approaches zero, any new state j with Ej > Ei cannot be accepted.The above-mentioned criterion for accepting the new state is called the Metropolis criterion, and the corresponding algorithm is called the Metropolis algorithm. The calculation amount of this algorithm is significantly reduced.


### 2.3. Simulated Annealing Algorithm Steps

Suppose that the objective functionf(i) of a solution i of the combinatorial optimization problem is equivalent to the energy Ei of a microscopic state i of the solid. Let the control parameter t, which decreases its value with its algorithm progress, play the role of the temperature T in the solid annealing process and then take a value for each control parameter t. The algorithm continues the process of “generating new solutions, accepting, and discarding”, that is, executing the Metropolis algorithm once [7]. The simulated annealing algorithm starts from a certain higher temperature, and after a large number of solution transformations, it can obtain the relatively optimal solution of the combinatorial optimization problem with a given control parameter value, then reduce the value of the control parameter, and repeatedly execute the Metropolis algorithm. When the control parameter t tends to 0, the overall optimal solution of the combinatorial optimization problem can be finally obtained [8].The simulated annealing algorithm uses the Metropolis algorithm to generate a sequence of solutions to the combinatorial optimization problem and is determined by the transition probabilitypi′ corresponding to the Metropolis criterion:(2)pi′i⟹j=1,if,fi≤fj,expfi−fjt.Determine whether to accept the transfer from the current solutioni to the new solution j. The t∈R+ in the above formula represents the control parameter. Start with a larger value of t (corresponding to the dissolution temperature of the solid). After enough transfers are made, slowly decrease the value of t. If this is repeated, the algorithm terminates when a certain stopping criterion is met. Assuming that there are domain structures and generators, let tk denote the value of the control parameter t during the kth iteration of the Metropolis algorithm, and let Lk denote the number of transformations generated during the kth iteration of the Metropolis algorithm.An optimization problem can be described as follows: whereS is a discrete finite state space and i represents the state. For such an optimization problem, the calculation steps of the SA algorithm can be described as follows:(3)minfi,i∈S.Step 1: Initialize, choose the initial solutioni∈S, give the initial temperature T0 and the end temperature Tf, and iterate the indicators k=0, T=kT0.Step 2: Randomly generate a neighborhood solutionj∈Ni(Ni represents the neighborhood of i), and calculate the target value increment Δf=fj−fi.Step 3: IfΔf=0, let i=j; go to step 4; otherwise, produce ξ=U0,1, if exp−Δf/Tk>ξ; let i=j.Step 4: If the thermal equilibrium is reached (the number of internal cycles is greater thannTk), go to step 5; otherwise, go to step 2.Step 5: DecreaseTk, k=k+1; if Tk<Tf, then the algorithm stops; otherwise, go to step 2.The above-mentioned simulated annealing algorithm can be visually described by the flow chart. SA algorithm operation process is shown in Figure1.Figure 1
SA algorithm operation process.It can be seen from the algorithm flow that the new state generation function, the new state acceptance function, the de-temperature function, the sampling stabilization criterion, the de-temperature end criterion, and the initial temperature are the main links and factors that affect the optimization results of the algorithm. The experimental performance of the simulated annealing algorithm has the advantages of high quality, strong initial value robustness, and easy implementation [9]. The simulated annealing algorithm accepts new solutions according to the Metropolis criterion, so in addition to accepting the optimized solution, it also accepts the weakened solution within a limited range. This is the essential difference between the simulated annealing algorithm and the local search algorithm. In the beginning, if the value of t is large, it is possible to accept worse deteriorating solutions; as the value decreases, only better deteriorating solutions can be accepted; finally, when the value of t tends to 0, no deteriorating solutions are accepted anymore. This allows the simulated annealing algorithm to break out of the “trap” of local optimization, and it is more likely to find the overall optimal solution of the combinatorial optimization problem, but without losing its simplicity and versatility [10].


## 2.1. The Similarity between Combinatorial Optimization and Solid Annealing

The annealing process of a metal object is actually a process in which the metal changes from a high-energy disordered state to a low-energy ordered solid crystalline state as the temperature slowly decreases. Similar physical processes have brought new solutions to the study of combinatorial optimization problems and combined with Metropolis criteria [5] to solve and analyze combinatorial optimization problems. Then, there is a certain similarity between the combinatorial optimization process based on the Metropolis criterion and the physical annealing process, as shown in Table 1.Table 1
Comparison table of solution of the combinatorial optimization problem and physical annealing.
Combinatorial optimization problemPhysical annealingUntieStateObjective functionEnergy functionOptimal solutionThe lowest energy stateSet the initial high temperatureHeating processSearch based on Metropolis criteriaIsothermal processDecrease of temperature parameter tCooling processIt can be seen from Table1 that when in a high-temperature state, since the physical state can be in any energy state, the corresponding simulated annealing algorithm can be regarded as a wide-area search in the solution space to avoid falling into the situation of locally optimal solutions. When it is in a low-temperature state, S can only be in a state with small energy. At this time, the simulated annealing algorithm can be regarded as a local domain search in the solution space in order to refine the feasible solution. When the annealing temperature is infinitely close to zero, S can only be in the minimum energy state and then the simulated annealing algorithm obtains the global optimal solution in the understanding space at this time.


## 2.2. Metropolis Guidelines

In view of the fact that the physical system tends to be in a state of lower energy and thermal motion prevents it from accurately falling into the lowest state of the image sampling, focusing on those states that have important contributions can quickly achieve better results. In 1953, Metropolis et al. proposed the importance sampling method [6]. They used the following method to generate a sequence of solid states.First, given the initial state I characterized by the relative position of the particles, as the current state of the solid, the energy of this state isEi. Then, a perturbation device is used to make a small change in the displacement of a randomly selected particle randomly, and a new state j, the energy of the new state Ej, is obtained. If Ej < Ei, the new state is regarded as an “important” state. If Ej > Ei, considering the influence of thermal motion, whether the new state is an “important” state, it should be judged based on the probability of the solid being in this state. It can be seen from pi=1/zexp−Ei/κT that the ratio of the probability that the solid is in the states i and j is equal to the ratio of the corresponding Boltzmann factor, namely,(1)γ=expEi−Ej/κT,where γ represents a number less than 1. The random number generator is used to generate a random number ξ in the interval of 0,1. If γ>ξ, the new state j is regarded as an important state; otherwise, it is discarded.If the new state is an important state, takej as the current state; otherwise, still take i as the current state, and repeat the above new state generation process. After a large amount of migration of the solid state is called migration, the system tends to a lower energy equilibrium state, and the probability distribution of the solid state tends to the pi=1/Zexp−Ei/κT-type Gibbs regular distribution.It can be seen from equations (3) and (4) that a new state with a large difference from the current state can be accepted at high temperature, and it is an important state, while at low temperature, only a new state with a small difference from the current state can be accepted as an important state. It is completely consistent with the effect of thermal movement at different temperatures. When the temperature approaches zero, any new state j with Ej > Ei cannot be accepted.The above-mentioned criterion for accepting the new state is called the Metropolis criterion, and the corresponding algorithm is called the Metropolis algorithm. The calculation amount of this algorithm is significantly reduced.


## 2.3. Simulated Annealing Algorithm Steps

Suppose that the objective functionf(i) of a solution i of the combinatorial optimization problem is equivalent to the energy Ei of a microscopic state i of the solid. Let the control parameter t, which decreases its value with its algorithm progress, play the role of the temperature T in the solid annealing process and then take a value for each control parameter t. The algorithm continues the process of “generating new solutions, accepting, and discarding”, that is, executing the Metropolis algorithm once [7]. The simulated annealing algorithm starts from a certain higher temperature, and after a large number of solution transformations, it can obtain the relatively optimal solution of the combinatorial optimization problem with a given control parameter value, then reduce the value of the control parameter, and repeatedly execute the Metropolis algorithm. When the control parameter t tends to 0, the overall optimal solution of the combinatorial optimization problem can be finally obtained [8].The simulated annealing algorithm uses the Metropolis algorithm to generate a sequence of solutions to the combinatorial optimization problem and is determined by the transition probabilitypi′ corresponding to the Metropolis criterion:(2)pi′i⟹j=1,if,fi≤fj,expfi−fjt.Determine whether to accept the transfer from the current solutioni to the new solution j. The t∈R+ in the above formula represents the control parameter. Start with a larger value of t (corresponding to the dissolution temperature of the solid). After enough transfers are made, slowly decrease the value of t. If this is repeated, the algorithm terminates when a certain stopping criterion is met. Assuming that there are domain structures and generators, let tk denote the value of the control parameter t during the kth iteration of the Metropolis algorithm, and let Lk denote the number of transformations generated during the kth iteration of the Metropolis algorithm.An optimization problem can be described as follows: whereS is a discrete finite state space and i represents the state. For such an optimization problem, the calculation steps of the SA algorithm can be described as follows:(3)minfi,i∈S.Step 1: Initialize, choose the initial solutioni∈S, give the initial temperature T0 and the end temperature Tf, and iterate the indicators k=0, T=kT0.Step 2: Randomly generate a neighborhood solutionj∈Ni(Ni represents the neighborhood of i), and calculate the target value increment Δf=fj−fi.Step 3: IfΔf=0, let i=j; go to step 4; otherwise, produce ξ=U0,1, if exp−Δf/Tk>ξ; let i=j.Step 4: If the thermal equilibrium is reached (the number of internal cycles is greater thannTk), go to step 5; otherwise, go to step 2.Step 5: DecreaseTk, k=k+1; if Tk<Tf, then the algorithm stops; otherwise, go to step 2.The above-mentioned simulated annealing algorithm can be visually described by the flow chart. SA algorithm operation process is shown in Figure1.Figure 1
SA algorithm operation process.It can be seen from the algorithm flow that the new state generation function, the new state acceptance function, the de-temperature function, the sampling stabilization criterion, the de-temperature end criterion, and the initial temperature are the main links and factors that affect the optimization results of the algorithm. The experimental performance of the simulated annealing algorithm has the advantages of high quality, strong initial value robustness, and easy implementation [9]. The simulated annealing algorithm accepts new solutions according to the Metropolis criterion, so in addition to accepting the optimized solution, it also accepts the weakened solution within a limited range. This is the essential difference between the simulated annealing algorithm and the local search algorithm. In the beginning, if the value of t is large, it is possible to accept worse deteriorating solutions; as the value decreases, only better deteriorating solutions can be accepted; finally, when the value of t tends to 0, no deteriorating solutions are accepted anymore. This allows the simulated annealing algorithm to break out of the “trap” of local optimization, and it is more likely to find the overall optimal solution of the combinatorial optimization problem, but without losing its simplicity and versatility [10].


## 3. Enterprise Human Resource Management Data Mining

With the improvement of information level and data decision-making capabilities, traditional human resource management in the era of big data is constantly changing. Based on the corporate vision and strategy, the effective application of data mining technology in corporate human resource management is conducive to the reasonable matching of personnel and posts, giving full play to the work abilities and potential of employees, improving organizational and employee performance, and achieving sustainable corporate development. Through the analysis of the status quo of enterprise human resource management recruitment and selection, performance management, salary management, training and development under the background of data mining, and the direction and strategy of human resource management reform are discussed, and it provides a reference for optimizing enterprise human resource management [11].Enterprise human resources can learn about talents from each other through the management of big data mining, such as personal social networking site performance, and personal evaluation in the “friend circle” and then determine whether the talent is suitable for the company’s recruitment requirements, ensure the quality of corporate talent recruitment, and promote the improvement of human resource management. Based on cloud technology, we use big data targeted mining and analysis to help companies establish and find a “radar” system suitable for talents. That is, a recommendation platform is constructed through data collection and online analysis to form a complete analysis of points, lines, and areas and then use the data to search for and recruit talents according to the map. When using big data mining for management, the relationship between behavior and results can be fully analyzed, so as to draw related laws [12]. For example, when assigning positions, business managers can judge what kind of person is suitable for what kind of position based on the results of the analysis, and what kind of person can create high benefits. In the management of human resources, not only can effective decision-making be made, but also a database can be established so that the specific situation of talents can be monitored in real time. The judgment of high-performance talents requires four aspects of decision-making, namely, resume data, the performance data of the talent in the first year, the talent’s use of working time and work efficiency, and the dynamics of the talent in the social circle. The key part of the human resource management of an enterprise is to fully understand the characteristics of different talents and then assign positions that are suitable for them. More and more companies have relied on big data mining to establish accurate human capacity models, so as to analyze the characteristics of different talents from many aspects and improve the management level of human resources. At the same time, enterprise managers must clearly understand the internal talent structure and quality of the enterprise as well as the specific conditions of various positions in the enterprise, so as to ensure that the staffing is optimized. In addition, the mining of big data can help companies conduct dynamic analysis when recruiting talents, and the talent recruitment plan is completed with quality and standard.The general process of data mining is as follows:Preprocess data: Collect and purify information from data sources, and store it, usually in a data warehouse.Model search: Use data mining tools to find models in the data. This search process can be performed automatically by the system. The original facts can be searched from the bottom up to find a certain connection between them, and user interaction can also be added. The analysts take the initiative to ask questions and search from top to bottom to verify that the assumptions are correct.Result analysis: The search process of data mining generally needs to be repeated many times, because after the analyst evaluates the output results, some new problems may be formed or a more refined query is required for a certain aspect, and the final result report is generated.Knowledge assimilation: Interpreting the results report, interpreting the results, and taking corresponding measures based on the results, this is a manual process.Using this model, you can discover the types of talents that exist in the organization, and you can also determine which of these types an employee belongs to.Based on all data records in the data warehouse, a sample setH to be classified is established. The objects to be classified are called samples, such as h1,h2,…,hnand H=h1,h2,…,hn as sample sets. In order to achieve a reasonable sample classification, the specific attributes should be quantified. The quantified attributes become the sample indicators. There are m indicators, and an m-dimensional vector can be used to describe the sample, namely,(4)hi=hi1,hi2,…,him,i=1,2,⋯,n.Since the actual data is the one, the collected data are often not0,1 closed interval numbers, so these raw data should be standardized. First, find the average value. For example, there are n samples in the sample set. For a certain index k of the sample, n data h1k,h2k,…,hnk can be obtained, where hnk represents the data obtained by the i-th sample for the kth index. Their average value is calculated according to the following formula:(5)hk′=h1k,h2l,…,hnkn=∑i=1nhik,k=1,2,…,m.Then, calculate the standard deviationSk of these original data according to the following formula:(6)Sk=∑i=1nhik′−hk′2n.Calculate the standardized valuehik″:(7)hik″=hik′−hik′Sk.If the standardized datahik″ obtained at this time is not in the closed interval of 0,1, then the following extreme value standardized formula is used:(8)hik=hik″−hmink″hmaxk″−hmink″.In the formula, hmaxk″and hmink″represent the maximum and minimum values in h1k″,h2k″,…,hnk″, respectively. The general form of establishing the modulus similarity relationship R, R is as follows:(9)R=r11r12⋯r1nr21r22⋯r2n⋮⋮⋯⋮rn1rn2⋯rnn,0≤rij≤1,i=1,2,…,n,j=1,2,…,n.Use the maximum and minimum method to calculaterij:(10)rij=∑k=1mminhik,hij∑k=1mminhik,hij,i,j≤n.The maximum tree method is adopted; that is, a special graph is constructed, with all classified objects as vertices. When rij≠0, vertex i and vertex j can be connected to one edge. The specific method is to first draw a certain i in the vertex set and then connect the edges in order of rij from largest to smallest and require no loops until all vertices are connected so that a maximum tree is obtained [13]. To be precise, it is an “empowerment” tree. Each edge can be assigned a certain weight, namely, rij. However, due to the different connection methods, this largest tree cannot be unique. Then, take the λ cut set for the maximum number; that is, remove those edges with weight rij<λ, λ∈[0,1]. In this way, a tree is cut into several subtrees that are not connected to each other. Although the largest tree is not unique, after taking the cut set, the subtrees obtained are the same, and these subdata are the patterns found by induction in the data warehouse [14].According to the following formula, solve the average index of each mode:(11)Modeij=∑hikp,i=1,2,…,s;j=1,2,…,m,where s represents the total number of patterns, k represents the number of records in the warehouse from which the pattern (that is, the i-th pattern) was launched, and p represents the total number of records that launched the pattern.For the sampleX (X1, X2,..., Xn) to be predicted, the n fuzzy subsets of the sample in the universe H are compared with the classified patterns in the data warehouse to find the closeness between them:(12)X,Modei=12X⋅Modei+1−X⊙Modei,where ⋅ and ⊙ represent the inner product and outer product in fuzzy operations, respectively.According to the principle of choosing the nearest, namely,(13)=maxX,Mode1,X,Mode2,…,X,Modes,determine which model the sample is close to, and predict the result from the overall situation of this model.


## 4. Experimental Study

This article is designed to optimize the nurse scheduling algorithm in a hospital based on the simulated annealing algorithm and verify the effectiveness of the algorithm through case analysis.


### 4.1. Experimental Data Analysis

The nurse data in this article comes from the survey results of the “Questionnaire for Nurses’ Working Status in XXX Hospital of Zhongshan City”. At present, there are a total of nurses in the intensive care department of a third-class hospital in Zhongshan City, including 3, 5, and 22 nurses in high school, middle school, and junior high school. Assume that the scheduling period is one week (J = 7). And the daily working hours are divided into three classes: Class A (8 : 00–16 : 00), Class P (16 : 00–0:00), and Class N (0 : 00–8:00). Through the research report of “Survey Questionnaire of Nurses’ Working Status in Zhongshan XXX Hospital”, the main factors affecting the quality of scheduling are analyzed, as shown in Table 2.Table 2
Table of influencing factors of shift quality.
Serial numberFactors affecting schedulingReference suggestion1Consecutive working days3 days-4 days2Continuous working hours3–10 hours3Continuous evening shift1 day-2 days4The total number of shifts in the scheduling period4 days-6 days5Total working hours in the scheduling periodWeekly work hours are around 40 hours6Consecutive days off1 day-2 days7Reasonableness of shiftIf the nurse should arrange a rest after the night shift, it is not allowed to arrange for the nurse to continue the morning shift8Balance of work hours during the shift scheduleIt is necessary to ensure that the working hours of each nurse are equal during the scheduling cycle9Balance of evening shifts during the shift scheduleIt is necessary to ensure that the number of night shifts of each nurse during the scheduling cycle is relatively fair10Balance of rest time during the scheduling cycleIt is necessary to ensure that the rest time of each nurse is relatively fair during the scheduling cycle11Balance of shifts in the scheduling cycleIt is necessary to ensure that the number of shifts of each nurse in the scheduling cycle is relatively fair12High regularity of schedulingThe change of working hours is relatively stable, providing a kind of humane schedulingFrom the above statistical table of influencing factors of scheduling quality, it can be seen that the maximum time that each nurse can work continuously is 4 shifts, and the longest continuous night shift is 2 shifts. In a scheduling cycle, the longest working shift of each nurse is at most 6 shifts, and the shortest working shift is at least one shift. The total working hours in the scheduling cycle are about 40 hours, and the actual number of nurses required for each shift of “APN” per day is given by the head nurse of the department, as shown in Table3:Table 3
Number of nurses required by shift (ClassA/Class P/Class N).
WeekMondayTuesdayWednesdayThursdayFridaySaturdaySundayNumber of nurses required9/6/48/5/39/6/38/5/39/7/410/7/710/7/7At present, the Intensive Care Department of Zhongshan Hospital adopts the “flexible scheduling” system. The weekly schedule is manually scheduled by the head nurse based on the demand for nurses in the department and the nurse’s family and living conditions. The detailed manual schedule is shown in Table4.Table 4
Original schedule.
MondayTuesdayWednesdayThursdayFridaySaturdaySunday1APRNNAP2APPRAPN3PANRAPA4APNRAAP5PRPRAAP6RRPAPNN7APPRPNN8APPRPAP9PRNNRPA10PRNNRPP


### 4.2. Simulated Annealing Algorithm Simulation Results

#### 4.2.1. Solution Space and Coding Selection

Combinatorial optimization is to find the optimal solutionx∗, so that ∀xi∈Ω, Cx∗=minCxi, where Ω=x1,x2,…,xn is the solution space formed by all states, and Cx∗ represents the value of the objective function corresponding to the state si.The coding strategies of the nurse scheduling model mainly include nearest neighbor coding, order coding, binary coding, and matrix coding. Sequence coding is not conducive to global optimization. Binary coding is unnatural and requires additional correction operators to ensure the legitimacy of the solution; matrix coding has a large storage capacity and affects the optimization efficiency of genetic operators. Based on this, nearest neighbor coding is a commonly used strategy to describe nurse scheduling problems.The so-called nearest neighbor coding directly uses the solution to construct the optimized form, such as the solution is 010101...0110. The corresponding nearest neighbor code is (0 1 0 1 0 1...0 1 1 0). This coding method conforms to the characteristics of the solution of the 0–1 integer programming problem and is also conducive to the design of optimization operations.


#### 4.2.2. The Design of SA State Generating Function

For the operation of the SA state generation function based on the nearest neighbor coding, it can be designed as a random operation; that is, a random number of 0 or 1 is randomly generated.X1 = zeros(x1Group,x1N) randomly generate 840-dimensional 0, 1 initial solution x1, and then x2 = x1+round((-0.5+rand(x1Group,x1N))∗2)∗distance function to generate a new solution x2 and ensure that the new solution x2 satisfies the 0-1 constraint. Based on the random state generation function of the initial solution, the search space for understanding is increased to avoid falling into a local solution.


#### 4.2.3. Design of SA State Acceptance Function

The state acceptance function is the key to the algorithm’s ability to generate probabilistic jumps, and it can avoid local minima under the guidance of the distribution mechanism. Combined with the state generation function based on random operation, in order to make the search process have the ability to overcome the local minimum and meet the symmetry condition of the SA algorithm. Themin1,exp−Δ/t>random0,1 criterion is the most commonly used scheme for accepting the new state, where Δ represents the target value difference between the old and the new state, and t represents the temperature.


#### 4.2.4. Initial Temperature and Initial State

The most commonly used and understandable initial and temperature determination scheme is to first randomly generate a set of states, determine the maximum target difference between the two statesΔmax, and then use t0=−Δmax/lnpτ. Among them, pτ is the initial acceptance probability (in theory, it should be close to 1, and it can be 0.1 in actual design), and the initial state is generated by a 0–1 random function. Take t0=10001 in the experiment.


#### 4.2.5. The Design of Derating Temperature Function

Theoretically, the temperature should decrease at a very slow rate, such as the reciprocal of the logarithm. However, in order to avoid an overly lengthy search process and a good compromise between optimization quality and time performance, the exponential inversion function is the most commonly used temperature reduction strategy, which istk=λtk−1In the formula,λ represents the rate of temperature reduction, of which λ=0.99.


#### 4.2.6. Design of Temperature Modification Criterion and Algorithm Termination Criterion

In order to adapt to the dynamic changes of algorithm performance and to better balance the optimization performance and time performance of the algorithm, the two criteria of “temperature modification” and “algorithm termination” designed by the threshold method can be adopted. That is, if the best-optimized value obtained in the optimization process remains unchanged for 20 consecutive generations, then the temperature is reduced. If the optimal value remains unchanged for 20 consecutive `, the search process is terminated, and the optimal value is the optimization result of the algorithm.The calculation results of the detailed nurse scheduling model are shown in Table5.Table 5
Table of calculation results of nurse scheduling model.
Actual manual scheduleNurse scheduling modelDeviationTarget value252.5143−43.4％Wage cost575513−10.8％Satisfaction this time71596735.24％Algorithm running time (s)-5.08The detailed convergence of the simulated nurse scheduling model using the simulated annealing algorithm is shown in Figure2.Figure 2
Convergence graph based on simulated annealing algorithm.The following can be seen from the simulation results:(1)
It can be seen from the table that the target value of the nurse scheduling model is 43.43% lower than the target value of the actual manual scheduling, of which the salary cost is reduced by 10.8%, but the nurse’s satisfaction with the shift has increased by 35.24%. This shows that the nurse scheduling model based on strong and weak constraints is significantly better than the manual scheduling model, achieving an effective balance between hospital salary cost control and nurse satisfaction improvement. The successful application of the nurse scheduling model based on the simulated annealing algorithm brings new inspiration and ideas for solving large-scale nurse scheduling problems.(2)
It can be found that after several iterations based on the simulated annealing algorithm, the optimal value of the solution of the simulated annealing algorithm remains unchanged at the 60th generation. Then, the search process is stopped when the 100th generation is reached, and the solution at this time is the optimal optimization value found by the algorithm.The nurse schedule is optimized by the simulated annealing algorithm, and the final schedule is shown in Table6. Nurses schedule is shown in Figure 3.Table 6
Nurses schedule.
MondayTuesdayWednesdayThursdayFridaySaturdaySunday1PAARAAR2RPANNRA3APRRPPR4ARARPPR5ANPARRN6PANPNPN7AAARRRN8RANANRN9RAAANNR10ARAAAARFigure 3
Nurses schedule.


## 4.1. Experimental Data Analysis

The nurse data in this article comes from the survey results of the “Questionnaire for Nurses’ Working Status in XXX Hospital of Zhongshan City”. At present, there are a total of nurses in the intensive care department of a third-class hospital in Zhongshan City, including 3, 5, and 22 nurses in high school, middle school, and junior high school. Assume that the scheduling period is one week (J = 7). And the daily working hours are divided into three classes: Class A (8 : 00–16 : 00), Class P (16 : 00–0:00), and Class N (0 : 00–8:00). Through the research report of “Survey Questionnaire of Nurses’ Working Status in Zhongshan XXX Hospital”, the main factors affecting the quality of scheduling are analyzed, as shown in Table 2.Table 2
Table of influencing factors of shift quality.
Serial numberFactors affecting schedulingReference suggestion1Consecutive working days3 days-4 days2Continuous working hours3–10 hours3Continuous evening shift1 day-2 days4The total number of shifts in the scheduling period4 days-6 days5Total working hours in the scheduling periodWeekly work hours are around 40 hours6Consecutive days off1 day-2 days7Reasonableness of shiftIf the nurse should arrange a rest after the night shift, it is not allowed to arrange for the nurse to continue the morning shift8Balance of work hours during the shift scheduleIt is necessary to ensure that the working hours of each nurse are equal during the scheduling cycle9Balance of evening shifts during the shift scheduleIt is necessary to ensure that the number of night shifts of each nurse during the scheduling cycle is relatively fair10Balance of rest time during the scheduling cycleIt is necessary to ensure that the rest time of each nurse is relatively fair during the scheduling cycle11Balance of shifts in the scheduling cycleIt is necessary to ensure that the number of shifts of each nurse in the scheduling cycle is relatively fair12High regularity of schedulingThe change of working hours is relatively stable, providing a kind of humane schedulingFrom the above statistical table of influencing factors of scheduling quality, it can be seen that the maximum time that each nurse can work continuously is 4 shifts, and the longest continuous night shift is 2 shifts. In a scheduling cycle, the longest working shift of each nurse is at most 6 shifts, and the shortest working shift is at least one shift. The total working hours in the scheduling cycle are about 40 hours, and the actual number of nurses required for each shift of “APN” per day is given by the head nurse of the department, as shown in Table3:Table 3
Number of nurses required by shift (ClassA/Class P/Class N).
WeekMondayTuesdayWednesdayThursdayFridaySaturdaySundayNumber of nurses required9/6/48/5/39/6/38/5/39/7/410/7/710/7/7At present, the Intensive Care Department of Zhongshan Hospital adopts the “flexible scheduling” system. The weekly schedule is manually scheduled by the head nurse based on the demand for nurses in the department and the nurse’s family and living conditions. The detailed manual schedule is shown in Table4.Table 4
Original schedule.
MondayTuesdayWednesdayThursdayFridaySaturdaySunday1APRNNAP2APPRAPN3PANRAPA4APNRAAP5PRPRAAP6RRPAPNN7APPRPNN8APPRPAP9PRNNRPA10PRNNRPP


## 4.2. Simulated Annealing Algorithm Simulation Results

### 4.2.1. Solution Space and Coding Selection

Combinatorial optimization is to find the optimal solutionx∗, so that ∀xi∈Ω, Cx∗=minCxi, where Ω=x1,x2,…,xn is the solution space formed by all states, and Cx∗ represents the value of the objective function corresponding to the state si.The coding strategies of the nurse scheduling model mainly include nearest neighbor coding, order coding, binary coding, and matrix coding. Sequence coding is not conducive to global optimization. Binary coding is unnatural and requires additional correction operators to ensure the legitimacy of the solution; matrix coding has a large storage capacity and affects the optimization efficiency of genetic operators. Based on this, nearest neighbor coding is a commonly used strategy to describe nurse scheduling problems.The so-called nearest neighbor coding directly uses the solution to construct the optimized form, such as the solution is 010101...0110. The corresponding nearest neighbor code is (0 1 0 1 0 1...0 1 1 0). This coding method conforms to the characteristics of the solution of the 0–1 integer programming problem and is also conducive to the design of optimization operations.


### 4.2.2. The Design of SA State Generating Function

For the operation of the SA state generation function based on the nearest neighbor coding, it can be designed as a random operation; that is, a random number of 0 or 1 is randomly generated.X1 = zeros(x1Group,x1N) randomly generate 840-dimensional 0, 1 initial solution x1, and then x2 = x1+round((-0.5+rand(x1Group,x1N))∗2)∗distance function to generate a new solution x2 and ensure that the new solution x2 satisfies the 0-1 constraint. Based on the random state generation function of the initial solution, the search space for understanding is increased to avoid falling into a local solution.


### 4.2.3. Design of SA State Acceptance Function

The state acceptance function is the key to the algorithm’s ability to generate probabilistic jumps, and it can avoid local minima under the guidance of the distribution mechanism. Combined with the state generation function based on random operation, in order to make the search process have the ability to overcome the local minimum and meet the symmetry condition of the SA algorithm. Themin1,exp−Δ/t>random0,1 criterion is the most commonly used scheme for accepting the new state, where Δ represents the target value difference between the old and the new state, and t represents the temperature.


### 4.2.4. Initial Temperature and Initial State

The most commonly used and understandable initial and temperature determination scheme is to first randomly generate a set of states, determine the maximum target difference between the two statesΔmax, and then use t0=−Δmax/lnpτ. Among them, pτ is the initial acceptance probability (in theory, it should be close to 1, and it can be 0.1 in actual design), and the initial state is generated by a 0–1 random function. Take t0=10001 in the experiment.


### 4.2.5. The Design of Derating Temperature Function

Theoretically, the temperature should decrease at a very slow rate, such as the reciprocal of the logarithm. However, in order to avoid an overly lengthy search process and a good compromise between optimization quality and time performance, the exponential inversion function is the most commonly used temperature reduction strategy, which istk=λtk−1In the formula,λ represents the rate of temperature reduction, of which λ=0.99.


### 4.2.6. Design of Temperature Modification Criterion and Algorithm Termination Criterion

In order to adapt to the dynamic changes of algorithm performance and to better balance the optimization performance and time performance of the algorithm, the two criteria of “temperature modification” and “algorithm termination” designed by the threshold method can be adopted. That is, if the best-optimized value obtained in the optimization process remains unchanged for 20 consecutive generations, then the temperature is reduced. If the optimal value remains unchanged for 20 consecutive `, the search process is terminated, and the optimal value is the optimization result of the algorithm.The calculation results of the detailed nurse scheduling model are shown in Table5.Table 5
Table of calculation results of nurse scheduling model.
Actual manual scheduleNurse scheduling modelDeviationTarget value252.5143−43.4％Wage cost575513−10.8％Satisfaction this time71596735.24％Algorithm running time (s)-5.08The detailed convergence of the simulated nurse scheduling model using the simulated annealing algorithm is shown in Figure2.Figure 2
Convergence graph based on simulated annealing algorithm.The following can be seen from the simulation results:(1)
It can be seen from the table that the target value of the nurse scheduling model is 43.43% lower than the target value of the actual manual scheduling, of which the salary cost is reduced by 10.8%, but the nurse’s satisfaction with the shift has increased by 35.24%. This shows that the nurse scheduling model based on strong and weak constraints is significantly better than the manual scheduling model, achieving an effective balance between hospital salary cost control and nurse satisfaction improvement. The successful application of the nurse scheduling model based on the simulated annealing algorithm brings new inspiration and ideas for solving large-scale nurse scheduling problems.(2)
It can be found that after several iterations based on the simulated annealing algorithm, the optimal value of the solution of the simulated annealing algorithm remains unchanged at the 60th generation. Then, the search process is stopped when the 100th generation is reached, and the solution at this time is the optimal optimization value found by the algorithm.The nurse schedule is optimized by the simulated annealing algorithm, and the final schedule is shown in Table6. Nurses schedule is shown in Figure 3.Table 6
Nurses schedule.
MondayTuesdayWednesdayThursdayFridaySaturdaySunday1PAARAAR2RPANNRA3APRRPPR4ARARPPR5ANPARRN6PANPNPN7AAARRRN8RANANRN9RAAANNR10ARAAAARFigure 3
Nurses schedule.


## 4.2.1. Solution Space and Coding Selection

Combinatorial optimization is to find the optimal solutionx∗, so that ∀xi∈Ω, Cx∗=minCxi, where Ω=x1,x2,…,xn is the solution space formed by all states, and Cx∗ represents the value of the objective function corresponding to the state si.The coding strategies of the nurse scheduling model mainly include nearest neighbor coding, order coding, binary coding, and matrix coding. Sequence coding is not conducive to global optimization. Binary coding is unnatural and requires additional correction operators to ensure the legitimacy of the solution; matrix coding has a large storage capacity and affects the optimization efficiency of genetic operators. Based on this, nearest neighbor coding is a commonly used strategy to describe nurse scheduling problems.The so-called nearest neighbor coding directly uses the solution to construct the optimized form, such as the solution is 010101...0110. The corresponding nearest neighbor code is (0 1 0 1 0 1...0 1 1 0). This coding method conforms to the characteristics of the solution of the 0–1 integer programming problem and is also conducive to the design of optimization operations.


## 4.2.2. The Design of SA State Generating Function

For the operation of the SA state generation function based on the nearest neighbor coding, it can be designed as a random operation; that is, a random number of 0 or 1 is randomly generated.X1 = zeros(x1Group,x1N) randomly generate 840-dimensional 0, 1 initial solution x1, and then x2 = x1+round((-0.5+rand(x1Group,x1N))∗2)∗distance function to generate a new solution x2 and ensure that the new solution x2 satisfies the 0-1 constraint. Based on the random state generation function of the initial solution, the search space for understanding is increased to avoid falling into a local solution.


## 4.2.3. Design of SA State Acceptance Function

The state acceptance function is the key to the algorithm’s ability to generate probabilistic jumps, and it can avoid local minima under the guidance of the distribution mechanism. Combined with the state generation function based on random operation, in order to make the search process have the ability to overcome the local minimum and meet the symmetry condition of the SA algorithm. Themin1,exp−Δ/t>random0,1 criterion is the most commonly used scheme for accepting the new state, where Δ represents the target value difference between the old and the new state, and t represents the temperature.


## 4.2.4. Initial Temperature and Initial State

The most commonly used and understandable initial and temperature determination scheme is to first randomly generate a set of states, determine the maximum target difference between the two statesΔmax, and then use t0=−Δmax/lnpτ. Among them, pτ is the initial acceptance probability (in theory, it should be close to 1, and it can be 0.1 in actual design), and the initial state is generated by a 0–1 random function. Take t0=10001 in the experiment.


## 4.2.5. The Design of Derating Temperature Function

Theoretically, the temperature should decrease at a very slow rate, such as the reciprocal of the logarithm. However, in order to avoid an overly lengthy search process and a good compromise between optimization quality and time performance, the exponential inversion function is the most commonly used temperature reduction strategy, which istk=λtk−1In the formula,λ represents the rate of temperature reduction, of which λ=0.99.


## 4.2.6. Design of Temperature Modification Criterion and Algorithm Termination Criterion

In order to adapt to the dynamic changes of algorithm performance and to better balance the optimization performance and time performance of the algorithm, the two criteria of “temperature modification” and “algorithm termination” designed by the threshold method can be adopted. That is, if the best-optimized value obtained in the optimization process remains unchanged for 20 consecutive generations, then the temperature is reduced. If the optimal value remains unchanged for 20 consecutive `, the search process is terminated, and the optimal value is the optimization result of the algorithm.The calculation results of the detailed nurse scheduling model are shown in Table5.Table 5
Table of calculation results of nurse scheduling model.
Actual manual scheduleNurse scheduling modelDeviationTarget value252.5143−43.4％Wage cost575513−10.8％Satisfaction this time71596735.24％Algorithm running time (s)-5.08The detailed convergence of the simulated nurse scheduling model using the simulated annealing algorithm is shown in Figure2.Figure 2
Convergence graph based on simulated annealing algorithm.The following can be seen from the simulation results:(1)
It can be seen from the table that the target value of the nurse scheduling model is 43.43% lower than the target value of the actual manual scheduling, of which the salary cost is reduced by 10.8%, but the nurse’s satisfaction with the shift has increased by 35.24%. This shows that the nurse scheduling model based on strong and weak constraints is significantly better than the manual scheduling model, achieving an effective balance between hospital salary cost control and nurse satisfaction improvement. The successful application of the nurse scheduling model based on the simulated annealing algorithm brings new inspiration and ideas for solving large-scale nurse scheduling problems.(2)
It can be found that after several iterations based on the simulated annealing algorithm, the optimal value of the solution of the simulated annealing algorithm remains unchanged at the 60th generation. Then, the search process is stopped when the 100th generation is reached, and the solution at this time is the optimal optimization value found by the algorithm.The nurse schedule is optimized by the simulated annealing algorithm, and the final schedule is shown in Table6. Nurses schedule is shown in Figure 3.Table 6
Nurses schedule.
MondayTuesdayWednesdayThursdayFridaySaturdaySunday1PAARAAR2RPANNRA3APRRPPR4ARARPPR5ANPARRN6PANPNPN7AAARRRN8RANANRN9RAAANNR10ARAAAARFigure 3
Nurses schedule.


## 5. Conclusion

This paper studies the nurse scheduling problem based on the simulated annealing algorithm, mainly from two aspects: perfecting the domestic nurse scheduling model and studying the algorithm of the nurse scheduling problem. At present, the scheduling of nurses in China is still in the low-information stage. More hospitals still rely on the head nurses to schedule manually with many years of scheduling experience, and there are often chaotic scheduling and dissatisfaction with medical staff. It seriously hinders the development of modern information management and refined management in our hospitals. For a long time, foreign research has developed a variety of mathematical planning and heuristic algorithms. At present, foreign nurse scheduling algorithms focus on the research of mixed optimization strategies of mathematical planning and heuristic algorithms, which are well adapted to the development of modern information management. However, there is a big gap between foreign labor regulations and nurses’ needs and shift constraints. It is difficult to adapt the nurse scheduling model directly copied to the nursing status of hospitals in my country. Based on this, this article starts from the feasibility and practicability of nursing work status in the hospital, combined with the field survey results of the “Nurse Status Survey Questionnaire of Zhongshan XXX Hospital”, and systematically expounds the nurse scheduling problem. Then, on the basis of the basic model, we increase the “shift scheduling” mechanism, the discontinuity between shifts, weekend breaks, and the fairness of shift scheduling. The nurse scheduling model with strong and weak constraints is established, and finally, the simulated annealing algorithm is used to optimize the strategy to solve the nurse scheduling model. It also evaluates the solving algorithm and obtains the optimal scheduling strategy. It can be seen that the simulated annealing algorithm has a good effect on human resource management data mining.



---

*Source: 6342970-2021-10-14.xml*