Intern rotation scheduling method and system based on random neighborhood search algorithm

The random neighborhood search algorithm solves the complex problems of continuity and rest requirements in intern rotation scheduling, improves the efficiency and accuracy of scheduling, simplifies algorithm implementation, and is robust and easy to transplant.

CN113743761BInactive Publication Date: 2024-10-18SHANDONG NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110987313.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-26
Publication Date
2024-10-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technology is difficult to effectively solve the complex problems of continuity constraints and rest requirements in intern rotation scheduling, especially due to the difficulty in solving quadratic integer programming, which results in the inability to obtain high-quality solutions within an acceptable time.

Method used

Using a method based on a random neighborhood search algorithm, a quadratic integer programming model is constructed to randomly generate an initial solution, and the group exchange operator is used to iterate the solution until the preset iteration conditions are met to ensure the continuity of intern shifts and the stability of the number of interns. sex, while trying to meet your rest needs.

Benefits of technology

It improves the efficiency and accuracy of intern rotation and scheduling, simplifies algorithm implementation, and eliminates the need to adjust parameters, making it robust and easy to transplant.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113743761B_ABST
    Figure CN113743761B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and system for intern rotation scheduling based on a random neighborhood search algorithm, including constructing an objective function based on a quadratic integer programming model, and determining the constraints that need to be met for intern rotation scheduling; randomly generating an initial solution that satisfies all hard constraints of intern rotation scheduling, and using the initial solution as the current optimal solution; based on the current optimal solution, using a random neighborhood search algorithm to iteratively solve until a preset iteration condition is met; wherein the random neighborhood search algorithm specifically comprises: using a search operator to transform the current optimal solution to obtain a temporary solution, and if the objective function value of the temporary solution is less than the current optimal solution, replacing the current optimal solution with the temporary solution. The scheme proposes a random neighborhood search algorithm for scheduling problems with both continuity constraints and rest requirements, and provides a feasible solution to the above problem based on the model, thereby improving the efficiency and accuracy of intern rotation scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of shift optimization, and in particular, relates to a method and system for shift scheduling of interns based on a random neighborhood search algorithm. Background Art

