CHAPTER 23

Weighted Graphs and Applications

 

Objectives

  • To represent weighted edges using adjacency matrices and adjacency lists (§23.2).
  • To model weighted graphs using the WeightedGraph class that extends the Graph class (§23.3).
  • To design and implement the algorithm for finding a minimum spanning tree (§23.4).
  • To define the MST class that extends the Tree class (§23.4).
  • To design and implement the algorithm for finding single-source shortest paths (§23.5).
  • To define the ShortestPathTree class that extends the Tree class (§23.5).
  • To solve the weighted nine tails problem using the shortest-path algorithm (§23.6).

23.1 Introduction

images Key ...

Get Introduction to Python Programming and Data Structures, 3rd Edition by Pearson 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.