4.1. Overall Framework and Schedule Encoding
This section presents the proposed Adaptive Sparrow Search with Dynamic Penalty and Repair Operators, abbreviated as ADP-SSA, for solving the constrained disposal scheduling model formulated in
Section 3. The central idea of ADP-SSA is to search in a continuous preference space while evaluating candidate solutions in the original constrained scheduling space. Each sparrow position
is first decoded into a raw disposal schedule
, then corrected by the repair operator as
, and finally evaluated by the dynamic penalized fitness function
. This design separates search behavior from feasibility enforcement. The continuous sparrow position preserves the flexibility of swarm-based global exploration, while the decoded and repaired schedule directly satisfies, or approaches, the practical constraints of disposal operations.
For a population with N sparrows, the position of sparrow n at iteration r is encoded as . The element represents the assignment preference of sending waste from generation node i to facility j during period t. A larger value of means that the pair is more likely to receive a larger portion of the available waste of node i in period t, but it does not directly determine the final transported amount because the actual schedule must also respect route compatibility, facility capacity, fleet resources, and backlog evolution. To avoid assigning waste to unavailable routes, the decoding procedure first masks incompatible links by setting the effective preference of to zero whenever . For compatible links, the preference is normalized within each pair of node and period. The normalized assignment ratio is computed as when at least one compatible facility exists for node i; otherwise, all corresponding ratios are set to zero and the generated waste remains as backlog. This softmax-style decoding keeps nonnegative and ensures over compatible facilities.
Given the normalized preference , the raw dispatched amount is initially generated as , where is the provisional backlog before period t in the raw decoding stage. This step guarantees that the total outgoing waste from node i does not exceed the amount available at the beginning of period t. However, because different nodes are decoded simultaneously, the provisional schedule may still violate facility capacity or fleet-resource constraints after the flows of all nodes are aggregated. Therefore, the raw tensor is not directly used as the final candidate schedule. Instead, it is passed to the repair operator developed later in this section, which performs capacity redistribution, fleet-resource correction, and terminal backlog clearance while preserving the priority structure of waste nodes.
The proposed encoding has three advantages for constrained disposal scheduling. First, it avoids discrete assignment instability. Directly representing facility choices as integer variables often causes abrupt changes in the schedule when a sparrow position is updated, whereas the continuous preference representation allows gradual adjustment of allocation ratios. Second, it naturally supports multi-period coupling. Since contains all elements over the complete horizon , the algorithm can modify early-period and late-period dispatching decisions jointly rather than optimizing each period independently. Third, it provides a unified interface for adaptive swarm updates. Discoverers, followers, and scouts all update their positions in the same continuous space, while the decoding and repair procedures ensure that the resulting solution remains interpretable as a practical disposal schedule.
The whole ADP-SSA procedure can be described as a repeated transformation from preference search to feasible scheduling. At the beginning, the initial population is generated using a hybrid initialization scheme. Part of the population is sampled uniformly to maintain diversity, while the remaining individuals are initialized according to a cost-priority heuristic in which lower-cost and lower-emission facilities receive larger initial preferences. This hybrid initialization improves the chance of locating promising regions early without forcing the population to start from a narrow deterministic pattern. At each iteration, the role sets , , and are determined adaptively according to the current population diversity and feasibility ratio. The position of each sparrow is then updated according to its role, decoded into , repaired into , and evaluated by . The best schedule found so far is recorded as , and the corresponding objective value is denoted by when is feasible.
Algorithm 1 summarizes the main computational flow. The later subsections describe the adaptive role update, the dynamic penalty mechanism, and the repair operators in detail. In this framework, the termination condition can be a maximum iteration number
, a maximum number of consecutive non-improving iterations, or convergence of the best feasible objective value. In the experiments of
Section 5, the maximum iteration criterion is used to ensure fair comparison among different algorithms.
| Algorithm 1 Overall framework of ADP-SSA for constrained disposal scheduling |
- 1:
Input: Sets , , and ; waste generation ; compatibility ; capacity ; fleet resource ; cost parameter ; priority coefficient ; maximum iteration ; population size N. - 2:
Output: Best feasible disposal schedule . - 3:
Initialize sparrow positions using hybrid random and cost-priority initialization. - 4:
Decode each into and repair it as . - 5:
Evaluate each repaired schedule by and record the best feasible schedule . - 6:
for to do - 7:
Compute the population diversity, feasibility ratio, and convergence indicator. - 8:
Adaptively determine the discoverer set , follower set , and scout set . - 9:
Update sparrow positions according to their roles in the continuous preference space. - 10:
Decode updated positions into raw schedules and apply repair operators to obtain . - 11:
Update the dynamic penalty coefficient and evaluate all repaired schedules by . - 12:
Update if a feasible schedule with a lower value of is obtained. - 13:
end for - 14:
Return .
|
Figure 1 gives a schematic view of the sequential decisions in Algorithm 1. The loop makes explicit that feasibility diagnostics are recomputed before role allocation and that decoding, repair, and dynamic-penalty evaluation occur before the best schedule is updated.
4.2. Adaptive Role Allocation and Search Dynamics
The standard Sparrow Search Algorithm usually assigns fixed proportions of discoverers, followers, and scouts during the whole search process. Such a fixed-role mechanism is not sufficiently flexible for constrained disposal scheduling because the population may face different optimization requirements at different stages. In the early stage, broad exploration is needed to identify promising disposal patterns across facilities and periods. In the middle stage, the algorithm must compare alternative waste-flow structures and reduce unnecessary transportation and treatment costs. In the late stage, the search should concentrate on feasible neighborhoods of high-quality schedules and avoid destroying already feasible assignments. Therefore, ADP-SSA adaptively updates both the role proportions and the position dynamics of sparrows according to population diversity, feasibility ratio, and convergence status.
At iteration
r, the population diversity is measured in the continuous preference space. Let
denote the population centroid. The diversity indicator is defined as
where
is a small positive constant used to avoid division by zero. A larger
indicates that the sparrows are distributed over a broader region, while a smaller
indicates that the population has become concentrated. The feasibility ratio is denoted by
, where
is the indicator function. The convergence status is measured by
, which records the number of consecutive iterations without improving the best feasible objective value
. These three indicators jointly determine whether the algorithm needs more exploration, stronger feasibility guidance, or more intensive local refinement.
The adaptive discoverer ratio is denoted by
, the follower ratio by
, and the scout ratio by
, with
. In ADP-SSA,
increases when diversity becomes too low or when the best feasible solution has not improved for several iterations, because additional discoverers can move the population away from a narrow local basin. The scout ratio
increases when the feasibility ratio is low, because scouts help detect and escape infeasible or overloaded scheduling regions. The follower ratio is then determined by the remaining population and is mainly responsible for exploiting the current best schedule. Specifically, the role ratios are computed as
and
, where
truncates
y into the interval
, while
,
,
, and
are lower and upper bounds of the corresponding role ratios. The coefficient
controls the influence of search stagnation. After calculating the role ratios, the individuals are sorted according to their penalized fitness
, and the best
individuals are assigned as discoverers. The worst
individuals or highly infeasible individuals are assigned as scouts, and the remaining individuals are assigned as followers.
For discoverers, the update rule combines global movement and diversity recovery. Let
denote the position associated with the best evaluated schedule at iteration
r, and let
denote the best feasible position found from iteration 0 to iteration
r. The discoverer update is written as
where
is a random vector sampled from a standard normal distribution. The coefficient
controls attraction toward the best feasible position,
controls random exploration, and
controls repulsion from the population centroid. In the early stage,
and
are relatively large, which encourages the discoverers to test diverse facility-allocation structures. In the late stage,
becomes dominant, which encourages convergence around the best feasible disposal schedule. The coefficients are updated as
,
, and
. In this way, exploration is reduced gradually, but diversity recovery remains active when the population collapses too early.
Followers update their positions by learning from both the current best schedule and randomly selected superior individuals. Let
denote the set of sparrows whose penalized fitness is better than that of sparrow
n. A guiding individual
m is sampled from
, and the follower update is defined as
where
is a random coefficient in
, and
is a smaller perturbation scale than that used by discoverers. The coefficient
increases with the feasibility ratio
. When the population contains few feasible schedules, followers mainly learn from multiple superior individuals, which prevents them from being trapped by a single infeasible leading solution. When feasible schedules become common, followers learn more strongly from
, thereby accelerating convergence toward high-quality feasible assignments.
Scouts are designed to respond to infeasible or stagnant regions. For a scout
, the violation profile of its repaired schedule
is first examined. If the violation is dominated by facility-capacity overload, the scout decreases preference values associated with overloaded facilities and increases preference values associated with facilities that still have residual capacity. If the violation is dominated by fleet-resource overload, the scout decreases preference values associated with large
links and strengthens shorter or less resource-consuming links. If the solution is feasible but has poor cost, the scout performs a larger exploratory jump around the best feasible position. The general scout update is expressed as
where
is a constraint-oriented direction derived from the dominant violation type. The coefficient
controls the strength of violation-guided movement,
controls attraction to the best feasible position, and
controls scout-level random disturbance. This update differs from blind random reinitialization because it uses the structure of the violated constraint to generate a meaningful escape direction.
After each role-based movement, the position values are bounded to avoid numerical overflow in the softmax decoding. Each element is truncated as
. Then the new position is decoded by
and corrected by
. The adaptive role mechanism and the role-specific position updates form the main search engine of ADP-SSA. They allow the algorithm to allocate more computational effort to exploration, exploitation, or feasibility recovery according to the actual state of the population, instead of using a fixed search pattern throughout the whole optimization process. Specific details are shown in Algorithm 2.
| Algorithm 2 Adaptive role allocation and position update in ADP-SSA |
- 1:
Input: Current population , repaired schedules , penalized fitness values , best feasible position . - 2:
Compute diversity , feasibility ratio , and stagnation indicator . - 3:
Calculate adaptive role ratios , , and . - 4:
Sort sparrows according to . - 5:
Assign discoverers , followers , and scouts . - 6:
for each sparrow do - 7:
if then - 8:
Update using the discoverer movement rule. - 9:
else if then - 10:
Select a superior guiding individual and update using the follower movement rule. - 11:
else - 12:
Identify the dominant violation type and update using the scout movement rule. - 13:
end if - 14:
Bound each element of within . - 15:
end for - 16:
Output: Updated population .
|
4.3. Dynamic Penalty Strategy and Constraint-Aware Fitness Evaluation
The adaptive search dynamics described in
Section 4.2 generate diversified candidate positions in the continuous preference space, but the scheduling quality of each sparrow must be evaluated in the constrained disposal space. A direct rejection of infeasible schedules is inefficient because the feasible region of the disposal scheduling problem may be narrow, especially when facility capacity
, fleet resource
, and terminal backlog condition
are simultaneously imposed. Conversely, using a fixed penalty coefficient may either over-penalize infeasible solutions in the early stage or under-penalize them in the late stage. To overcome this difficulty, ADP-SSA adopts a dynamic penalty strategy that changes with iteration progress, population feasibility, and violation severity. The purpose is to permit useful infeasible exploration at the beginning while gradually enforcing strict feasibility as the algorithm approaches convergence.
For a repaired candidate schedule
, the penalized fitness value is defined as
, where
is the generalized scheduling cost,
is the normalized violation degree defined in
Section 3.2, and
is the dynamic penalty coefficient at iteration
r. Since the value ranges of operational cost and constraint violation may differ significantly across datasets, the violation components are normalized before aggregation. Let
denote the average facility capacity and
denote the average fleet resource. The capacity and fleet violations are scaled by
and
, respectively, while backlog-related violations are scaled by
. This normalization prevents one violation component from dominating the fitness value merely because of its physical unit.
The dynamic coefficient
is constructed from three factors. The first factor is an iteration-growth factor, which gradually increases the penalty intensity as the search proceeds. The second factor is a feasibility-feedback factor, which strengthens the penalty when the current population contains too few feasible schedules. The third factor is a stagnation-feedback factor, which increases the pressure toward feasibility when the best feasible solution has not improved for several iterations. Specifically, the penalty coefficient is updated as
where
and
are the lower and upper penalty scales,
controls the nonlinear growth rate,
is the feasibility ratio,
is the average violation degree, and
is the stagnation indicator. The coefficients
,
, and
determine the sensitivity to feasibility ratio, average violation, and stagnation, respectively. When
is low or
is large, the algorithm imposes stronger pressure on infeasible schedules. When the population is already mostly feasible, the penalty grows more smoothly and the search can focus on reducing the generalized scheduling cost
.
Although provides a scalar value for sorting the population, ADP-SSA also uses a feasibility–priority comparison rule to avoid selecting infeasible schedules with artificially low operational costs as global leaders. Given two repaired schedules and , schedule is considered better than if one of three conditions holds. First, if both schedules are feasible, the one with the smaller generalized cost is better. Second, if one schedule is feasible and the other is infeasible, the feasible one is better regardless of the penalized value. Third, if both schedules are infeasible, the one with the smaller penalized fitness is better, and a tie is resolved by the smaller violation degree . This rule is used to update the best feasible schedule and to select and in the role-based update equations.
To further guide search behavior, the violation function is decomposed into a violation profile rather than used only as a scalar. For each schedule, ADP-SSA records the vector
, where each component corresponds to one constraint class. The dominant violation type is determined by
after normalization. This information is used by scouts in
Section 4.2 and by the repair operators in
Section 4.4. For example, if
is dominant, the algorithm decreases preferences related to overloaded facilities and attempts to redistribute waste to facilities with residual capacity. If
is dominant, it reduces long-distance or high-resource assignments. If
is dominant, later-period disposal capacity is preferentially reserved for clearing remaining backlog. Therefore, the dynamic penalty module does not merely punish infeasible schedules; it also provides diagnostic information for directional correction.
The proposed evaluation strategy also distinguishes between the best evaluated solution and the best feasible solution. The best evaluated position is selected from the current population according to the feasibility–priority comparison rule and is used to guide local exploitation in the current iteration. The best feasible position is associated with the best feasible schedule found over all previous iterations and is used as a stable convergence anchor. If no feasible schedule has appeared in the early iterations, is temporarily replaced by the least-violating schedule, but is updated only when . This distinction is important because it prevents the algorithm from reporting infeasible disposal schedules while still allowing the swarm to learn from near-feasible structures before the first feasible solution is obtained.
Algorithm 3 describes the dynamic penalty and constraint-aware evaluation process. The procedure is executed after decoding and repair at every iteration. Its output includes the penalized fitness values, the feasibility ratio, the average violation degree, the dominant violation type of each sparrow, and the updated best feasible schedule. These quantities are then fed back into adaptive role allocation, position updating, and repair selection. In this way, ADP-SSA forms a closed-loop optimization process in which constraint information continuously reshapes the search dynamics.
| Algorithm 3 Dynamic penalty and constraint-aware evaluation |
- 1:
Input: Repaired schedules , current best feasible schedule , iteration index r, maximum iteration . - 2:
Compute and the violation profile for each sparrow. - 3:
Calculate by aggregating the normalized violation components. - 4:
Compute the feasibility ratio and average violation degree . - 5:
Update the dynamic penalty coefficient . - 6:
for each sparrow do - 7:
Calculate . - 8:
Identify the dominant violation type from . - 9:
if and then - 10:
Update and store the corresponding position as . - 11:
end if - 12:
end for - 13:
Select using the feasibility–priority comparison rule. - 14:
Output: Penalized fitness values, , , , dominant violation types, and updated .
|
4.4. Priority-Preserving Repair Operators and Local Refinement
The dynamic penalty strategy in
Section 4.3 evaluates infeasible schedules in a controlled way, but penalty alone cannot guarantee that the final disposal plan is executable. Therefore, ADP-SSA embeds a repair operator
between decoding and fitness evaluation. Given a raw schedule
, the repair operator produces
by sequentially correcting route compatibility, waste-flow balance, facility overload, fleet-resource overload, backlog-priority violation, and terminal residual waste. The repair process is designed to be priority-preserving, meaning that waste from nodes with larger priority coefficient
is protected as much as possible when capacity or fleet resources are insufficient. This design is important for disposal scheduling because high-priority waste may correspond to food waste, medical-related municipal residues, hazardous fractions after preliminary sorting, or waste from dense urban districts where delayed collection can cause stronger public-health and environmental risks.
The first repair stage enforces route compatibility and nonnegative dispatching. For each incompatible pair with , the corresponding flow is directly set to . For compatible links, negative values caused by numerical disturbance are truncated as . Then the available waste at each node and period is checked. Let denote the amount of waste available for dispatch from node i in period t after considering the repaired backlog from the previous period. If , the flows from node i are proportionally scaled by . This operation preserves the relative facility preference produced by the sparrow position while ensuring that the schedule does not dispatch more waste than is physically available. The backlog is then updated by .
The second repair stage corrects facility-capacity overload. For each facility j and period t, the total assigned inflow is . If , no correction is required. If , the excess amount is removed from lower-priority and higher-cost assignments first. For each incoming node i, the removal score is defined as , which means that waste with higher generalized cost and lower priority is more likely to be shifted away from overloaded facility j. The candidate incoming flows are sorted in descending order of , and the excess amount is progressively removed until . The removed waste is not discarded; it is stored in a temporary buffer associated with node i and period t, and is subsequently reassigned to compatible facilities with residual capacity. For reassignment, each alternative facility k is ranked by the insertion score , where the first term favors lower generalized cost and the second term favors facilities with larger residual capacity. The coefficient controls the preference for capacity balance. This overload-removal and residual-capacity insertion mechanism preserves feasibility while avoiding excessive movement of waste flows.
The third repair stage handles fleet-resource overload. After facility repair, the total fleet consumption in period
t is calculated as
. If
, the algorithm reduces high-resource assignments and attempts to replace them with lower-resource compatible assignments within the same period. For each positive flow
, the resource-reduction priority is measured by
. Flows with larger
consume more fleet resource and have lower disposal priority, so they are corrected first. For a selected flow from node
i to facility
j, the repair operator searches for another compatible facility
k satisfying
,
, and residual capacity
. If such a facility exists, part of the flow is transferred from
j to
k until either the fleet excess disappears or the residual capacity of
k is exhausted. If no lower-resource facility is available, the corresponding amount is delayed as backlog, with lower-priority nodes delayed before higher-priority nodes. This step explicitly links the repair process to the fleet-resource constraint
introduced in
Section 3.2.
The fourth repair stage corrects priority-related backlog violation and terminal residual waste. If for a node i at period t, the excess backlog must be dispatched whenever compatible residual capacity and fleet resources are available. The repair operator searches facilities in ascending order of and assigns additional flow from node i to feasible facilities until or no feasible insertion remains. For the terminal period T, the condition is treated with the highest repair priority. If residual terminal backlog exists, the operator first uses unused capacity in period T, then attempts backward adjustment by moving lower-priority flows in earlier periods to later periods, thereby releasing earlier capacity for high-priority or terminal-critical waste. This backward adjustment is limited to compatible links and cannot violate facility capacity or fleet-resource constraints. If all resources are saturated, the remaining violation is kept in and strongly penalized by the dynamic penalty coefficient in later iterations.
After feasibility-oriented repair, ADP-SSA applies a lightweight local refinement step to reduce cost without destroying feasibility. The refinement step evaluates pairwise facility substitutions and small inter-period shifts. A facility substitution considers replacing a positive flow
with another compatible facility
k in the same period if
and both capacity and fleet constraints remain satisfied. An inter-period shift considers moving a low-priority flow from period
t to period
when this movement releases capacity for a higher-priority backlog in period
t and decreases the total value of
. To keep the computational cost controlled, only a limited number of candidate moves are tested for each repaired schedule, and candidates are ranked by estimated improvement
. A move is accepted only when it reduces
and keeps
, or when both the original and modified schedules are infeasible but the modified one has a smaller violation value under the feasibility–priority comparison rule of
Section 4.3.
Algorithm 4 summarizes the repair and local-refinement sequence. Once the decoded schedule and tie-breaking rule are fixed, the operator is deterministic. Its additional computational cost relative to standard SSA is quantified in
Section 4.5.
| Algorithm 4 Priority-preserving repair operator and local refinement |
- 1:
Input: Raw schedule , waste generation , compatibility , facility capacity , fleet resource , priority coefficient , generalized cost . - 2:
Output: Repaired schedule . - 3:
Initialize and compute provisional backlog . - 4:
Set for all incompatible links with , and truncate negative flows to zero. - 5:
for each period and node do - 6:
Compute available waste . - 7:
if then - 8:
Scale outgoing flows from node i proportionally so that . - 9:
end if - 10:
Update backlog . - 11:
end for - 12:
for each period and facility do - 13:
Compute facility load . - 14:
if then - 15:
Remove excess flow according to the descending removal score . - 16:
Reassign removed waste to compatible facilities with residual capacity according to the ascending insertion score . - 17:
end if - 18:
end for - 19:
for each period do - 20:
Compute fleet consumption . - 21:
if then - 22:
Shift high-resource and low-priority assignments to lower-resource compatible facilities when possible. - 23:
Delay the least-priority remaining excess as backlog if no feasible shift exists. - 24:
end if - 25:
end for - 26:
for each node and period do - 27:
if then - 28:
Insert the excess backlog into compatible facilities with residual capacity and available fleet resource. - 29:
end if - 30:
end for - 31:
Prioritize terminal repair by reducing through residual terminal capacity and backward adjustment. - 32:
Apply cost-reducing facility substitution and feasible inter-period shift as local refinement. - 33:
Return .
|