Complicated Time-Constrained Project Scheduling Problems in Water Conservancy Construction

: Water conservancy project scheduling is an extension to the classic resource-constrained project scheduling problem (RCPSP). It is limited by special time constraints called “forbidden time windows” during which certain activities cannot be executed. To address this issue, a speciﬁc RCPSP model is proposed, and an approach is designated for it which incorporates both a priority rule-based heuristic algorithm to obtain an acceptable solution, and a hybrid genetic algorithm to further improve the quality of the solution. In the genetic algorithm, we introduce a new crossover operator for the forbidden time window and adopt double justiﬁcation and elitism strategies. Finally, we conduct simulated experiments on a project scheduling problem library to compare the proposed algorithm with other priority-rule based heuristics, and the results demonstrate the superiority of our algorithm.


Introduction
Water conservancy construction usually endures a long cycle of multi-tasks, absorbing substantial investments of money and recourses; it is therefore difficult to rationally plan and scientifically schedule.Traditional scheduling approaches which have widely served water conservancy projects since the 1950's have been phased out, such as Gantt chart, critical path method (CPM), and program evaluation and review technique (PERT).An effective alternative, independent from human experiences, is much needed.
Water conservancy project scheduling is a resource-constrained project scheduling problem (RCPSP); an optimization task with time and resource limitations between each activity.RCPSPs have been extensively studied for decades and many scholars have presented insightful reviews on them from different perspectives [1][2][3][4][5][6][7].Water conservancy projects differ from classical RCPSPs in that they are subject to special time constraints.
There are approximately three categories of RCPSP research related to time constraints.In the early days, a typical time-constrained extension to RCPSP was RCPSP/Max, referring to an RCPSP with minimum/maximum time lags; this was elaborated in Neumann et al.'s [8] review.Ismael de Azevedo et al. [9] proposed a satisfiability and workloadbased exact method to deal with the resource-constrained project scheduling problem with generalized precedence constraints (RCPSP/Max).Morin et al. [10] studied an original variant of the RCPSP, the PARCPSP.While the start and completion times of the activities can be arbitrary moments in time the limitations on resource usage are considered on average over aggregated periods of parameterized length.This kind of problem only considers the relative time interval between activities, which is general.The second type is the periodic time window problem.Chen et al. [11] introduced two time-related constraints: the time window constraint, outlining each activity's execution time interval; and the time-schedule constraint, defining the pre-specified beginning time for certain activities, such as train schedules.Zhan et al. [12] and Franck et al. [13] adopted calendars to differentiate time Processes 2023, 11, 1110 2 of 11 intervals, such as workdays and non-workdays.Then they sorted activities into interruptible and uninterruptible categories and arranged them according to calendar limits.Similarly, Yang et al. [14] proposed another constraint, called a time-switch constraint, which designates a certain time interval within a cycle specifically for starting an activity.The third category considers the special time constraints of the activities in the scheduling problem, making the problem more practically significant and gradually becoming a research hotspot.In recent years, more and more work has been focused on the time window problem of the RCPSP, which exists in many fields in real life, such as course scheduling, vehicle routing planning, and human resource scheduling.Bomsdorf et al. [15] proposed a model to solve a movie shooting scheduling problem.Lorenzoni et al. [16] found that ships attending a port within a limited time constituted a multi-mode resource-constrained scheduling problem; they solved this using mathematical algorithms.Vanhoucke et al. [17] proposed the concept of "quality-dependent time slots" and assigned them to activities to achieve a minimal loss of quality.They also successfully scheduled a biological R&D project using these time slots.There are two kinds of time window constraints in railway transportation, one is soft time window and the other is hard time window.The soft time window requires goods to arrive within the time window to the greatest possible extent, with penalties if they are violated.The hard time window requires that the goods must arrive within the time window, otherwise the goods will be rejected.Mi et al. [18] considered the mixed time windows of the multimodal transportation optimal routing model and used the CSO algorithm to solve the problem.Drexl et al. [19] designed a problem instance generator that integrates novel constraints named "forbidden periods" to allocate an earliest/latest pair of ending times to each activity.It can be used for many labor-related scheduling problems, such as course scheduling where two lessons of the same course cannot be assigned in two periods at the end of one day and at the beginning of the next.
In summary, scholars have already done a lot of research on the time constraints of RCPSPs.However, most of the previous time-related studies have focused on the time constraints between individual activities within projects and have seldom noticed that reallife projects are vulnerable to outside time limitations.While the start time of the project is random, and some activities in the project can't be carried out in certain time periods, which may affect the overall progress of the project.For example, there are environmental work windows in dredging fleet scheduling [20], weather windows in offshore operation [21], and special time windows in water conservancy construction, additionally, the project is affected by seasonal conditions and environmental regulations [22].For example, the construction of river dikes and channels, which usually lasts for more than one year, is subject to seasonal flooding.Some activities can be carried out during floods while others cannot; this makes scheduling these activities even more complicated.Scholars refer to these special time intervals as "forbidden time windows" and have applied them to many construction project scheduling problems.Blazewicz et al. [23] have shown that the RCPSP is an NP-hard problem and that forbidden time windows can impose extra difficulties and complications in finding its solution.
To address the challenges of forbidden time window problems, we can convert them into a type of RCPSP, taking the shortest project duration as the goal and combining heuristic algorithms and meta-heuristic algorithms to solve large-scale project scheduling problems.Our major contributions are as follows: (1) A mathematical model of water conservancy construction scheduling aiming at the constraint of forbidden time windows was established, and a simulation project containing 30, 60, 90, and 120 tasks was generated.We separately combined the parallel scheduling scheme and the serial scheduling scheme with the seven different priority rules and applied them to all the instances of the four types; we discussed which kind of rules perform better.(2) A hybrid genetic algorithm was designed, which took the resource utilization rate in the forbidden time windows as the basis for cross operation.Finally, the rule-based heuristic algorithm was compared with a genetic algorithm.
The remaining structure of this paper is as follows: in Section 2, we introduce the related problems; in Section 3, we propose the solution; in Section 4, the simulation experiment is presented; and finally, in Section 5, we present the conclusions and our planned future work.

