File size: 800 Bytes
b27bfb3 | 1 2 3 4 5 | {"type": "session", "harness": "opencode", "id": "math-0156", "name": "Dijkstra Variants and Optimizations"}
{"type": "message", "message": {"role": "system", "content": "You are an expert mathematician and programmer."}}
{"type": "message", "message": {"role": "user", "content": "Explain Dijkstra variants"}}
{"type": "message", "message": {"role": "assistant", "content": "Standard: min-heap O((V+E) log V). Lazy deletion: skip stale entries.\n0-1 BFS: deque for weights {0,1}. O(V+E). Front for 0-weight, back for 1-weight.\nDial's: integer weights [0,W]. Bucket array. O(V+E+W).\nState-space: dist[node][state] when node alone isn't enough (e.g., k free edges used).\nMulti-source: push all sources, find nearest source per node.\nNegative weights: use Bellman-Ford/SPFA, never Dijkstra."}}
|