The present invention provides a method for obtaining an optimal path of optical resources based on an improved
ant colony
algorithm, which specifically comprises the following steps: S1: constructing an authorized
undirected graph G=(V, E) according to an optical
resource network, wherein V is a set of nodes of the
undirected graph, and the nodes include a starting point node, a destination point node and a topology
graph node of a plurality of optical cross boxes corresponding to the optical
resource network, and E is a set of arcs of the
undirected graph, representing an optical cable connected between two nodes; S2: utilizing an improved
ant colony
algorithm based on the Metropolis criterion to search and calculate on the undirected graph G to obtain a plurality of current
ant colony optimal paths and corresponding target fitness values, and simultaneously updating the
pheromone of the current
ant colony optimal path; S3: selecting different half-distance cross optimization strategies to optimize the current
ant colony optimal path, obtaining optimized optimal paths focusing on different optimization types and corresponding minimum target fitness values, and simultaneously updating the
pheromone of the optimized optimal path.