Breadth First Search (BFS) algorithm traverses a graph in a breadthward motion and uses a queue to remember to get the next vertex to start a search, when a dead end occurs in any iteration. he only catch here is, that, unlike trees, graphs may contain cycles, so we may…