Bellman-Ford works well but it takes too long and your graph can't have cycles. Dijkstra solved this problem with an elegant solution.

LESSON 24 OF 34 · IN THE FULL COURSE
This one's part of the full course
Good to see you. This one's in the full course
8 lessons are free to watch right now, no account needed. If they click, grab the course and every lesson is yours to keep.
You've seen how I teach. The other 26 lessons are in the full course, and your progress comes with you.
WATCH THESE FREE, NO ACCOUNT NEEDEDYOUR FREE LESSONS
Already bought it? Log in and it picks up right here.
Your progress comes with you the moment you buy.
Data Structures and Algorithms · LESSON 24
Graph Traversal: Dijkstra
THE COURSE, END TO ENDNow playingDoneAheadYou are hereFree to watchIn the full course
34lessons across 8 sections
8free to watch right now
Foreverbuy it once, it's yours for life