[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.

[0003] The staff scheduling problem is a relatively complex personnel organization planning problem. In order to complete basic work tasks, improve the overall efficiency of the organization, reduce personnel costs, better balance work and rest, improve the satisfaction of interns, and improve performance in all aspects, units or companies need to assign interns to certain work tasks while meeting a series of complex constraints. In today's society, the scale of staff scheduling problems is getting larger and larger. The use of traditional manual scheduling or experience-based scheduling can no longer generate high-quality or even feasible schedules. Therefore, it is more common to use computer programs and algorithms to assist in scheduling. For staff scheduling problems, people usually model them as optimization problems and use related optimization to solve them, so as to help managers automatically generate high-quality schedules. Staff scheduling problems have been a hot research area in operations research in the past decade.

[0004] Among the numerous staff scheduling problems, the rotation scheduling problem is a common and important problem. This problem describes that within a certain time frame, interns need to complete a certain number of tasks (i.e., shifts) and must meet certain constraints. For example, a unit conducts pre-job training activities for new interns at a centralized time or location. During the total time of the training, each intern must complete all training activities, and an activity is called a shift here. Other examples include hospital transfer activities for graduating interns or nurses. Within half a year or a year, several weeks of internship are required in all departments of the hospital. Other problems, such as planning for participation in expo projects, can be classified as this type of problem.

[0005] The problem of concern in this disclosure is a more specific shift scheduling problem. The constraints that need to be considered in this problem are: 1. Continuity of shifts; 2. Stability of the number of people in different shifts; 3. Rest needs of interns. Among them, continuity means that for a certain shift, once an intern starts, the intern needs to continue the shift in the next time until the required time length is completed. For example, a certain shift takes 3 days. If an intern chooses to start on Monday, then Tuesday and Wednesday must also perform the shift. The stability of the number of people in the shift means that the number of participants in a certain shift at all times for the entire training activity cannot change too much, otherwise it will cause fluctuations in the corresponding costs or resources, thereby bringing complexity to the overall scheduling. For example, if the number of participants in a certain shift on Monday is 20 people and on Tuesday is 50 people, there will be a large change in trainers, venues or other resources, thereby increasing the difficulty of management or organization. The rest needs of interns mean that within a certain time, the intern can propose not to participate in any shift activities, that is, the scheduler should try not to arrange a shift for the intern during a time when a rest application has been made. However, since the first constraint must be satisfied, this requirement may not be met, so this constraint is generally modeled as a soft requirement in the model. The inventors found that although this type of problem can be modeled as a quadratic integer programming model, due to the large scale of the problem and the difficulty in solving quadratic integer programming, even using commercial solvers cannot obtain high-quality solutions or even feasible solutions within an acceptable time. Summary of the invention

[0006] In order to solve the above problems, the present invention provides a method and system for intern rotation scheduling based on a random neighborhood search algorithm. The scheme proposes a random neighborhood search algorithm for the scheduling problem with both continuity constraints and rest requirements. Based on the model, a feasible solution to the above problems is provided, thereby improving the efficiency and accuracy of intern rotation scheduling.

[0007] According to a first aspect of an embodiment of the present disclosure, a method for rotating interns based on a random neighborhood search algorithm is provided, comprising:

[0008] Construct the objective function based on the quadratic integer programming model and determine the constraints that need to be met for the interns' rotation schedule;

[0009] Randomly generate an initial solution that satisfies all hard constraints of the intern rotation scheduling, and use the initial solution as the current optimal solution;

[0010] Based on the current optimal solution, a random neighborhood search algorithm is used to iteratively solve the problem until a preset iteration condition is met; wherein the random neighborhood search algorithm is specifically: the current optimal solution is transformed using a search operator to obtain a temporary solution, and if the objective function value of the temporary solution is less than the current optimal solution, the current optimal solution is replaced by the temporary solution.

[0011] Furthermore, the search operator adopts a group exchange operator, specifically: randomly selecting two time periods from the time period sequence, and randomly selecting an intern subsequence from the intern sequence; exchanging the shift results of the intern subsequence in the first time period with the shift results in the second time period.

[0012] Furthermore, the randomly selecting a subsequence of interns from the intern sequence is specifically: randomly selecting two interns from the intern sequence, and the intern between the two interns and the two randomly selected interns constitute the intern subsequence.

[0013] Furthermore, the constraints that need to be met by the intern rotation scheduling include hard constraints and soft constraints, wherein the hard constraints include the continuity of the interns' shifts and the stability of the number of people in different shifts; the soft constraints are the interns' rest needs.

[0014] Furthermore, the objective function is specifically expressed as follows:

[0015]

[0016] Among them, T is the set of interns, with t as the subscript; S is the set of time periods, with s as the subscript; R is the set of shifts, with r as the subscript; P ts Indicates whether intern t applies for a break in time period s, and its value is 0 or 1; W ts The weight of the penalty value caused when the rest demand is not met; x trs = 1 means that intern t works shift r at time s; p ur represents the maximum number of people working in shift r during the entire cycle; p lr Indicates the minimum number of interns.

[0017] According to a second aspect of an embodiment of the present disclosure, a system for rotating interns based on a random neighborhood search algorithm is provided, comprising:

[0018] An objective function determination unit, which is used to construct an objective function based on a quadratic integer programming model and determine the constraints that need to be met for the rotation scheduling of interns;

[0019] An initial solution acquisition unit, which is used to randomly generate an initial solution that satisfies all hard constraints of the intern rotation scheduling, and use the initial solution as the current optimal solution;

[0020] An optimization solution unit is used to iteratively solve the current optimal solution using a random neighborhood search algorithm until a preset iteration condition is met; wherein the random neighborhood search algorithm is specifically: using a search operator to transform the current optimal solution to obtain a temporary solution, and if the objective function value of the temporary solution is less than the current optimal solution, then using the temporary solution to replace the current optimal solution.

[0021] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device comprising a memory, a processor and a computer program stored and running on the memory, wherein when the processor executes the program, the method for rotating interns based on a random neighborhood search algorithm is implemented.

[0022] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method for rotating interns based on a random neighborhood search algorithm is implemented.

[0023] Compared with the prior art, the beneficial effects of the present invention are:

[0024] (1) The scheme disclosed in the present invention provides a method and system for intern rotation scheduling based on a random neighborhood search algorithm. The scheme proposes a random neighborhood search algorithm for the scheduling problem with both continuity constraints and rest requirements. Based on this model, a feasible solution is provided to the above problem, thereby improving the efficiency and accuracy of intern rotation scheduling.

[0025] (2) The random neighborhood search algorithm proposed in the solution of the present disclosure is very simple and convenient in concept and implementation. The model does not use any perturbation module, nor does it adopt multiple search algorithms, and there are no parameters that need to be adjusted. Therefore, the algorithm can be easily transplanted to other systems, such as the unit's existing information system or spreadsheet system, and has strong robustness.

[0026] Advantages of additional aspects of the present disclosure will be given in part in the following description and in part will become apparent from the following description or will be learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings constituting a part of the present disclosure are used to provide a further understanding of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure.

[0028] Figure 1 This is an example of the intern rotation scheduling problem and feasible solution described in the first embodiment of the present disclosure;

[0029] Figure 2This is a flow chart of the intern rotation scheduling method based on the random neighborhood search algorithm described in the first embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.

[0031] It should be noted that the following detailed descriptions are all illustrative and are intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present disclosure belongs.

[0032] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0033] In the absence of conflict, the embodiments in the present disclosure and the features in the embodiments may be combined with each other.

