Skip to content

Commit 7cec6ef

Browse files
committed
minor fixes
1 parent 0964561 commit 7cec6ef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/algorithms/TravelingProblem.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@
123123
tspEdges = [...tspEdges];
124124
weight = [];
125125
weight = [...weight];
126+
cities = [];
127+
totalSteps.set(0);
126128
currentCityIndex = null;
127129
nextCityIndex = null;
128130
unsub();
@@ -175,6 +177,8 @@
175177
await delay(900 - get(speed) * 8);
176178
if (!visited.has(i)) {
177179
checkingEdge = { from: current, to: i };
180+
currentCityIndex = current;
181+
nextCityIndex = i;
178182
log(`Távolság ellenőrzés: ${current} → ${i}`);
179183
await pauseIfNeeded();
180184
await delay(900 - get(speed) * 8);
@@ -190,8 +194,6 @@
190194
}
191195
192196
if (nearest !== null) {
193-
currentCityIndex = current;
194-
nextCityIndex = nearest;
195197
196198
activeLine.set(26);
197199
log(`Lépés: ${current} → ${nearest}, távolság: ${minDist.toFixed(2)}`);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy