Computer Science
TSP Local Search Simulator
3/22/2026
TSP LOCAL SEARCH
Simulated Annealing
Iteration
0
Current Cost
629
Best Cost
629
Temperature
100.000
Parameters
CITIES
TEMP (Tβ)
COOLING
Β
COOLING SCHEDULE
T = T Γ rate. κ°μ₯ μΌλ°μ . μΌμ ν λΉμ¨λ‘ κ°μ ν©λλ€.
Current
cost=
629
Best Found
cost=
629
0 β 1 β 2 β 3 β 4 β 5 β 6 β 7 β 8 β 9 β 0
Transform Function
λλ€ν λ μμΉ μ¬μ΄ ꡬκ°μ λ€μ§μ΅λλ€. κ΅μ°¨νλ κ²½λ‘λ₯Ό νμ΄μ£Όλ λ° ν¨κ³Όμ μ λλ€.
transform(route, distances) β route
// 2-opt: λλ€ κ΅¬κ°μ λ€μ§μ΄ κ΅μ°¨ μ κ±°
const n = route.length;
const newRoute = [...route];
let i = Math.floor(Math.random() * n);
let j = Math.floor(Math.random() * n);
while (j === i) j = Math.floor(Math.random() * n);
let lo = Math.min(i, j);
let hi = Math.max(i, j);
while (lo < hi) {
[newRoute[lo], newRoute[hi]] = [newRoute[hi], newRoute[lo]];
lo++;
hi--;
}
return newRoute;