$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · hard · #291

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: < (also accepted: <)

An edge is relaxed only when it strictly improves the best known distance to v.
Play Problem Solving ▸