Next:
Up:
Previous:
BFS Data Structures
A node in a BF tree represents a vertex
pred
vertex
distance
visited
Use a queue to remember frontier of search
Note: Cormen et al.'s BFS algorithm uses
color
instead of
visited
.
Unvisited vertex: white
Discovered vertex: gray
Visited vertex: black
Next:
Up:
Previous: