Virtual Vocations can model relationships between job-search resources as a graph. Given an unweighted graph and a starting resource, return the order in which a breadth-first search visits every reachable node.
The graph is represented as a dictionary. Each key is a node, and its value is a list of adjacent nodes in the required visit order. The graph may contain cycles, self-loops, nodes with no outgoing edges, and references to nodes that do not appear as dictionary keys. Visit each reachable node at most once. When multiple neighbors are available, process them in the order provided by their adjacency list.
Implement bfs_traversal(graph, start).
graph, a dictionary whose keys and adjacency-list values are node labels, and start, a node label.start, in BFS order.start is not a key in graph, return [start], because the starting node is still considered visited.def bfs_traversal(graph, start):