This commit is contained in:
Sven Weidauer 2024-12-25 12:45:19 +01:00
parent 97fa4abec0
commit 6dba16a6fd
2 changed files with 1 additions and 3 deletions

View file

@ -16,7 +16,7 @@ fun <T> dijkstra(start: T, goal: (T) -> Boolean, neighbors: (T) -> Sequence<Pair
visited.add(start)
for ((neighbor, distance) in neighbors(current)) {
if (neighbor in visited) continue;
if (neighbor in visited) continue
val newDistance = totalDistance + distance

View file

@ -1,5 +1,3 @@
import java.util.PriorityQueue
data class Position(val coordinate: Grid.Coordinate, val direction: Direction)
fun main() {