⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 20m 23s17 days 22 hours 20 minutes 23 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 20m 23s17 days 22 hours 20 minutes 23 seconds.

Sign in to watch this lesson
Algorithms - Graphs II · 4:38
When links have latencies instead of equal costs, hop counting fails, and Dijkstra's algorithm finds the lowest-latency route from one gateway to all others: repeatedly mark the unmarked vertex with the smallest label and relax its edges. We run it on a five-gateway graph (distances 0 3 1 4 7, route 0 2 1 3 4), prove each label is final when marked with the frontier-wall argument, implement the dense O(n^2 + m) version that is optimal when m is close to n^2, and break it with a single negative rebate link.