## 2 Background and Related Work
### Reinforcement Learning-Based SDWSN-IoT  
Unlike traditional routing algorithms, machine learning algorithms provide a distinct advantage as they are capable of surpassing the static nature of forwarding rules in flow tables and adapting to the dynamic network environment, enabling the identification of crucial flow items with remarkable accuracy. Machine learning algorithms offer a remarkable advantage by enhancing network performance through automated tasks and the ability to predict future network conditions. Addressing the need for minimized network latency and energy efficiency within the constraints of application dependence in a software-defined fog-IoT network, a study [28] introduced a dynamic task scheduling and assignment approach based on deep reinforcement learning (DRL). This method formulates the task assignment and scheduling problem as an energy-constrained Deep Q-Learning process, yielding promising results. In the realm of large-scale IoT networks, a study [29] investigated and proposed an SDN model with a Q-routing algorithm to efficiently route large data while reducing energy consumption. The proposed scheme showcased significant improvements in terms of the delivery latency, packet delivery ratio, and energy consumption. To optimize the overall processing delay within an energy-limited environment of a cloud-edge terminal collaboration network, which encompasses mobile-edge computing and an SDN architecture, a study [30] introduced a reinforcement learning-based joint communicational and computational resource allocation mechanism (RJCC). This approach demonstrated an enhanced performance in terms of the average energy consumption and average data delivery latency for communicating IoT devices.  
Furthermore, several studies have explored the application of machine learning algorithms in finding optimal data transfer routes within SDN-based network architectures for the SDWSN. For instance, a study [31] introduced an intelligent architecture for self-learning control strategies in software-defined networks by proposing a routing scheme based on deep reinforcement learning (DRL). This scheme, known as NetworkAI, utilizes deep reinforcement learning techniques and leverages network monitoring technologies like inband network telemetry to dynamically generate control policies, leading to near-optimal decision-making. Similarly, in [32], the authors presented a scheme to optimize the routing path in the SDWSN using the Reinforcement Learning (RL) algorithm. Their approach incorporates energy efficiency and network Quality-of-Service (QoS) parameters into the reward function. The proposed routing scheme compares various SDN-based techniques, including the traditional SDN, energy-aware SDN (EASDN), QR-SDN, TIDE, as well as non-SDN-based techniques such as Q-learning and RL-based routing (RLBR). The results indicate that the RL-based SDWSN outperforms other approaches in terms of the network lifetime and packet delivery ratio.  
This paper introduces a routing scheme that aims to enhance the capabilities of SDWSN-IoT by integrating cognitive machine learning techniques, leveraging the inherent features of SDWSN-IoT such as network programmability and comprehensive topology monitoring. The proposed framework facilitates dynamic learning and the adaptation to network changes, enabling the proactive installation and continuous updating of routes based on rapidly changing link states, thereby ensuring that swift and efficient routes are found for data forwarding.