# Freeway Traffic Congestion Reduction and Environment Regulation via Model Predictive Control
## 4 The Proposed Algorithm: MPC_CPDMO-NSGA-II
### Cpdmo-Nsqa-Ii
#### 4.2.1 Description of CPDMO-NSGA-II  
Figure 4 gives the flowchart of the proposed CPDMO-NSGA-II algorithm. We will describe the proposed CPDMO-NSGA-II algorithm firstly, then sub-algorithm 1 and sub-algorithm 2 used in the CPDMO-NSGA-II algorithm will be discussed later, finally, the environmental detection strategy and the prediction strategy used in the CPDMO-NSGA-II algorithm will be discussed. Figure 4: Flowchart of the CPDMO-NSGA-II algorithm. 1. The CPDMO-NSGA-II algorithm Step 1: Initialize parameters and population: set maximal iteration max_pop, population size _pop_, initial time window \(t=1\), and generate initial population randomly; Step 2: If environment changes, namely the value of detect operator exceeds threshold \(\zeta\), go to the sub-algorithm 1 to realize clustering prediction, otherwise, go to step3. Step 2.1: Set \(Q_{t-1}=Q_{t},Q_{t}=P_{t}\), For population \(P_{t}\): Reject \(n\) individuals (the proportion is 25% in this paper), and generate \(n\) new individuals \(P_{random}\) randomly; If \(t<3\), remain rest individuals, then go to Step2.3; if not, go to Step2.2, and generate \(pop-n\) individuals through clustering prediction; Step2.2: Clustering prediction: Step 2.2.1 Cluster the individuals in population \(P_{t}\) (execute sub-algorithm 1): for population \(P_{t}\), getting centers \(R(k)_{t}\), where \(k=1,2,\ldots,cnum\), \(cnum\) is the number of clusters; Step 2.2.2 Predict the centers of clustering (execute sub-algorithm 2): make association between \(R(k)_{t}\) and \(R(k)_{t-1}\) through algorithm 2, and predict \(cnum\) centers \(R(k)_{t+1}\) through Equation (21); Step 2.2.3 Execute shape prediction: predict the shape of each cluster according to \(R(k)_{t+1}\), and generate \(pop-n\) individuals \(P_{predict}\). The operator of shape prediction is \(x(k)_{t+1}^{i}=R(k)_{t+1}^{i}+\sigma\), where \(\sigma\) is mutation operator in NSGA-II, \(i=1,2,\ldots,n\), \(n\) is the dimension of decision vector; Step 2.2.4 Merge \(P_{random}\) and \(P_{predict}\), \(P_{t+1}=P_{random}\cup P_{predict}\), as new parent population; Step2.3: Go to next time window \(t=t+1\); Step 3: Go to the process of evolution and selection; Step3.1: Execute tournament selection, go to the process of evolution: Step 3.1.1 Execute tournament selection for population \(P_{t}\), and select \(pop/2\) individuals to form a pool for crossover; Step 3.1.2 Execute crossover and mutation for population \(P_{t}\), and generate child population \(C_{t}\); Step 3.2: Merge child and parent populations, \(P_{t}{}^{combine}=C_{t}\cup P_{t}\); Step 3.2.1 Execute non-dominated sorting for \(P_{t}{}^{combine}\), and calculation crowd distance; Step 3.2.2 Select _pop_ optimal individuals through the selection operator in NSGA-II, as new parent population \(P_{t+1}\); Step 4: If the number of iterations reach max_pop, return current optimal individuals, then stop algorithm; if not, repeat Step 2 to Step 3. In the proposed CPDMO-NSGA-II algorithm, the sub-algorithm 1 realized in Step 2.2.1, cluster the individuals in the population is used to realize how to cluster the individuals in population and get centers \(R(k)_{t}\), which can avoid the poor distribution of historical population resulting in poor distribution performance of the whole algorithm. The sub-algorithm 1 is described as following:  
1. Sub-algorithm 1: Cluster the individuals in the population Step 1: Initialize a link list \(G\); save population \(P_{t}\); and determine the number of cluster \(cnum\).