# Project Robust Scheduling Based on the Scattered Buffer Technology
## 4 Unit activity Slack Algorithm (UAS)
### Steps of the Scattered Buffer Algorithm  
Based on the above robust optimization model, this paper adopts the heuristic algorithm, and takes the measure value \(UAS\) of the solution robustness as optimization target of the robustness. This paper proposes the following heuristic iterative algorithm that inserts the buffer times into the activities, namely to insert one by one the unit buffer time in front of the starting time of the activity that has the biggest effect on the solution robustness, until unit buffer times cannot be inserted to get a buffer schedule. In the \(UAS\) algorithm, the generation of the resource flow network and the calculation of \(UAS\) are two key parts. The specific algorithm steps are as follows:  
1. Take the shortest project makespan as the goal using the meta-heuristic algorithm to generate a baseline schedule of the project. The project completion time is determined based on this schedule.
2. Based on the baseline schedule, the resource allocation algorithm with the maximum use of precedence relations is used to generate the resource flow network.
3. Calculate the value of \(uas_{now}^{j}\) in all solution activities in the current schedule, the value of \(T_{now}\) (the completion time of the project in the current schedule) and the measure value of \(UAS_{now}\) of the solution robustness. Then, the activity is arranged in descending order according to the value of \(uas_{now}^{j}\).
4. Insert a unit of time buffer in front of the activity in which the value of \(uas_{now}^{j}\) is the greatest, and set the corresponding value of \(uas_{now}^{j}\) as 0. At the same time, the start time of this activity and subsequent activities is postponed for a unit of time, and the schedule is modified.
5. Calculate the value of \(uas_{new}^{j}\) of all solution activities in this modified schedule, as well as the completion time (\(T_{new}\)) of this modified schedule and the measure value (\(UAS_{new}\)) of the solution robustness.
6. If the completion time (\(T_{new}\)) of this modified schedule does not exceed the due date (\(Duet\)) of the project, and the measure value (\(UAS_{new}\)) of the solution robustness is lower than the previous one (\(UAS_{now}\)), then this modified schedule is feasible, and is used as the current schedule of the next iteration, and \(uas_{new}^{j}\), \(T_{new}\)\(UAS_{new}\) are replaced by the current value. If the measure value (\(UAS_{new}\)) of the solution robustness is larger than the previous one (\(UAS_{now}\)), and \(uas_{new}^{j}=0\), then the algorithm should be terminated, the current schedule should be output and used as a robust scheduling. Otherwise, go to Step (8).
7. If the completion time (\(T_{new}\)) of this modified schedule exceeds the due date (\(Duet\)) of the project, and \(uas_{new}^{j}=0\), then the algorithm should be terminated, and the current schedule should be output and used as a robust scheduling. Otherwise, go to Step (8).
8. Remove a unit of time buffer that is inserted in front of the activity, and modify the starting time of this activity and its follow-up activities.  
Figure 6: A scheduled resource flow network.  
Select the activity that has the greatest value of \(uus_{new}^{j}\) in the sequence, insert a unit of buffer time in front of this activity and modify the starting time of this activity and the subsequent activities to get an modified schedule. Then, go to Step (5).