O'Reilly logo

Grokking Algorithms: An illustrated guide for programmers and other curious people by Aditya Y. Bhargava

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Dijkstra’s algorithm

In this chapter

  • We continue the discussion of graphs, and you learn about weighted graphs: a way to assign more or less weight to some edges.
  • You learn Dijkstra’s algorithm, which lets you answer “What’s the shortest path to X?” for weighted graphs.
  • You learn about cycles in graphs, where Dijkstra’s algorithm doesn’t work.

In the last chapter, you figured out a way to get from point A to point B.

It’s not necessarily the fastest path. It’s the shortest path, because it has the least number of segments (three ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required