We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0964561 commit 7cec6efCopy full SHA for 7cec6ef
src/algorithms/TravelingProblem.svelte
@@ -123,6 +123,8 @@
123
tspEdges = [...tspEdges];
124
weight = [];
125
weight = [...weight];
126
+ cities = [];
127
+ totalSteps.set(0);
128
currentCityIndex = null;
129
nextCityIndex = null;
130
unsub();
@@ -175,6 +177,8 @@
175
177
await delay(900 - get(speed) * 8);
176
178
if (!visited.has(i)) {
179
checkingEdge = { from: current, to: i };
180
+ currentCityIndex = current;
181
+ nextCityIndex = i;
182
log(`Távolság ellenőrzés: ${current} → ${i}`);
183
await pauseIfNeeded();
184
@@ -190,8 +194,6 @@
190
194
}
191
195
192
196
if (nearest !== null) {
193
- currentCityIndex = current;
- nextCityIndex = nearest;
197
198
activeLine.set(26);
199
log(`Lépés: ${current} → ${nearest}, távolság: ${minDist.toFixed(2)}`);
0 commit comments