Problem Description
A typical RCPSP can be described as follows.A project is composed of a set J + that contains J activities, where the two dummy activities, j = 1 and j = J, represent the project beginning and the project termination, respectively.The dummy activities take zero time and recourse.Activity j may last d j time duration: starting from s j and ending at c j .Obviously, s j + d j ≤ c j .Each activity cannot be interrupted during its exertion and all activities are ordered by precedence constraints: Pred(j) denotes the set of the activities that immediately precede j, which means activity j cannot start until all the activities in Pred(j) end; similarly, Succ(j) is the set of the activities that immediately succeed activity j, which means only at the time of or after activity j end, can activities in Succ(j) begin.The project can allocate K recourses.R k represent the total amount of recourse k in a cycle and r k the amount of recourse k that activity j requires throughout its execution.At any time, r k must be lesser than R k .All of the parameters listed above are non-negative integrals.Thus, a RCPSP is a combinatorial optimization problem that aims to find the minimum makespan with constraints of precedence and resources.
Water conservancy projects are constrained by "forbidden time windows".During a forbidden time window, certain special activities cannot be executed.They must be either postponed or conducted in advance.Figure 1 depicts an example: a project consists of 21 activities, including two dummy ones.It only needs one recourse R, and its total units is four.Special activities, denoted by boxes in Figure 1, are {2, 7, 11, 15, 18, 19} and a forbidden time window stretches between [5,16].Figure 2 illustrates one schedule to this project.Activity 2 cannot begin at time point 15, because it is "forbidden" during the time interval [5,16], which reduces the efficiency of the whole project.Figure 3 provides a better solution; activity 2 is brought forward, avoiding the "forbidden time window", which reduces the working period of the project.
(2) A hybrid genetic algorithm was designed, which took the resource utilization rate in the forbidden time windows as the basis for cross operation.Finally, the rule-based heuristic algorithm was compared with a genetic algorithm.
The remaining structure of this paper is as follows: in Section 2, we introduce the related problems; in Section 3, we propose the solution; in Section 4, the simulation experiment is presented; and finally, in Section 5, we present the conclusions and our planned future work.

