6. Graph Algorithms I

Learning Objectives

By the end of this chapter, you will be able to:

  • Describe the utility of graphs for solving various real-world problems
  • Choose and implement the right traversal method to find an element in a graph
  • Solve the minimum spanning tree (MST) problem using Prim's algorithm
  • Identify when to use the Prim's and Kruskal's algorithms to solve the MST problem
  • Find the shortest path between two vertices/nodes in a graph using Dijkstra's algorithm

In this chapter, we will study the basic and most commonly used algorithms for solving problems that can be represented in the form of graphs, which shall then be discussed further in the next chapter.

Introduction

In the previous two chapters, we discussed two ...

Get C++ Data Structures and Algorithm Design Principles now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.