Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.
Fun, engaging games to boost memory, math fluency, typing speed, and English skills—perfect for learners of all ages.
This chapter discusses the Breadth First Search (BFS) algorithm for exploring graphs, emphasizing the methods for systematically finding paths between vertices. It explains the representation of graphs, the data structures used in BFS, and the way BFS operates, including complexities and how to track the shortest path between nodes. BFS is shown to efficiently explore graphs while providing distance information when needed.
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
References
ch20.pdfClass Notes
Memorization
What we have learnt
Final Test
Revision Tests
Term: Graph
Definition: A collection of vertices and edges representing connections.
Term: Breadth First Search (BFS)
Definition: An algorithm for traversing or searching tree or graph data structures, exploring all neighbors at the present depth prior to moving on to vertices at the next depth level.
Term: Adjacency Matrix
Definition: A square matrix used to represent a finite graph, where the elements indicate whether pairs of vertices are adjacent or not.
Term: Adjacency List
Definition: A collection of lists or arrays that represent which vertices are adjacent to each vertex.
Term: Queue
Definition: A data structure used in BFS to keep track of the vertices that need to be explored.
Term: Path Reconstruction
Definition: The process of determining the route taken to reach a specific vertex in a graph, often achieved by keeping track of parent vertices.