[0034] Embodiment 1:

[0035] The purpose of this embodiment is to provide a method for rotating interns based on a random neighborhood search algorithm.

[0036] like Figure 2 As shown, a method for scheduling intern shifts based on a random neighborhood search algorithm includes:

[0037] Construct the objective function based on the quadratic integer programming model and determine the constraints that need to be met for the interns' rotation schedule;

[0038] Randomly generate an initial solution that satisfies all hard constraints of the intern rotation scheduling, and use the initial solution as the current optimal solution;

[0039] Based on the current optimal solution, a random neighborhood search algorithm is used to iteratively solve the problem until a preset iteration condition is met; wherein the random neighborhood search algorithm is specifically: the current optimal solution is transformed using a search operator to obtain a temporary solution, and if the objective function value of the temporary solution is less than the current optimal solution, the current optimal solution is replaced by the temporary solution.

[0040] Furthermore, the search operator adopts a group exchange operator, specifically: randomly selecting two time periods from the time period sequence, and randomly selecting an intern subsequence from the intern sequence; exchanging the shift results of the intern subsequence in the first time period with the shift results in the second time period.

[0041] Furthermore, the randomly selecting a subsequence of interns from the intern sequence is specifically: randomly selecting two interns from the intern sequence, and the intern between the two interns and the two randomly selected interns constitute the intern subsequence.

[0042] Furthermore, the constraints that need to be met by the intern rotation scheduling include hard constraints and soft constraints, wherein the hard constraints include the continuity of the interns' shifts and the stability of the number of people in different shifts; the soft constraints are the interns' rest needs.

[0043] Furthermore, the objective function is specifically expressed as follows:

[0044]

