Docs: Update benchmark for openrouter/hunter-alpha

This commit is contained in:
github-actions[bot]
2026-03-11 21:27:35 +00:00
parent bfb7161cfd
commit bd43a83707
12 changed files with 409 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
async function findShortestPath(graph, start, end) {
const PriorityQueue = (await import('https://esm.sh/js-priority-queue@0.1.5')).default
const dist = Object.fromEntries(Object.keys(graph).map(n => [n, Infinity]))
const pq = new PriorityQueue({ comparator: (a, b) => a[1] - b[1] })
dist[start] = 0
pq.queue([start, 0])
while (pq.length) {
const [node, d] = pq.dequeue()
if (node === end) return d
if (d > dist[node]) continue
for (const [neigh, w] of Object.entries(graph[node])) {
const nd = d + w
if (nd < dist[neigh]) {
dist[neigh] = nd
pq.queue([neigh, nd])
}
}
}
return Infinity
}
export default findShortestPath;
// Generation time: 35.807s
// Result: PASS