(The topology structure of mobile ad hoc network is analyzed, and its routing network model is built. Combining the basic principle of genetic algorithm and the routing model of mobile ad hoc, an algorithm for solving the optimal path of wireless network is proposed. This method selects variable length chromosome coding and uses genetic algorithm to optimize the route, which can find the optimal route under the condition that the minimum system expenditure is satisfied.)