This invention provides a dynamic topology and path optimization method for unmanned cluster ad hoc networks. It constructs a
communication bandwidth requirement matrix and a
distance matrix; designs a cost function based on distance,
bandwidth requirement, and path hop count; establishes a fully connected communication topology matrix; and uses a shortest path
algorithm, based on the cost function, to find the
minimum cost path for each pair of nodes with communication needs. Based on all the obtained minimum cost paths, it constructs the optimal ad hoc
network topology. By designing a precise cost function and combining it with Dijkstra's
algorithm, it achieves efficient optimization of communication paths while simultaneously constructing the optimal ad hoc
network topology, minimizing the communication cost function. The multi-factor
coupling design of the cost function makes the path optimization results more accurate and adaptable to dynamically changing cluster environments. The combination with Dijkstra's
algorithm enables efficient
path search, making it suitable for medium- to large-scale unmanned clusters.