Problem Description
A typical RCPSP can be described as follows.A project is composed of a set J + that contains J activities, where the two dummy activities, j = 1 and j = J, represent the project beginning and the project termination, respectively.The dummy activities take zero time and recourse.Activity j may last dj time duration: starting from sj and ending at cj. Obviously, sj + dj ≤ cj.Each activity cannot be interrupted during its exertion and all activities are ordered by precedence constraints: Pred(j) denotes the set of the activities that immediately precede j, which means activity j cannot start until all the activities in Pred(j) end; similarly, Succ(j) is the set of the activities that immediately succeed activity j, which means only at the time of or after activity j end, can activities in Succ(j) begin.The project can allocate K recourses. represent the total amount of recourse k in a cycle and  the amount of recourse k that activity j requires throughout its execution.At any time,  must be lesser than  .All of the parameters listed above are non-negative integrals.Thus, a RCPSP is a combinatorial optimization problem that aims to find the minimum makespan with constraints of precedence and resources.
Water conservancy projects are constrained by "forbidden time windows".During a forbidden time window, certain special activities cannot be executed.They must be either postponed or conducted in advance.Figure 1 depicts an example: a project consists of 21 activities, including two dummy ones.It only needs one recourse R, and its total units is four.Special activities, denoted by boxes in Figure 1, are {2, 7, 11, 15, 18, 19} and a forbidden time window stretches between [5,16].Figure 2 illustrates one schedule to this project.Activity 2 cannot begin at time point 15, because it is "forbidden" during the time interval [5,16], which reduces the efficiency of the whole project.Figure 3 provides a better solution; activity 2 is brought forward, avoiding the "forbidden time window", which reduces the working period of the project.In practice, a project may involve multiple forbidden time windows, due to the weather or to technical problems.For better generalization, we regard [STi1, STi2] as a forbidden time window, and U + as the set of special activities.Thus, a RCPSP model with forbidden time windows can be described as follows. Min s.t.

𝑠 𝑠 𝑑 , 𝑗 ∈ 𝐽 , 𝑖 ∈ 𝑃𝑟𝑒𝑑(𝑗);
(2) where Equation ( 1) signifies that the optimization goal of the model is the minimum makespan; Equation (2) gives the precedence constraints between activities; Equation (3) gives the recourse constraints; while Equation ( 4) indicates that special activities must be either completed before the special time intervals or started after them.When  = ∅ this model changes back to a classic RCPSP.If all the activities correspond to the same forbidden time window, this model transforms into a calendar-constrained problem.Table 1 lists all the parameters used in the model.In practice, a project may involve multiple forbidden time windows, due to the weather or to technical problems.For better generalization, we regard [ST i1 , ST i2 ] as a forbidden time window, and U + as the set of special activities.Thus, a RCPSP model with forbidden time windows can be described as follows.
Min s J s.t.
where Equation ( 1) signifies that the optimization goal of the model is the minimum makespan; Equation (2) gives the precedence constraints between activities; Equation (3) gives the recourse constraints; while Equation ( 4) indicates that special activities must be either completed before the special time intervals or started after them.When U + = ∅ this model changes back to a classic RCPSP.If all the activities correspond to the same forbidden time window, this model transforms into a calendar-constrained problem.Table 1 lists all the parameters used in the model.starting time of activity j c j ending time of activity j Pred(j) the set of activities immediately preceding activity j Succ(j) the set of activities immediately succeeding activity j U + the set of special activities J + the set of all the activities t time number, t = 1, 2, . . ., T; where T is the deadline of the whole project.
A t the set of activities that are being executed at time t, the forbidden window that constrains activity i k recourse number, k = 1, 2, . . ., K; where K is the total number of types of recourses.R k the amount of recourse k r k the amount of recourse k that activity j requires

Solution
The special-time-constrained RCPSP enforces critical barriers when scheduling special activities.We propose a tailored priority-based heuristic algorithm and a hybrid genetic algorithm to tackle it.

