UNPKG

lin-kernighan

Version:

Adaptive k-opt heuristic improving TSP tours by swapping edges to shorten routes.

10 lines (9 loc) 388 B
import { Point } from "haversine-matrix"; /** * Solves the Traveling Salesman Problem using the Lin-Kernighan algorithm. * Takes geographic coordinates and returns an optimized tour order. * @param points Array of geographic points with latitude and longitude * @returns Array of points in optimized tour order */ declare const tsp: (points: Point[]) => Point[]; export default tsp;