Docs: Update benchmark results

This commit is contained in:
github-actions[bot]
2025-11-14 03:31:28 +00:00
parent 7052d4f4b5
commit 9a64997884
37 changed files with 656 additions and 390 deletions

View File

@@ -1,15 +1,15 @@
async function findShortestPath(graph, start, end) {
const { default: PQ } = await import('https://cdn.jsdelivr.net/npm/js-priority-queue@0.1.5/+esm');
const { default: PriorityQueue } = await import('https://cdn.jsdelivr.net/npm/js-priority-queue@0.1.5/+esm');
const distances = Object.keys(graph).reduce((acc, node) => ({ ...acc, [node]: Infinity }), {});
distances[start] = 0;
const pq = new PQ({ comparator: (a, b) => a.dist - b.dist });
const pq = new PriorityQueue({ comparator: (a, b) => a.dist - b.dist });
pq.queue({ node: start, dist: 0 });
const visited = new Set();
while (pq.length) {
while (pq.length > 0) {
const { node, dist } = pq.dequeue();
if (visited.has(node)) continue;