[0045] Among them, T is the set of interns, with t as the subscript; S is the set of time periods, with s as the subscript; R is the set of shifts, with r as the subscript; P ts Indicates whether intern t applies for a break in time period s, and its value is 0 or 1; W ts The weight of the penalty value caused when the rest demand is not met; x trs = 1 means that intern t works shift r at time s; p ur represents the maximum number of people working in shift r during the entire cycle; p lr Indicates the minimum number of interns.

[0046] Specifically, for ease of understanding, the solution disclosed in the present disclosure is described in detail below with reference to specific examples:

[0047] 1. Mathematical description of the problem

[0048] Before describing the algorithm, we first give a specific problem description and mathematical model. First, the sets, data instance parameters and decision variables used in the model are defined as follows:

[0049] Define the set of interns as T, using t as the subscript. Here, an intern can represent a single person, and in some cases it can also represent a group of people, such as a group of 3 to 5 people. The set of time periods is S, using s as the subscript. The time period here refers to the time period or time unit divided within the entire scheduling cycle, for example, it can represent a day, a week, or a month. In more intensive cases, it can also represent smaller time units such as an hour. The shift set is R, using r as the subscript. For example, an intern needs to complete three tasks within the overall cycle, then R = {work 1, work 2, work 3}. Use Nr to represent the number of time periods required for shift r. For example, work 1 needs to be executed for 3 consecutive days to complete. Assuming that the subscript of work 1 is 1, then N1 = 3. Use P ts Indicates whether intern t has applied for a break in time period s. If the value is 1, it means that the application has been made, otherwise it is 0. For example, P 1,2 =1 means that intern No. 1 applied for a break during time period 2. ts The weight of the penalty value caused by not meeting the rest demand. In terms of decision variables, use x trs = 1 means that intern t works shift r at time s. Using y trs = 1 means that intern t starts shift r at time s. Using p ur represents the maximum number of interns working on shift r during the entire cycle. For example, the number of interns working on shift 1 on the first day is 2, on the second day is 5, and on the third day is 3. Assuming there are 3 days in total, p u1 (assuming that the subscript of shift 1 is 1) is 5. Similarly, p lr is the minimum number of interns. For example, in the previous example p l1 = 2. These two variables are mainly used to describe the stability of the number of interns.

[0050] The specific description of the problem is as follows. During the entire cycle, a certain shift needs to be arranged for a certain intern in a certain time period. The required constraints are: 1. Each intern must complete all shifts; 2. Each shift must complete the required time period according to the value of Nr, and must be completed continuously. 3. Satisfy the intern's rest application as much as possible.

[0051] For a clearer explanation, here is a specific example. Assume |T|=3, |R|=3, |S|=8, N1=2, N2=1, N3=3, P1,3=1, P1,7=1, P2,4=1, P3,1=1. The weights W are all 1. Then a feasible solution to the problem is Figure 1As shown. It can be seen that the three shifts of the three interns are all scheduled in a continuous manner. The cells with rest requests use a dark background color. It can be seen that only one request, P1,3=1, is met in the schedule.

[0052] The mathematical model of the problem is a quadratic integer programming model. The specific constraints and objective functions are shown below.

[0053]

[0054]

[0055]

[0056]

[0057]

[0058]

[0059]

[0060]

[0061]

[0062] Constraint (2) stipulates that an intern can only work on one shift in a certain time period. Constraint (3) means that a shift can only start once for a certain intern during the entire training period. Constraint (4) stipulates that if a shift r starts, there must be at least Nr time periods belonging to this shift in the subsequent time period. Constraint (5) stipulates that the number of shifts r in the entire cycle must be Nr. Constraints (4) and (5) simulate continuity constraints. Constraint (6) stipulates that if there are not enough time periods to complete a shift near the end of the cycle, the shift cannot be started. Constraints (7) and (8) simulate the decision variable p ur and p lr Definition of . Constraint (9) is the range of the above two variables.

[0063] The first part of the objective function (1) calculates the square of the difference between the maximum and minimum number of people in a shift during the entire cycle. The second part calculates the number of unmet rest needs and adds a weighted proportion. Figure 1 Using the example of , we can easily find that the function value is 16; the first step is 13 and the second part is 3.

