mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-06-28 04:12:13 +00:00
Docs: Update benchmark for z-ai/glm-5.2
This commit is contained in:
24
tests/1_dijkstra/outputs/z-ai_glm-5.2.js
Normal file
24
tests/1_dijkstra/outputs/z-ai_glm-5.2.js
Normal file
@@ -0,0 +1,24 @@
|
||||
async function findShortestPath(g, s, e) {
|
||||
const { default: PQ } = await import('https://esm.sh/js-priority-queue');
|
||||
const d = { [s]: 0 };
|
||||
const q = new PQ({ comparator: (a, b) => a.p - b.p });
|
||||
q.queue({ n: s, p: 0 });
|
||||
|
||||
while (q.length) {
|
||||
const { n, p } = q.dequeue();
|
||||
if (n === e) return p;
|
||||
if (p > (d[n] ?? Infinity)) continue;
|
||||
|
||||
for (const m in g[n]) {
|
||||
const w = p + g[n][m];
|
||||
if (w < (d[m] ?? Infinity)) {
|
||||
d[m] = w;
|
||||
q.queue({ n: m, p: w });
|
||||
}
|
||||
}
|
||||
}
|
||||
return Infinity;
|
||||
}
|
||||
export default findShortestPath;
|
||||
// Generation time: 45.601s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user