Priority Rule-Based Heuristic Algorithm
Heuristics have been widely accepted in RCPSPs, especially in those of large scales, thanks to their fast speed.A higher-level of heuristics is the metaheuristic algorithm.Its high-efficiency and simple logic has boosted its applications around business plans and software pipelining.A typical metaheuristic algorithm consists of two critical procedures: schedule generation scheme (SGS), and priority rule [24].Two types of SGS are feasible in practice: the serial SGS based on activity-incrimination, and the parallel SGS based on time-incrimination.Priority rules are used to deploy one or both SGS(s) and to finally find the best solution to the scheduling problem.
Priority-based heuristics are satisfactory at tackling classic RCPSPs but would be inept at the special one discussed in this paper.Therefore, we can tailor the priority rules to forbidden time windows using the following procedure.If a special activity is one of the options and can be finished before its forbidden time begins, it will be selected.If two or more special activities are among the options and they can all be completed before the forbidden time windows, which means that they are all tied, the activity with the smallest label will be chosen.This is the tie-breaking rule.
Table 2 lists both schedule generation schemes and their corresponding priority rules adopted in this paper.

Hybrid Genetic Algorithm
Hartmann [25] proposed an effective genetic algorithm for RCPSP.We have borrowed the principles of this algorithm, and further designed specific crossover operators for forbidden time windows, as well as adopting double justification and elite selection strategy.Our hybrid genetic algorithm could provide final solutions of an improved quality.
The Algorithm 1 proceeds as follows.

Algorithm 1: Hybrid genetic algorithm
Step First, the algorithm sets that the initial population contains popsize individuals: where popsize is an even integer, Gen is the number of iterations, and Pm is the mutation probability.Second, it deploys a simple and effective local search strategy, double justification, to adjust the chromosomes, as illustrated in the following content, and then calculates fitness for each individual.Third, it uses the crossover operator designed specifically for forbidden time windows (as explained in Section 3) to generate two new offspring, and mutates them.Thus, the population is enlarged to a size of 2•popsize.Finally, the algorithm sorts the chromosomes and selects the best ones, such that a new population is generated with a size of popsize.This procedure is repeated until Gen is reached or the prescribed CPU time is up.
(1) Initial population and fitness function The proposed algorithm deploys a precedence feasible activity list to represent activity priorities.This activity list can be used to generate a possible solution using serial SGS.Differing from Hartmann's method, SGS here must take forbidden time windows into account.Some of the solutions in the initial population are randomly assigned, and others are selected from the results of a classic priority-based heuristic algorithm, as mentioned earlier.
Fitness function chooses the highest fitness; thus, the minimum optimized goal has to be transformed to fitness function as where F max represents the maximum duration of individual i in the latest five generations and S i the solution resulting from the decoding individual i, that is, the optimized goal.
(2) Double justification Many scholars have appropriated local search operators in genetic approaches and obtained better schedules.We borrowed a double justification operator to improve the quality of the final results.Thanks to its simplicity, fast speed, and effectiveness, it is convenient to be applied to RCPSP [26,27].Definition 1.An active (or left active) schedule is a solution where no activity can be executed in advance without delaying any other activities or violating any rules.Similarly, a right active schedule is one where no activity can be postponed without delaying any other activities, violating any rules, or extending the total makespan.Definition 2. A justification procedure refers to that given a schedule S, after the right (left) justification of an activity j = J(1) , S becomes a new schedule of S where s i = s i , i = j; s j ≥ s j (s j ≤ s j ), and s j is as large/small as possible.The procedure is to start activity j as late (early) as possible while the other activities' starting times remain unchanged.
The double justification of a schedule follows a specific agenda.First, all the activities are sorted in a descending order of their ending times.Second, each activity is justified to the right and the latest completing time of each activity is obtained.The latest completing time of an activity refers to the point that is right before the earliest starting time of its immediate successors and the latest of the time intervals that feed all the recourse constraints.Third, each activity is justified to the left, and all the activities are sorted in an ascending order of their starting times.Fourth, each activity is arranged on its earliest starting time point, such that precedence and recourse constraints are both satisfied.When the procedure is completed, a solution that is no worse than the original one is obtained.
(3) Crossover operators for forbidden time windows For the proposed time-bound RCPSP model, schedules that accommodate vacant forbidden time windows, meaning no activity is undertaken during those time intervals, must be less efficient than those where all the forbidden time windows are filled with activities.Therefore, to obtain a minimized makespan, we design a crossover operator for forbidden time windows, inspired by the peak crossover operator in Valls et al.'s [18] algorithm.Given a schedule S, [U 1 , U 2 ] represents a forbidden time window, and SA(u) the set of activities being executed during [U 1 , U 2 ], such that SA(u) = {i ∈ J the resource utilization ratio (RUR) of schedule S during the special time interval [U 1 , U 2 ] can be described as: If RUR(u) is higher than a threshold δ, say 0.7, we can claim that schedule S holds a high RUR during a certain time interval.Let λ be the list of activities that could be executed during a certain special time interval, such that λ = (j p , j p+1 , . . ., j q ), and λ could be vacant.
Then, the crossover operator for the forbidden time windows can be used in the following matter.Suppose there are two individuals F, M. If RURs of F and M are both lower than δ, one-point crossover is employed to obtain their off-springs; if either RUR of F or M is higher than δ, two-point crossover is deployed and the two switch points are the starting time and the ending time of each individual, as explained in Figure 4.
bidden time windows, meaning no activity is undertaken during those time intervals, must be less efficient than those where all the forbidden time windows are filled with activities.Therefore, to obtain a minimized makespan, we design a crossover operator for forbidden time windows, inspired by the peak crossover operator in Valls et al.'s [18] algorithm.Given a schedule S, [U1, U2] represents a forbidden time window, and SA(u) the set of activities being executed during [U1, U2], such that SA() = {i ∈  ; [ ,  [∩ [ ,  [≠ ∅}.Thus, the resource utilization ratio (RUR) of schedule S during the special time interval [U1, U2] can be described as: If RUR(u) is higher than a threshold δ, say 0.7, we can claim that schedule S holds a high RUR during a certain time interval.Let λ be the list of activities that could be executed during a certain special time interval, such that λ = (jp, jp+1, …, jq), and λ could be vacant.
Then, the crossover operator for the forbidden time windows can be used in the following matter.Suppose there are two individuals F, M. If RURs of F and M are both lower than δ, one-point crossover is employed to obtain their off-springs; if either RUR of F or M is higher than δ, two-point crossover is deployed and the two switch points are the starting time and the ending time of each individual, as explained in Figure 4.It seems that the crossover operator for forbidden time windows is highly related to activities' RURs during special time intervals.If the RUR of the parent is high, the twopoint operator can ensure that this high RUR is passed on to its offspring; if RURs of the parents are below the threshold, the one-point operator can facilitate diversity among the offspring.

