mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-03-17 03:11:01 +00:00
Docs: Update benchmark for google/gemini-3.1-pro-preview
This commit is contained in:
27
tests/1_dijkstra/outputs/google_gemini-3.1-pro-preview.js
Normal file
27
tests/1_dijkstra/outputs/google_gemini-3.1-pro-preview.js
Normal file
@@ -0,0 +1,27 @@
|
||||
export const findShortestPath = async (g, s, e) => {
|
||||
const { default: PQ } = await import("https://esm.sh/js-priority-queue");
|
||||
const q = new PQ({ comparator: (a, b) => a[1] - b[1] });
|
||||
const d = { [s]: 0 };
|
||||
|
||||
q.queue([s, 0]);
|
||||
|
||||
while (q.length) {
|
||||
const [u, w] = q.dequeue();
|
||||
|
||||
if (u === e) return w;
|
||||
if (w > d[u]) continue;
|
||||
|
||||
for (const [v, c] of Object.entries(g[u] ?? {})) {
|
||||
const a = w + c;
|
||||
if (a < (d[v] ?? Infinity)) {
|
||||
d[v] = a;
|
||||
q.queue([v, a]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Infinity;
|
||||
};
|
||||
export default findShortestPath;
|
||||
// Generation time: 19.792s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user