Software-defined networking (SDN) is a flexible networking paradigm that provides isolation of control and data planes from each other, proposes control mechanisms, network programmability and autonomy, and new tools for developing solutions to traditional network infrastructure problems such as latency, throughput, and packet loss losses. One of the most important critical issues that evaluated by SDN offers is the hardware and vendor-independent software for routing protocols in wireless communication. Therefore, using the SDN approach to run, manage and optimize routing algorithms efficiently has become one of the important topics. The SDN also makes it possible to use machine learning techniques for routing. In this study, a new machine learning-assisted routing (MLaR) algorithm is proposed for software-defined wireless networks. Through the trained model, this algorithm can make the most appropriate routing decision in real-time by using the historical network parameters of mobile nodes (latency, bandwidth, SNR, distance). This way, a learning the proposed routing algorithm that can adjust itself according to dynamic network conditions has been developed. The proposed MLaR algorithm is compared with the traditional Dijkstra algorithm in terms of delay and throughput ratio, and the MLaR gives more successful results. According to the simulation results, the proposed approach achieved 3.1 and 1.3 times improvement in delay and throughput, respectively, compared to the traditional Dijkstra.