Docs: Update Gemini benchmark results

This commit is contained in:
github-actions[bot]
2025-11-18 19:30:39 +00:00
parent 51a98c1e1b
commit 76fb066932
133 changed files with 2340 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
const findShortestPath = async (graph, start, end) => {
const { default: PQ } = await import('https://cdn.jsdelivr.net/npm/js-priority-queue/+esm')
const costs = { [start]: 0 }
const queue = new PQ({ comparator: (a, b) => a.cost - b.cost })
queue.queue({ node: start, cost: 0 })
while (queue.length) {
const { node, cost } = queue.dequeue()
if (node === end) return cost
if (cost > (costs[node] ?? Infinity)) continue
for (const [neighbor, weight] of Object.entries(graph[node] || {})) {
const nextCost = cost + weight
if (nextCost < (costs[neighbor] ?? Infinity)) {
costs[neighbor] = nextCost
queue.queue({ node: neighbor, cost: nextCost })
}
}
}
return Infinity
}
export default findShortestPath;