## 1 Introduction  
Flying Ad Hoc Networks (FANETs) are gaining traction in disaster relief, environmental monitoring, and communication relay due to their rapid deployment, flexible mobility, and broad coverage [1, 2, 3, 4]. With the rapid development of the low-altitude economy, unmanned aerial vehicles (UAVs) have emerged as critical carriers of edge intelligence [5]. However, the limited capabilities of individual UAVs highlight the need for UAV swarms, which can perform complex tasks more efficiently and cost-effectively. As a representative application of FANETs, UAV swarms present significant challenges to routing protocol design due to their high-speed movement in three-dimensional space, energy constraints, frequent link disruptions, and dynamic changes in network density [6, 7, 8]. Conventional routing protocols can be categorized into two main groups: topology-based and location-based [9]. Classic topology-based protocols, such as AODV [10] and OLSR [11], maintain routing tables either passively or proactively. However, in FANETs, where network topology changes frequently, these protocols tend to generate outdated routing information and incur substantial control overhead. In contrast, Greedy Perimeter Stateless Routing (GPSR) [12], a prominent position-based protocol, relies solely on node location information, offering strong scalability. GPSR employs two forwarding strategies to ensure data delivery. GPSR employs two forwarding strategies to guarantee data delivery. In greedy mode, each node selects the neighbor nearest to the destination. When no such neighbor is available, indicating a routing void, the protocol transitions to perimeter mode, forwarding packets along the network boundary using the right-hand rule until greedy forwarding can resume. GPSR's greedy forwarding, while flexible and scalable, struggles in highly dynamic UAV swarms due to its reliance on single-hop neighbor information, resulting in degraded routing performance from frequent link interruptions and topology changes [13; 14]. In recent years, researchers have enhanced GPSR by incorporating multi-hop information [15; 16], energy level [17], and reinforcement learning techniques such as Q-learning to optimize routing decisions [18; 19; 20]. However, these approaches often rely on historical data for prediction, resulting in high computational overhead and underutilizing the future trajectory information of UAVs. In mission-oriented UAV swarms, nodes are typically equipped with planners to coordinate the swarm's global trajectory, and trajectory data is shared within the swarm to facilitate collaborative task execution. Inspired by [21], our study innovatively integrates trajectory knowledge into GPSR routing by constructing a two-hop neighbor table at any given moment. This provides comprehensive spatiotemporal environmental awareness and, combined with multidimensional features and adaptive learning mechanisms, significantly improves routing stability and transmission efficiency. The main contributions of this paper are as follows:  
1. Trajectory-Aware Neighbor Expansion: We propose a novel routing strategy for UAV swarms by leveraging mission-planner-derived trajectory knowledge. We develop a time-aware two-hop neighbor table that enables nodes to anticipate network dynamics, enhancing both local and global topological awareness. This proactive approach significantly reduces routing voids and fosters stable communication in dynamic environments;
2. Q-Learning-Driven Routing Optimization: We introduce an adaptive routing framework for UAV networks, utilizing Q-learning to navigate their high dynamism. The framework incorporates a comprehensive state space, including two-hop distances, residual energy, queue lengths, and trajectory dynamics, and employs a multi-objective reward function with dynamically adaptive parameters. This design ensures balanced and efficient next-hop selection, promoting robust routing decisions under rapidly evolving network conditions;
3.