Skip to Main Content
Graph Algorithms the Fun Way
book

Graph Algorithms the Fun Way

by Jeremy Kubica
November 2024
Intermediate to advanced content levelIntermediate to advanced
416 pages
11h 11m
English
No Starch Press
Content preview from Graph Algorithms the Fun Way

7 SHORTEST PATHS

The problem of finding the lowest-cost path through a graph, as measured by the sum of edge weights along the path, is naturally analogous to a range of real-world path planning and optimization tasks. For example, we may be interested in routing trucks between two cities such that we minimize the total cost of fuel. In this chapter, we consider algorithms to find paths with the minimum cost starting at a given origin.

While the problem of finding these paths is often called the shortest-path problem, it is more accurate to think of it in terms of lowest-cost path, since a path’s cost is not always a function of distance. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Grokking Algorithms, Second Edition

Grokking Algorithms, Second Edition

Aditya Bhargava
Grokking Algorithms

Grokking Algorithms

Aditya Bhargava
Algorithms: 24-part Lecture Series

Algorithms: 24-part Lecture Series

Robert Sedgewick, Kevin Wayne

Publisher Resources

ISBN: 9781098182519Errata Page