(4) Mutation and selection
We applied exchange mutation to the precedence feasible activity list, that is, we randomly selected two genes and switched them according to a mutation probability; if the mutation violated precedence constraints, the two genes were restored back.We also incorporated elite strategy in the selection to guarantee that the best chromosomes would be directly replicated in the next generation.Here the probability of selecting elites is defined as It seems that the crossover operator for forbidden time windows is highly related to activities' RURs during special time intervals.If the RUR of the parent is high, the two-point operator can ensure that this high RUR is passed on to its offspring; if RURs of the parents are below the threshold, the one-point operator can facilitate diversity among the offspring.

(4) Mutation and selection
We applied exchange mutation to the precedence feasible activity list, that is, we randomly selected two genes and switched them according to a mutation probability; if the mutation violated precedence constraints, the two genes were restored back.We also incorporated elite strategy in the selection to guarantee that the best chromosomes would be directly replicated in the next generation.Here the probability of selecting elites is defined as

Simulation
We conducted simulated analysis on our proposed algorithm.The simulation was performed on a computer with Intel dule-core CPU at 3.4 GHz.The algorithm was coded in Java.

Problem Instance Generation
Classic RCPSPs usually use PSPLIB [28], a project scheduling problem library, to test their performance.The problem that this paper targets, however, can hardly make use of the library, due to its extra time constraints.Therefore, we extended the library by adding special time constraints to those problems.We defined that special time intervals could last between 15~20% of the shortest makespans of the projects recorded in PSPLIB.The starting points of those intervals were randomly assigned along the timelines of the projects, excluding project starting and ending points.We also randomly designated 8~25% of all the activities, excluding dummy ones, as special activities without repetition.Finally, we selected four types of projects which were named J30, J60, J90 and J120, containing four different numbers of activities: 30, 60, 90 and 120; the corresponding numbers of their instances were 480, 480, 480 and 600.
The parameters used in the hybrid algorithm were set as follows: Pm was 0.05; popsize equals the number of activities of the project; the algorithm would be terminated if Gen reached 200 or the result had not changed in the last 50 generations.