[0064] (II) Algorithm Description

[0065] (1) Solution representation

[0066] Before describing the algorithm, the expression of the solution is first explained. The algorithm uses, for example, Figure 1 The method of storing the time in the computer is as follows. For example, a two-dimensional array can be used, with the first dimension representing the time period and the second dimension representing the intern. The elements in the array are used to store the name of the shift or the rest period. Since the time period, the shift set, and the time period required for each shift are fixed for each intern, a solution can be considered as consisting of |T| identical permutation vectors (|T| is the number of interns). An example is as follows: Assuming there are 3 shifts, N1=2, N2=3, and N3=2, and the shift cycle is 11, then the permutation vector of an intern may be [3,1,0,2,1,0,3,0,0,2,2]. The numbers in the vector represent the shift number, 3 means shift number 3, and 0 is used to represent rest. It can be seen that the permutation does not meet the continuity requirement. A possible permutation that meets the continuity requirement is [1,1,0,2,2,2,0,0,0,3,3]. Since the duration of each shift is fixed, a solution transformation is performed here to change the vector to [1,0,2,0,0,0,3]. That is, the same shift is represented by only one position, so that the reduced vector length also ensures that the continuity will not be destroyed when the vector is changed, and the original vector representation can be easily restored. Here we call this method the transformed solution representation, and the first method is called the original method.

[0067] For search algorithms, the general approach is to change the arrangement of solutions to try to find a better solution. It is easy to see that if the original method is changed directly, it is difficult to find only feasible solutions because feasible solutions only account for a small part. Therefore, here we use the transformed solution to change. In the subsequent algorithm description, except for the calculation of the objective function, all changes are implemented using the transformed form unless otherwise specified.

[0068] (2) Random Neighborhood Search Algorithm

[0069] The algorithm proposed in the present invention is based on an iterative search framework. In each iteration, the current solution is changed once. This process is called using a search operator on the current solution. By continuously using the operator, we try to find a better solution. The pseudo code of the algorithm flow is as follows:

[0070]

[0071] Combined with the above code, the main process of the algorithm is as follows. The first line generates a random initial solution. Since the parameters here are all known, it can be easily implemented using the usual method. From line 2 to line 8, the algorithm loop is entered. The loop here is controlled by time. If it is within the time range, it will not jump out of the loop. The algorithm keeps trying to find a better solution. The third line copies the current solution as a temporary solution, and the fourth step is to change the search operator for this temporary solution. The specific operator will be described later. Lines 5 to 7 are a conditional judgment, that is, if the objective function of the changed solution is better or equal to the current solution, then the changed temporary solution is used to replace the current solution.

[0072] The search operator here uses a group exchange operator. The specific process is as follows. First, two time periods are randomly selected, assuming that they are s i and j Then randomly select two interns, assuming that t i and t j Without loss of generality, we assume here that the index i <= j. Then, we will assign the intern t i , t i+1 ,…,t j-1 , t j In s i shifts and their j For shift exchanges, there is no need to judge whether a certain point is a rest point.

[0073] Obviously, there are no parameters to adjust and no perturbation operations are used in the whole algorithm. The process of receiving the solution is also simpler than almost all intelligent algorithms for solving scheduling problems, such as simulated annealing.

[0074] (III) Test results

[0075] In order to verify the effectiveness of the algorithm of the present invention, a numerical experiment report of the algorithm is given here. All algorithms in this embodiment are implemented using Java 12 programming. The machine running is a 3.00GHz Intel Corei5-6500, a desktop computer with 4.00GB memory. The operating system running is Windows 7.

[0076] (1) Dataset construction

