## 3 Methodology
### Algorithm of Distributed Receding Horizon Optimization  
In order to address the cooperative driving issue of mixed-automated vehicles at intersections, we present a distributed optimization algorithm under a receding horizon framework. The details are provided in Algorithm 2, which aims to find the optimal solutions for each AV in the CZ by solving (15). Figure 3 shows the basic procedure of the distributed receding horizon optimization scheme. The optimization problem is solved at each time step, and only the first element of the obtained control sequence is applied. In Algorithm 2, initialization is conducted in step 1, which determines the start time of the algorithm, i.e., when ego AV \(i\) enters the CZ, and calculates initial \(N_{p}\)-step prediction states \(\hat{x_{i}}(k+1|0)=[\hat{p}_{il}(k+1|0),\hat{v}_{il}(k+1|0)]^{T}\), \(k=0,\ldots,N_{p}-1\), using (10). The communication topology of vehicles in the CZ at the current time step is identified in step 3. Based on the communication topology, ego AV \(i\) receives the information of \(N_{p}\)-step prediction states \(\hat{x_{j}}(k+1|t)\), \(k=0,\ldots,N_{p}-1\), of neighboring vehicle \(j,j\in\mathcal{N}_{i}(t)\) in step 4. Then, in step 5, ego AV \(i\) utilizes its current state and the predicted future \(N_{p}\)-step trajectories of neighboring vehicle \(j,j\in\mathcal{N}_{i}(t)\) to solve the optimization problem (15). The first element of the obtained optimal control sequence is applied to AV \(i\) in step 6, i.e., \(u_{i}(t)=u_{i}^{*}(0|t)\). The prediction of the trajectory of the neighboring vehicles is the key to solving the optimization problem (15) for the ego vehicle. Note that in the framework of distributed cooperation, the communication, computation, and control of all vehicles are assumed to be synchronous. Therefore, each AV \(i\) cannot receive the accurate \(N_{p}\)-step predicted trajectories of its neighboring vehicle \(j\) at the current step. To address this issue, we perform an operation to adopt the \(N_{p}\)-step assumed trajectories of neighboring vehicle \(j\) in the last shifted time window. Here, we take vehicle \(i,i\in\Omega_{A}(t)\) as an example and illustrate the calculation process of the assumed trajectory, as depicted in Figure 3. Define \(u_{i}^{*}(k|t),k=0,\ldots,N_{p}-1\) as the optimal control sequence, and \(x_{i}^{*}(k+1|t)=[p_{il}^{*}(k+1|t),v_{il}^{*}(k+1|t)]^{T},k=0,\ldots,N_{p}-1\)  
Figure 3: Illustration of the procedure of the distributed receding horizon optimization scheme. are the optimal states calculated by (10) in step 7. The assumed trajectory of vehicle \(i\) is computed in step 8 by removing the first state value of \(x_{i}^{*}(k+1|t)\), \(k=0,\ldots,N_{p}-1\), and adding the ending value \(x_{i}^{*}(N_{p}|t)-x_{i}^{e}(N_{p}|t)\), where \(x_{i}^{e}(N_{p}|t)=[v_{\hat{i}\hat{i}}^{*}(N_{p}|t)\delta,0]^{T}\). The obtained assumed trajectory of vehicle \(i\) is transmitted to vehicle \(j\), \(j\in\mathcal{D}_{i}(t)\), and is regarded as the predicted trajectory of vehicle \(i\) in the next time window. In the same way, vehicle \(i\) receives the assumed trajectory of its neighboring vehicle \(j,j\in\mathcal{N}_{i}(t)\). Note that if vehicle \(j\) is an MV, Equation (11) should be used to calculate the assumed trajectory of vehicle \(j\). Similar approaches can be found in [33; 35]. In the next shifted time window, the problem is reformulated and solved again until ego AV \(i\) departs from the CZ. ```
0: The communication topology of vehicles in the CZ; the state of ego AV \(i,i\in\Omega_{A}(t)\); \(N_{p}\)-step prediction states of its neighboring vehicle \(j,j\in N_{i}(t)\)
0: Optimal trajectory of AV \(i\). 1:Initialization: At time \(t=0\) (the moment [PERSON] \(i\) enters the CZ), load the current state \(\hat{x}_{i}(0|0)\); Assume \(u_{i}(k|0)=0,k=0,\ldots,N_{p}-1\), and calculate the \(N_{p}\)-step prediction states \(\hat{x}_{i}(k+1|0)\), \(k=0,\ldots,N_{p}-1\), using (10). 2:Repeat
3:Topology identification: Acquire the communication topology of vehicles at the current step.