Skip to Main Content
Beginning Java Data Structures and Algorithms
book

Beginning Java Data Structures and Algorithms

by James Cutajar
July 2018
Beginner content levelBeginner
202 pages
5h 4m
English
Packt Publishing
Content preview from Beginning Java Data Structures and Algorithms

Breadth-First Search

Given a graph G = (V, E) and a source vertex s, breadth-first search explores the edges of G systematically to discover every vertex that is reachable from s. While doing so, it computes the smallest number of edges from s to each reachable vertex, making it suitable to solve the single-source shortest path problem on unweighted graphs, or graphs whose edges all have the same weight.

Breadth-First Search (BFS) is named so because it expands the frontier between discovered and undiscovered vertices uniformly across the breadth of the frontier. In that sense, the algorithm first explores vertices at distance k from s before discovering vertices at distance k + 1. To keep track of progress, breadth-first search identifies ...

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

Java 9 Data Structures and Algorithms

Java 9 Data Structures and Algorithms

Debasish Ray Chawdhuri
Object-Oriented Data Structures Using Java, 4th Edition

Object-Oriented Data Structures Using Java, 4th Edition

Nell Dale, Daniel T. Joyce, Chip Weems

Publisher Resources

ISBN: 9781789537178Supplemental Content