[0077] Since there is no data test set for this problem, a randomly generated data set is used for testing. The generation method is to sample instance parameters within a certain range and granularity. The values ​​of |T|, |S| and |R| are sampled from the sets {20, 30, 40, 50}, {30, 50} and {6, 8, 10} respectively. Then two instances are generated for each sampling point, and the Nr and rest application of each instance are randomly changed. In this way, a total of 4×2×3×2=48 instances are generated. The instances are named using the sampling information. For example, instance I-20-30-6(1) means that the instance has 20 interns, 30 time periods and 6 shift types. The first three parameters of instances I-20-30-6(1) and I-20-30-6(2) are equal, but Nr and rest application are different. Here we call the first 18 instances small-scale problems and the rest large-scale problems. The time limit of the algorithm is set to 30 seconds for small-scale problems and 300 seconds for large-scale problems. Since the algorithm is a random algorithm, each instance is run 20 times.

[0078] During the experiment, we found that commercial solvers, such as Cplex12.7, could not obtain a feasible solution to the mathematical programming model described above within an acceptable time (more than 5 hours). Setting this is an effective lower bound. Therefore, we implemented another variable neighborhood search algorithm and compared it with the algorithm we proposed. The algorithm comes from a paper that solves similar problems (F. Casta~no, N. Velasco, Exact and heuristic approaches for the automated design of medical trainees rotation schedules, Omega 97 (2020) 102107). The problem in the paper has a similar solution structure to the problem targeted by the present invention, so their algorithm is used for comparison here. The overall idea of ​​the algorithm is to use multiple local search operators to change the current solution and save a better solution. In this process, perturbation operators are used to help jump out of the neighborhood of the local optimal solution. There is only one operator in the algorithm that is not suitable for our problem, and we did not add this operator during the implementation. The paper states that this operator is not the main key operator, so the approach here will not affect the overall performance of their algorithm. In the following description, we call the algorithm proposed by the present invention random neighborhood search and the comparison algorithm variable neighborhood search. The implementation language and running machine of the variable neighborhood search algorithm are exactly the same. And because the algorithm is also random, each instance is also run 20 times. The time limit settings of the two algorithms are exactly the same.

[0079] Table 1 is a statistical analysis of the experimental results of the two algorithms for all instances. The first two columns in the table are the serial number and name of the data instance. The following four columns are the minimum, maximum, average, and standard deviation of the random neighborhood search in 20 runs. It can be seen from the table that the random neighborhood search proposed by the present invention is significantly superior to the variable neighborhood search algorithm in all aspects. If only the random neighborhood search is looked at, it can be seen that the value of the standard deviation is small, reflecting the high stability of the algorithm.

[0080] Table 1 Comparison of experimental results

[0081]

[0082]

[0083] (IV) Algorithm mechanism description

[0084] In order to reflect the characteristics of the algorithm proposed in this invention, the experimental results of comparing the original algorithm with the modified version of the algorithm after adding a more complex mechanism are given here. Two characteristics are mainly focused on here: one is that the random neighborhood algorithm proposed in this invention only uses one search operator instead of multiple search operators. The second is that this algorithm does not use a complex receiving mechanism, such as the cooling strategy of the simulated annealing algorithm.

[0085] (1) Comparison between the original random neighborhood algorithm and the multi-search operator version.

[0086] Multi-operator means using multiple variations to search different neighborhoods in one search. For comparison, we used multi-operator in a modified version. This operator is composed of the original group exchange operator and the group move operator. The movement operator has a similar operating mechanism to the exchange operator, except that only one of the exchanges is a rest time. That is, it is equivalent to moving a shift to a rest time. The combination of the two operators is random. Group exchange is applied when the probability is 0.8, and group movement is used when the probability is 0.2. This method is also a commonly used multi-operator combination method. The rest of the algorithm remains unchanged. The modified algorithm is called random neighborhood search with multi-operators. The experimental method is similar to the previous section. The experimental results are shown in Table 2.

[0087] Table 2 Comparison of experimental results between the original algorithm and the multi-operator version

