2-opt is a local search algorithm commonly used to optimize routes in the field of combinatorial optimization, particularly in solving the traveling salesman problem (TSP) and related routing problems. The basic idea of 2-opt is to improve a given tour (or route) by iteratively removing two edges and reconnecting the two segments in a way that results in a shorter total distance.

New to topics? Read the docs here!