From 6c0f3f8e8cab967ce095a3ce344c3812eded063b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Jul 2026 18:39:44 +0000 Subject: [PATCH] Docs: Update benchmark for moonshotai/kimi-k3 EFF:medium test 1 --- .../outputs/moonshotai_kimi-k3 EFF_medium.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/1_dijkstra/outputs/moonshotai_kimi-k3 EFF_medium.js diff --git a/tests/1_dijkstra/outputs/moonshotai_kimi-k3 EFF_medium.js b/tests/1_dijkstra/outputs/moonshotai_kimi-k3 EFF_medium.js new file mode 100644 index 0000000..b84f179 --- /dev/null +++ b/tests/1_dijkstra/outputs/moonshotai_kimi-k3 EFF_medium.js @@ -0,0 +1,29 @@ +let pqLib; + +const loadPriorityQueue = () => + pqLib ??= import('https://esm.sh/js-priority-queue@0.1.5') + .catch(() => import('https://cdn.jsdelivr.net/npm/js-priority-queue@0.1.5/+esm')); + +async function findShortestPath(graph, start, end) { + const { default: PriorityQueue } = await loadPriorityQueue(); + const dist = new Map([[start, 0]]); + const heap = new PriorityQueue({ comparator: (a, b) => a[1] - b[1] }); + heap.queue([start, 0]); + + while (heap.length) { + const [node, d] = heap.dequeue(); + if (node === end) return d; + if (d > (dist.get(node) ?? Infinity)) continue; + for (const [next, w] of Object.entries(graph[node] ?? {})) { + const nd = d + w; + if (nd < (dist.get(next) ?? Infinity)) { + dist.set(next, nd); + heap.queue([next, nd]); + } + } + } + return Infinity; +} +export default findShortestPath; +// Generation time: 122.554s +// Result: PASS \ No newline at end of file