[0088]

[0089]

[0090]

[0091] As can be seen from Table 2, the modified version can also find solutions of higher quality. Even better solutions can be found for some instances. However, from the overall data, the version using multiple operators is still not as good as the original single operator version. For the minimum value, the original version can still find better solutions for most instances. This experiment reflects that although multiple operators perform better than single operators in many scheduling algorithms, the simpler single operator performs better for the intern scheduling problem targeted by the present invention.

[0092] (2) Comparison between the original random neighborhood algorithm and the version using the simulated annealing receiving strategy

[0093] The receiving mechanism adopted by the original algorithm is to receive the current solution when a solution with equal or better objective function value is found. In order to compare with the complex version, the modified version uses the simulated annealing mechanism to receive the new solution. Since the original annealing algorithm is based on temperature, and our experiment here is based on time, a loop is added to the outside of the original annealing algorithm to control the time during the implementation process. If the time is not up, the current solution is used and the temperature is reset to continue using the annealing algorithm to solve. The algorithm's search operator still uses a single operator. The receiving mechanism uses the standard simulated annealing mechanism, which will not be repeated here. The initial dimension is set to 200, the cooling ratio is set to 0.95, and the minimum temperature is set to 2. This parameter is based on the parameters of similar problems in other papers and preliminary experiments. The modified algorithm becomes a random neighborhood search of the annealing receiving strategy. The experimental results are shown in Table 3.

[0094] It can be seen from Table 3 that the original algorithm is significantly better than the modified version of the algorithm using the annealing receiving mechanism in terms of minimum, maximum, average and standard deviation. This experiment proves that the receiving mechanism proposed in the present invention has a stronger search capability for the intern scheduling problem.

[0095] Table 3 Comparison of experimental results between the original algorithm and the version using the annealing strategy receiving mechanism

[0096]

[0097]

[0098] Embodiment 2:

[0099] The purpose of this embodiment is to provide an intern rotation scheduling system based on a random neighborhood search algorithm.

[0100] An intern rotation scheduling system based on random neighborhood search algorithm, including:

[0101] An objective function determination unit, which is used to construct an objective function based on a quadratic integer programming model and determine the constraints that need to be met for the rotation scheduling of interns;

[0102] An initial solution acquisition unit, which is used to randomly generate an initial solution that satisfies all hard constraints of the intern rotation scheduling, and use the initial solution as the current optimal solution;

[0103] An optimization solution unit is used to iteratively solve the current optimal solution using a random neighborhood search algorithm until a preset iteration condition is met; wherein the random neighborhood search algorithm is specifically: using a search operator to transform the current optimal solution to obtain a temporary solution, and if the objective function value of the temporary solution is less than the current optimal solution, then using the temporary solution to replace the current optimal solution.

[0104] Furthermore, the search operator adopts a group exchange operator, specifically: randomly selecting two time periods from the time period sequence, and randomly selecting an intern subsequence from the intern sequence; exchanging the shift results of the intern subsequence in the first time period with the shift results in the second time period.

[0105] Furthermore, the randomly selecting a subsequence of interns from the intern sequence is specifically: randomly selecting two interns from the intern sequence, and the intern between the two interns and the two randomly selected interns constitute the intern subsequence.

[0106] In further embodiments, there is also provided:

[0107] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in Embodiment 1 is performed. For the sake of brevity, no further description is given here.

[0108] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0109] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0110] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the method described in embodiment 1 is completed.

[0111] The method in the first embodiment can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

[0112] Those skilled in the art will appreciate that the units, i.e., algorithm steps, of the various examples described in conjunction with this embodiment can be implemented in electronic hardware or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0113] The above-mentioned embodiment provides a method and system for intern rotation scheduling based on a random neighborhood search algorithm, which can be implemented and has broad application prospects.

