CHAPTER 22

Graphs and Applications

 

Objectives

  • To model real-world problems using graphs and explain the Seven Bridges of Königsberg problem (§22.1).
  • To describe the graph terminologies: vertices, edges, simple graphs, weighted/unweighted graphs, and directed/undirected graphs (§22.2).
  • To represent vertices and edges using lists, adjacent matrices, and adjacent lists (§22.3).
  • To model graphs using the Graph class (§22.4).
  • To display graphs visually (§22.5).
  • To represent the traversal of a graph using the Tree class (§22.6).
  • To design and implement depth-first search (§22.7).
  • To solve the connected-circle problem using depth-first search (§22.8).
  • To design and implement breadth-first search (§22.9).
  • To solve the nine-tail problem using breadth-first ...

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.