What goes in the blank?
# Dijkstra: relax edge u -> v of weight w
if d + w ____ dist[v]:
dist[v] = d + w
heapq.heappush(pq, (dist[v], v))
Answer: <
An edge is relaxed only when it strictly improves the best known distance to v.
Play Problem Solving ▸