mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-04-27 19:52:14 +00:00
Docs: Update benchmark for moonshotai/kimi-k2.6
This commit is contained in:
22
tests/1_dijkstra/outputs/moonshotai_kimi-k2.6.js
Normal file
22
tests/1_dijkstra/outputs/moonshotai_kimi-k2.6.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const findShortestPath = async (g, s, e) => {
|
||||
const { default: P } = await import('https://esm.sh/js-priority-queue');
|
||||
const q = new P({ comparator: (a, b) => a.d - b.d });
|
||||
const dist = { [s]: 0 };
|
||||
q.queue({ u: s, d: 0 });
|
||||
while (q.length) {
|
||||
const { u, d: du } = q.dequeue();
|
||||
if (du > dist[u]) continue;
|
||||
if (u === e) return du;
|
||||
for (const [v, w] of Object.entries(g[u] ?? {})) {
|
||||
const alt = du + w;
|
||||
if (alt < (dist[v] ?? Infinity)) {
|
||||
dist[v] = alt;
|
||||
q.queue({ u: v, d: alt });
|
||||
}
|
||||
}
|
||||
}
|
||||
return dist[e] ?? Infinity;
|
||||
};
|
||||
export default findShortestPath;
|
||||
// Generation time: 152.935s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user