Results and Comparisons
First, we applied three different methods to one of the instances of J120: a method integrating the parallel scheduling scheme and WCS priority rule, a method integrating serial scheduling scheme and LST priority rule, and the proposed hybrid genetic algorithm.This chosen case included a "forbidden window" lasting a long period and starting at an early stage of the project, and special activities accounting for 12% of the total.The resultant makespans of the three were 209, 288 and 186.The two heuristic algorithms could only determine simple schedules and the quality of the resulted values fluctuated randomly; the proposed algorithm, however, could explore the space of solutions and keep evolving, thus approaching the optimized goals.
Next, we separately combined the parallel scheduling scheme and the serial scheduling scheme with the seven different priority rules (the combinations are mentioned in Section 3.1) and applied them to all the instances of the four types: J30, 60, J90, and J120.Table 3 lists results of the seven PSS-based methods and Table 4 those of the SSS-based methods.The two tables record the number of times that the best solution of each method appears and its average CPU time.Tables 5 and 6 show the average makespans of the PSS-based methods and the SSS-based methods, respectively.Table 7 lists the results of the proposed algorithm.LST and LFT stand out among SSS-based methods.Comparing Tables 5 and 6, we can find that PSS-based methods perform better than SSS-based, and results of WCS and LST again outstrip others.Figure 5 displays the comparison between mean makespans of PSS-based methods, SSS-based methods and the proposed hybrid genetic algorithm.The figure indicates that the proposed algorithm is not much superior when the projects contain a small number of activities, but as the number of activities rises, the proposed algorithm is better than the others, although its time cost also grows.

Conclusions
In this paper, we have targeted the water conservancy project scheduling problem.As it is an extension to the classic RCPSP, we have proposed an approach that incorporates a priority rule-based heuristic algorithm and a hybrid genetic algorithm.From the simulation results, we can draw the following conclusions: (1) Priority-based heuristic algorithms using the parallel scheduling scheme perform better than those using the serial scheduling scheme; (2) Time-constrained priority rules, such as LFT, LST, and WCS can help to obtain better results than other priority rules; (3) The proposed algorithm exhibits better performance on large-scale problems, although it costs more time than priority rule-based heuristics.
In this paper, we have presented a forbidden time window water construction project scheduling research that integrates model and solution.This contributes towards building appropriate decision support capabilities in widely diverging project scheduling environments.Given the prevalence of specific time constraints in real life, reducing the impact of time constraints on projects, as discussed in this article, can greatly reduce project duration and cost.However, there are still some issues for further study.For example, more efficient algorithms need to be found, and solutions need to be extended to more practical scenarios.
Author Contributions: Writing-original draft preparation, S.Z.; writing-review and editing, X.S.; visualization, Validation, L.S.; supervision, L.X.; project administration, L.X.; funding acquisition, S.Z. and X.S.All authors have read and agreed to the published version of the manuscript.

Conclusions
In this paper, we have targeted the water conservancy project scheduling problem.As it is an extension to the classic RCPSP, we have proposed an approach that incorporates a priority rule-based heuristic algorithm and a hybrid genetic algorithm.From the simulation results, we can draw the following conclusions: (1) Priority-based heuristic algorithms using the parallel scheduling scheme perform better than those using the serial scheduling scheme; (2) Time-constrained priority rules, such as LFT, LST, and WCS can help to obtain better results than other priority rules; (3) The proposed algorithm exhibits better performance on large-scale problems, although it costs more time than priority rule-based heuristics.
In this paper, we have presented a forbidden time window water construction project scheduling research that integrates model and solution.This contributes towards building appropriate decision support capabilities in widely diverging project scheduling environments.Given the prevalence of specific time constraints in real life, reducing the impact of time constraints on projects, as discussed in this article, can greatly reduce project duration and cost.However, there are still some issues for further study.For example, more efficient algorithms need to be found, and solutions need to be extended to more practical scenarios.

Figure 5 .
Figure 5.Comparison between the heuristics and the proposed hybrid genetic algorithm.

Figure 5 .
Figure 5.Comparison between the heuristics and the proposed hybrid genetic algorithm.

Table 1 .
Parameters used in the proposed model.

Table 1 .
Parameters used in the proposed model.

Table 2 .
Schedule generation schemes and corresponding priority rules.

Table 3 .
Results of the parallel schedule scheme-based methods.