This paper proposes an improved Sparrow Optimization Algorithm (ISOA) for optimizing the deployment of gateway nodes in wireless mesh networks (WMNs). The objective of this research is to minimize the number of gateways while maximizing the network throughput, minimizing network latency, and ensuring maximum coverage and connectivity for all nodes in the network. The proposed algorithm combines the foraging behavior and information exchange mechanisms of sparrows with the design of the objective function and constraints, resulting in an efficient and effective strategy for gateway node deployment. This paper provides a detailed explanation of the algorithm's improvement principles, implementation steps, performance evaluation, and experimental results. Comparative experiments and performance analysis are conducted to validate the superiority and effectiveness of the algorithm in addressing the optimization deployment problem of gateway nodes in wireless mesh networks.