## 4 Hybrid Algorithm Based on DQN and DWA  
### Hybrid Algorithms  
The following is the pseudocode for the A* hybrid algorithm's route planning process based on DQN and DWA: Algorithm 1. The structure of the whole algorithm is as follows: First, determine whether there is A dynamic obstacle to the application of the global adaptive A* algorithm state. If not, the threat function of the global A* is calculated through the seventh line of algorithm 1, which is formula 3 in this paper. If there is, the threat function is taken as 1. Second, for the local dynamic programming, set DQN and DWA algorithm; if it falls into the local optimal, DQN is used to select the next state action, and if it moves normally, the iterative planning continues, and finally returns to the planning path. The research indicates that the robot's route planning should take both static and dynamic obstacle interference into account. The A* algorithm's global route planning only considers the static barriers in the surroundings; it ignores the impact of dynamic obstacles, which might cause the robot to collide with them. However, the robot enters the local optimum and is unable to reach the goal location since the DWA algorithm's local route planning only considers the barriers in the immediate area and ignores global path planning. The suggested fusion approach, which combines the enhanced A* algorithm, DWA algorithm, and DQN algorithm to overcome this issue, guarantees not only obstacle avoidance but also the smoothness and optimality of route planning. The route planning system, which primarily consists of global path planning and local path planning, is designed by combining the enhanced A* algorithm and DWA algorithm, as shown in Figure 23. The global route of the planning goal is formed once global path planning is completed using the enhanced A* algorithm. The information gathered from the sensors in the immediate vicinity is then used to update the local map. The DWA and DQN algorithms are used to complete the local motion path planning, which enables the robot to avoid dynamic obstacles, reach the local goal point, continually update the route, and eventually reach the target position. The temporary objective points for each stage of the optimization dynamic window technique are derived from the key points of the global route that the enhanced A* algorithm proposes. Together with the DWA and DQN algorithms, the enhanced A* algorithm may address each method's flaws in real time, finish global route planning, and successfully avoid dynamic barriers. The local target point is generated by the local route planning algorithm in conjunction with the global path, as seen in Figure 24. The global target point is eventually reached after a continual update of the previous local target point and the \begin{table}
\begin{tabular}{c c c} \hline
**Algorithm** & **Success Rate** & **Expected Reward** \\ \hline DWA & 0.9036 & NA \\ \hline DQN & 0.9347 & 210.289 \\ \hline DWA+DQN & 0.9936 & 248.125 \\ \hline \end{tabular}
\end{table} 
Table 3: Path planning performance comparison table. subsequent local target point. In addition to ensuring the global path's optimality. In local planning, the fusion algorithm ensures efficient movement impact and obstacle avoidance. ```
1. Initialization parameter
2. Learning rate \(\alpha\) = 0.01
3. Exploration strategy initial \(\varepsilon\) = 1
4. Training times = 1000
5. Def adaptive A*(start,goal,map):
6. If d = 0
7. \(f(\mathbf{x_{1}},\mathbf{x_{2}})=\frac{1}{k_{1}x_{1}+k_{2}x_{2}+\varepsilon}\)
8. Else
9. \(f(\mathbf{x_{1}},\mathbf{x_{2}})=1\)
10. Def DWA(current_pose,velocity_window,map):
11. Def Hybrid A*(start,goal,map):
12. For i in range(Training times):
13. current_pose = start
14. global_path = adaptive A*(start,goal,map)
15. While Current_pose = goal:
16. State = get_state(current_pose, global_path,map)
17. If random.random \(<\varepsilon\):
18. action = random.choice(available_actions)
19. else:
20. Action = dqn.act(state)
21.