[0114] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for scheduling intern shifts based on a random neighborhood search algorithm, characterized in that: include: The objective function is constructed based on the quadratic integer programming model, and the constraints that need to be met for the rotation scheduling of interns are determined; the objective function is specifically expressed as follows: Among them, T is the set of interns, with t as the subscript; S is the set of time periods, with s as the subscript; R is the set of shifts, with r as the subscript; P ts Indicates whether intern t applies for a break in time period s, and its value is 0 or 1; W ts The weight of the penalty value caused when the rest demand is not met; x trs = 1 means that intern t works shift r at time s; p ur represents the maximum number of people working in shift r during the entire cycle; p lr Indicates the minimum number of interns; The constraints that need to be met by the interns' shift rotation include hard constraints and soft constraints, wherein the hard constraints include the continuity of the interns' shifts and the stability of the number of people in different shifts; the soft constraints are the interns' rest needs; Randomly generate an initial solution that satisfies all hard constraints of the intern rotation scheduling, and use the initial solution as the current optimal solution; Based on the current optimal solution, a random neighborhood search algorithm is used to iteratively solve the problem until a preset iteration condition is met to obtain a shift scheduling result; wherein the random neighborhood search algorithm is specifically as follows: the current optimal solution is transformed using a search operator to obtain a temporary solution, and if the objective function value of the temporary solution is less than the current optimal solution, the current optimal solution is replaced by the temporary solution; The search operator adopts a group exchange operator, specifically: randomly selecting two time periods from the time period sequence, and randomly selecting an intern subsequence from the intern sequence; exchanging the shift result of the intern subsequence in the first time period with the shift result in the second time period; The randomly selecting a subsequence of interns from the intern sequence specifically includes: randomly selecting two interns from the intern sequence, and the intern between the two interns and the two randomly selected interns form the subsequence of interns.

2. A system for rotating interns based on a random neighborhood search algorithm, characterized in that: include: The objective function determination unit is used to construct an objective function based on a quadratic integer programming model and determine the constraints that the interns' shift rotation needs to meet; the objective function is specifically expressed as follows: Among them, T is the set of interns, with t as the subscript; S is the set of time periods, with s as the subscript; R is the set of shifts, with r as the subscript; P ts Indicates whether intern t applies for a break in time period s, and its value is 0 or 1; W ts The weight of the penalty value caused when the rest demand is not met; x trs = 1 means that intern t works shift r at time s; p ur represents the maximum number of people working in shift r during the entire cycle; p lr represents the minimum number of interns; the constraints that need to be met by the interns' shift rotation include hard constraints and soft constraints, wherein the hard constraints include the continuity of the interns' shifts and the stability of the number of people in different shifts; the soft constraints are the interns' rest needs; An initial solution acquisition unit, which is used to randomly generate an initial solution that satisfies all hard constraints of the intern rotation scheduling, and use the initial solution as the current optimal solution; An optimization solution unit, which is used to iteratively solve the current optimal solution using a random neighborhood search algorithm until a preset iteration condition is met; wherein the random neighborhood search algorithm specifically comprises: using a search operator to transform the current optimal solution to obtain a temporary solution, and if the objective function value of the temporary solution is less than the current optimal solution, replacing the current optimal solution with the temporary solution; The search operator adopts a group exchange operator, specifically: randomly selecting two time periods from the time period sequence, and randomly selecting an intern subsequence from the intern sequence; exchanging the shift result of the intern subsequence in the first time period with the shift result in the second time period; The randomly selecting a subsequence of interns from the intern sequence specifically includes: randomly selecting two interns from the intern sequence, and the intern between the two interns and the two randomly selected interns form the subsequence of interns.

3. An electronic device comprising a memory, a processor and a computer program stored and running on the memory, wherein when the processor executes the program, the method for rotating interns based on a random neighborhood search algorithm as described in claim 1 is implemented.

4. A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the intern rotation scheduling method based on a random neighborhood search algorithm as described in claim 1.