Delete: Old generated file format

This commit is contained in:
2025-10-13 10:24:30 -07:00
parent 7c950bf7e9
commit eb61775ecf

View File

@@ -1 +0,0 @@
const findShortestPath = async (graph, startNode, endNode) => { const { default: PriorityQueue } = await import('https://cdn.jsdelivr.net/npm/js-priority-queue@0.1.5/priority-queue.min.js'); const distances = Object.keys(graph).reduce((acc, node) => (acc[node] = Infinity, acc), {}); const pq = new PriorityQueue({ comparator: (a, b) => a[1] - b[1] }); distances[startNode] = 0; pq.queue([startNode, 0]); while (pq.length) { const [currentNode, currentDist] = pq.dequeue(); if (currentDist > distances[currentNode]) continue; if (currentNode === endNode) return currentDist; for (const neighbor in graph[currentNode] || {}) { const newDist = currentDist + graph[currentNode][neighbor]; if (newDist < distances[neighbor]) { distances[neighbor] = newDist; pq.queue([neighbor, newDist]); } } } return distances[endNode]; };