# Multi-Class Freeway Congestion and Emission Based on Robust Dynamic Multi-Objective Optimization
## 3 Robust Dynamic Multi-Objective Optimization Problem in Freeway Traffic Congestion and Emission
### Robust Dynamic Nondominated Sorting Multi-Objective Genetic Algorithm RDNSGA-III  
In the robust dynamic nondominated sorting multi-objective genetic algorithm RDNSGA-III proposed in this section, there are two main improvements:  
1. In terms of dynamic characteristics, an environment detection operator is introduced based on the NSGA-III algorithm to test whether the external environment has changed. If environmental variations are detected, optimization will be restarted to obtain the optimal solutions which satisfy the current environment. Moreover, in the process of the algorithm operating, the environment information and the optimal solution sets corresponding to the current environment will be stored. It is ensured that repeated optimization under a similar environment can be avoided during the dynamic optimizing process;  
2. In terms of robustness, the robust dynamic objective function is introduced to measure the robustness of the solutions in the nondominated sorting, i.e., the robust dynamic objective function is used to sort the solutions. By minimizing the average value of the objective function in multiple continuous temporal windows, the solution with stronger robustness is not only applicable to the current dynamic environment, but also applicable to multiple continuous dynamic environments. The robust dynamic objective function setting has been described in detail in Formula (1) to Formula (3) above. The framework of the RDNSGA-III algorithm is described as follows:  
Step 1: Initialize the environment detection parameter, set the environmental detection counter \(t=1\), the maximum environmental detection times \(t_{max}\), and \(bestop_{final}=\varnothing\) to store the current environment information and corresponding optimal solutions. Step 2: If the environment detection counter \(t=1\), or if the environment detection counter \(t>1\) and the environment has changed, go to step 3. Otherwise, copy the current population \(P_{1}\), and go to step 12. Step 3: Initialize algorithm parameters, including the maximum iterations \(Gen_{max}\), the number of the population \(pop\), the current generation \(gen=0\), initialize the population \(P_{0}=\{x(1),\ldots,x(pop)\}\), nondominated solution set \(S_{t}=\varnothing\), archive set \(D_{t}=\varnothing\), and reference point set \(Z^{s}=\varnothing\). Step 4: Recombine, crossover and mutate the population \(P_{t}\) to generate offspring population \(Q_{t}\), \(Q_{t}=\text{{Recombination}}(P_{t})+\text{{Mutation}}(P_{t})\). Step 5: Combine archive set \(D_{t}\) and offspring population \(Q_{t}\) to generate the combined population \(R_{t}\), \(R_{t}=D_{t}\cup Q_{t}\). Step 6: Perform the nondominated sorting operation on the combined population \(R_{t}\) and generate the nondominated solution set \(R_{t}=\{F_{1},\,F_{2},\,F_{3},\ldots,F_{t},\ldots\}\). Perform nondominated sorting on the nondominated solution set \(R_{t}\) to obtain the set \(U_{t}\), \(U_{t}=\text{{Non-dominated-sort}}(R_{t})\), where \(F_{1},\,F_{2},\,F_{3},\,\cdots,F_{t},\cdots\) denotes the nondominated solution sets with nondomination level \(1,2\ldots,\ldots\), respectively, \(F_{1}\succ F_{2}\succ F_{3}\succ\cdots\succ F_{l}\succ\cdots\). Step 7: Generate nondominated solution set \(S_{t}\). Step 8: Generate the next-generation population \(P_{t+1}\). If the number of solutions in \(S_{t}\) is exactly equal to \(N\), i.e., \(|S_{t}|=N\), the next generation of parent population \(P_{t+1}\) is generated directly, \(P_{t+1}=S_{t}\), and \(t=t+1\), return to step 2; otherwise, structure \(P_{t+1}\) with \(F_{1},F_{2},\ldots,F_{l-1}\), i.e., \(P_{t+1}=\cup_{j=1}^{l-1}F_{j}\). The remaining \(K\) solutions need to be selected from the layer \(F_{l}\) according to the niche count, i.e., the number of solutions that the population \(P_{t+1}\) needs to select from \(F_{l}\) is \(K=N-|P_{t+1}|\). Step 9: Generate reference points; the reference point set \(Z^{r}=\text{{Normalize}}(f^{n},S_{t},Z^{s},Z^{r})\).