3.1. Recursive Method for Waiting Time Calculation
It can be seen from Equation (11), the multimodal transport time of
i consists of transport time, transshipment time, and waiting time. From assumptions (4) to (8), it is evident that the first two times depend only on
and
. Therefore,
,
,
,
, and
can be directly calculated using Equations (12), (14), (15), (17) and (18) when given hub allocation. Nevertheless, calculating minimum waiting times at hubs (
and
) is more complex. From Equation (13) (or Equation (16)),
(or
) is the difference between
(or
) and
(or
). According to assumptions (9) to (11),
,
, and
, except for
, depend not only on
and
, but also on
and
, (
) as well as the position of
i in the transshipment sequence (
and
,
). Consequently, calculating
and
under the premise of hub allocation and transshipment sequence becomes a key issue in solving
. With growing interest in simulation models for scheduling [
44], this section proposes a recursive method (after this referred to as WTC) to more accurately calculate
,
, and
at hubs by simulating actual cargo flow, replacing the prevalently used average waiting time. The detailed process is as follows.
Step 1: Calculate
. According to assumptions (1) and (5),
equals the sum of the multimodal transport start moment of
i and the time consumed by operations ①:
Given the value of , can be calculated by Equation (12). Using Equation (19) and repeating Step 1 for each , the arrival moments at upstream stations can be obtained.
Step 2: Generate the subsets of R. Based on the values of , R is divided into |U| disjoint subsets , where is the set of cargoes that select u as an upstream station. Let u = 1, and proceed to Step 3.
Step 3: Calculate .
Step 3.1: If u ≤ |U|, proceed to Step 3.2; otherwise, skip to Step 4.
Step 3.2: If (i.e., no cargo selects u), let u = u + 1, and return to Step 3.1; otherwise, proceed to Step 3.3.
Step 3.3: Search for elements in
. If there is no immediate predecessor activity for
, i.e., it satisfies:
then
=
. According to Equation (13),
= 0; that is,
j will start operation ②-2 immediately upon arrival at
u without waiting. Let
c =
j, and proceed to Step 3.4.
Step 3.4: Calculate by Equation (14).
Step 3.5: If no
satisfies
= 1, then let
u =
u + 1, and return to Step 3.1; otherwise,
Substitute and into Equation (13) to obtain . Let c = i, and return to Step 3.4.
Step 4: Calculate
. According to assumptions (1) to (5),
equals the sum of the multimodal transport start moment of
i and the time consumed by operations ①, ②-1, ②-2, and ③, i.e.,
Given the values of and , can be calculated by Equation (15). Using Equation (22) and repeating Step 4 for each , the arrival moments at downstream stations can be obtained.
Step 5: Generate the subsets of R. Based on the value of , R is divided into |D| disjoint subsets , where is the set of cargoes that select d as a downstream station. Let d = 1, and proceed to Step 6.
Step 6: Calculate .
Step 6.1: If d ≤ |D|, let , r = 0, and proceed to Step 6.2; otherwise, skip to Step 7.
Step 6.2: If , let d = d + 1, and return to Step 6.1; otherwise, proceed to Step 6.3.
Step 6.3: Search for elements in
TS. If
has the earliest arrival moment at
d, i.e., for
satisfies
,
, then,
Substitute and into Equation (16) to obtain .
Step 6.4: Calculate by Equation (17). Let, , and return to Step 6.2.
Step 7: Calculate . Applying Equation (18) to obtain . Substitute , ,, , , , , and into Equation (11) to obtain for each .
Step 8: End.
Unlike existing multimodal transport studies that mainly calculate average waiting times for cargoes at hubs, WTC, with known hub allocation and transshipment sequence, can recursively derive minimum waiting times at hubs based on arrival moment, thereby providing a more precise estimate of
. Steps 1 to 3 are responsible for calculating
,
, and
given
and
: The waiting time
of the cargo that earliest loaded at
u is determined in Step 3.3; the minimum waiting time
of other cargo is obtained in Step 3.5;
and
are, respectively, gained in Step 1 and Step 3.4. Based on Steps 1 to 3, Steps 4 to 6 are primarily responsible for calculating
,
, and
given
:
is obtained in Step 6.3;
and
are obtained in Step 4 and Step 6.4, respectively. Then, based on
given in Step 7,
can be obtained. It should be noted that unlike the FCFS rule commonly used in the existing literature, in WTC,
is independent of
(see Step 3), while
is determined by
(see Step 6). This means that an arbitrary loading sequence at upstream stations is allowed in WTC, while the unloading sequence at downstream stations is determined by the FCFS rule. It can be easily demonstrated that, in the model shown in
Section 2.2, when hub allocation and upstream station transshipment sequence are known, the FCFS rule is the optimal sequencing rule for all downstream stations. If upstream stations also determine the transshipment sequence (
) based on the arrival moments of cargoes, it can be simplified to the FCFS rule. Therefore, WTC can be seen as a more general waiting time calculation method that can be adapted to any sequencing rule.
Below, a simple example is provided to illustrate the advantage of WTC in waiting time calculation and the necessity of considering transshipment sequence selection. Cargoes from A, B, and C are transported to a destination via upstream stations (1 and 2) and downstream stations (3 and 4). A hub allocation result is shown in
Table 3 where A and B share 2, while B and C share 4. Therefore, congestion may occur at 2 and 4, necessitating the determination of the transshipment sequence. According to WTC, the transshipment sequence at 4 is determined by the FCFS rule, so it is only necessary to select transshipment sequences for A and B at 2. From
Table 3, it can be seen that there are two feasible sequencing schemes for A→B and B→A. The bipartite network diagrams for these two schemes are shown in
Figure 2a and
Figure 2b, respectively. Taking A in the two figures as an example, the solid arrows and the labels above them (A1, A2, A3, A4, and A5) represent the operations ①, ②-2, ③, ④-2, and ⑤ for A, respectively; the numbers below represent the time required to complete the operations, respectively. The symbols for B and C have similar meanings. The dashed arrows in the two figures represent transshipment sequences at hubs.
From
Figure 2a, A2 is the immediate predecessor activity of B2. Since A arrives at 2 before B, and C arrives at 4 before B,
Figure 2a can be considered adopting the FCFS rule to determine the transshipment sequence. Unlike
Figure 2a, in
Figure 2b, B2 is adjusted to be the immediate predecessor activity of A2, resulting in B arriving at 4 before C; consequently, B4 is adjusted to be the immediate predecessor activity of C4. Set
= 0, and use WTC to calculate
,
, and
for
Figure 2a,b, with the results shown in columns 3, 4, and 5 of
Table 4. Then, replace
and
with the average waiting time
and
, respectively, then calculate the average end moment (
) with the results shown in columns 6, 7, and 8 of
Table 4.
From
Table 4, it can be seen that when using
, the makespans of
Figure 2a and
Figure 2b are 50 h and 44 h, respectively, so
Figure 2b is superior to
Figure 2a. However, when using
, the makespans of
Figure 2a and
Figure 2b are 45.5 h and 47.5 h, respectively, so
Figure 2a is superior to
Figure 2b. That is, different waiting time estimate methods can lead to an opposite decision here. If the average waiting time is used for makespan calculation, the FCFS rule is the best sequencing rule, no specialized decision is needed for the transshipment sequence selection. However, if WTC is used for makespan calculation, the makespan of
Figure 2b reduces by 6 h compared to
Figure 2a, necessitating a special transshipment sequence selection decision. This suggests that introducing WTC for minimum waiting time calculation and transshipment sequence selection can result in a higher-quality multimodal transport scheme, thereby confirming the effectiveness of the simulation approach.
3.2. Memetic Algorithm for Solving ITRTSP
From
Section 2.1, WTC can solve for
based on any given transshipment sequence at an upstream station. Therefore, as long as all possible transshipment sequences are traversed, a better sequencing scheme can be obtained theoretically (at least not inferior to the FCFS rule). However, since the two-stage HFSP is an NP-hard problem [
45], its global optimum solution is usually difficult to obtain within a limited decision time when the solution space size is large. In such a case, heuristics is usually a more reasonable option. In fact, the FCFS rule is one of the important heuristics for solving the sequencing problem. However, further searching for feasible transshipment sequences based on hub allocation will make the solution space size grow exponentially. If the heuristics are not properly designed, the result may be inferior to the FCFS rule and adversely affect the road–rail multimodal transport scheme. Thus, special research on heuristics is needed to solve ITRTSP.
As mentioned above, ITRTSP can be transformed into a two-stage HFSP with transport constraints. Generally speaking, a solution to an HFSP mainly consists of machine allocation and processing sequence [
9]. Existing heuristic methods [
40,
46,
47,
48] usually first encode the solution as processing sequences of jobs and then use machine allocation rules to decode the given processing sequence and calculate the makespan. For example, in the memetic algorithm framework (referred to as Framework 1) designed by Lei et al. [
40], algorithms such as NEH, IG, and GA are for the outer layer to generate and optimize processing sequences; while algorithms such as IMPT, ECTT, and GAMT are for the inner layer to find better machine allocation schemes for the processing sequences generated by the outer layer. The memetic algorithm integrates the strengths of global and local search, allowing for the exploration of multiple high-quality regions within the solution space [
40,
49]. This approach leads to more precise identification of optimal solutions. Due to its effectiveness in handling complex problems, this paper also designs nested solution methods based on the memetic algorithm framework. The difference is that the methods in this paper first encode multimodal transport schemes as hub allocations, and then decode them by selecting an appropriate transshipment sequence for each; that is, the memetic algorithm framework in this paper is constructed with hub allocation as the outer layer and transshipment sequence selection as the inner layer (referred to as Framework 2, see
Figure 3). As the genetic algorithm (GA) is widely used due to its superior global search performance in minimizing makespan in HFSP [
50,
51], the nested genetic algorithm (abbreviated as GA_GA) is used to illustrate the solution process of Framework 2. The detailed calculation process of GA_GA is as follows.
Step 1: Set parameters. Firstly, input the data, including quantities and transport start moments of all cargoes, the road and rail transport times, and the transshipment efficiencies at upstream and downstream stations. Then, set the inner and outer layer algorithms parameters, including maximum genetic generations, population sizes, crossover and mutation probabilities, etc.
Step 2: Construct an initial outer layer population. Generate an initial population of N chromosomes as the current outer layer population. Each chromosome consists of 2|
R| genes; the first |R| genes are sequenced by the origin numbers, with the
i-th gene indicating
u chosen for
i. The second |R| genes are also sequenced by the origin numbers, with the |R|+
i-th gene indicating
d chosen for
i. To comply with Equations (2) and (3), the first |R| genes are randomly selected from U, and the second |R| genes are randomly selected from D. For example, a chromosome in the outer layer population of the example given in
Table 3 is shown in
Figure 4a, which indicates that A, B, and C are transported to the destination via upstream stations 2, 2, 1 and downstream stations 3, 4, 4, respectively.
Step 3: Perform crossover and mutation for the chromosomes in the current outer layer population. Then N new chromosomes are generated. To ensure the feasibility of the new chromosomes, segmented multipoint crossover and mutation are separately applied to the first |R| and the second |R| genes. For example, in the example given in
Table 3, perform multipoint crossover by swapping corresponding genes (
Figure 5a). After crossover, apply segmented mutation to the new chromosomes (
Figure 6a). Merge these chromosomes after crossover and mutation with the original chromosomes from the current population to form a new outer layer population.
Step 4: Inner layer algorithms.
Step 4.1: Construct initial inner layer populations. Transfer the information of the current outer layer population to the inner layer, creating an initial inner layer population for each outer layer chromosome (total 2N inner layer populations), and select one population
n (
) as the current inner layer population. Each inner layer population consists of M chromosomes, each chromosome containing |R| genes. The gene sequence represents the transshipment sequence at an upstream station, with each gene indicating that
i needs to be loaded (onto trains) in that sequence. To comply with Equations (5) and (6), the genes of each inner layer chromosome should be restricted. First, similar to WTC, divide R into |U| disjoint subsets
(
, the union of all
is R) based on the first |R| genes (selection results of upstream stations) of outer layer chromosome
n.
is the set of all
that select
u. Second, group the gene positions for each inner layer chromosome, assigning |
| gene positions to each
(if
=
Φ, then |
| = 0, meaning no gene positions are assigned to
u). Finally, for each inner layer chromosome, randomly draw elements from
without replacement to fill the gene positions, generating the transshipment sequences at each upstream station that satisfies Equations (4)–(10). For example, in the outer layer chromosome shown in
Figure 4a,
= {C} and
= {A, B} are the groups for the upstream stations. Assign gene position 1 of the inner chromosome to
and gene positions 2 and 3 to
. By performing random draws, the initial inner layer population can be generated as shown in
Figure 4b (for instance,
Figure 4c shows the draw result of the first chromosome in
Figure 4b).
Step 4.2: Based on the current inner population
n, perform crossover and mutation to generate M new chromosomes. To ensure the feasibility of these new chromosomes, only perform crossover and mutation within the same subset
. Taking the two chromosomes numbered 1 and M in
Figure 4b as an example, when performing crossover on
, only the gene positions 2 and 3 of the two chromosomes can be crossed, resulting in two new chromosomes, as shown in
Figure 5b. After crossover, perform mutation on
by swapping gene positions 2 and 3 to form a new chromosome, as shown in
Figure 6b. Merge the new M chromosomes with the original chromosomes to form a new current inner layer population with the 2M chromosomes.
Step 4.3: Calculate fitness values of inner layer chromosomes. First, construct a multimodal transport scheme
consisting of outer layer chromosome
n and inner layer chromosome
m . Second, apply WTC to calculate
in
. Finally, formulate the inner layer fitness function:
where
is the fitness value of
. Substituting
and
into Equation (24) can obtain the
. Repeat this step for all 2M chromosomes of the current inner layer population.
Step 4.4: Determine whether the current inner population n has reached its maximum generation. If not, proceed to Step 4.5; otherwise, let be equal to the , which has the maximum value of in the current inner layer population, and record its makespan. Set it as the final transport scheme for the outer layer chromosome n, and proceed to Step 4.6.
Step 4.5: Select the inner layer offspring. Applying elite tournament mode, M chromosomes are selected from the current inner layer population to form a new inner layer offspring population, which is returned as the current inner layer population to Step 4.2.
Step 4.6: Iterate over all inner layer populations. Repeat Steps 4.2 to 4.5 for all inner layer populations to obtain a set of optimized transport schemes and corresponding makespan for the outer layer population. Then proceed to Step 5.
Step 5: Outer layer chromosome fitness values calculation. Construct the outer layer fitness function:
where
represents the fitness value of outer layer chromosome
n, and
represents the makespan of the transport scheme
. Applying Equation (25), fitness values of all current outer layer chromosomes can be obtained.
Step 6: Determine whether the current outer layer population has reached its maximum generation. If not, proceed to Step 7; otherwise, select and record with the minimum makespan from . Set it as the optimal scheme and proceed to Step 8.
Step 7: Select the outer layer offspring. Applying elite tournament mode, N chromosomes are selected from the current outer layer population to form a new outer layer offspring population, which is returned as the current outer layer population to Step 3.
Step 8: End the calculation and output .