There are two sample graphs attached (size 100 and 200 vertices). Use the Breadth First Search (BFS) algorithm to create the adjacency list first. Print out the adjacency list in the following format (without any extra space, exactly in the format below): v1-vx,vy .... v2-vn-
Print out the list of the nodes that you traverse through starting from vertex zero and last (two traversals). Keep the output format as follows (without any extra space): v1, v2, v3, ...., vn. This format helps the grader develop a grading code to automatically check. Find and print out the node count (or vertex count plus edge counts) of these two graphs. The programming language is Java or Python (please consult TA/Grader for exceptions).
Hint: BFS Pseudocode:
BFS(G,5)
G: adj: list Adj
for each vertex u (except s) do
dfu = color-white
dls = D
color = gray
Q = < 5 >D
Q is a FIFO queue
Q holds discovered but unfinished vertices
while Q is not an EmptyQueue do
remove(Q) remove the head
for each v in Adjlu do
if dfv = 0 then
test ensures that node 10 dlv = dlu + color-gray
enqueue(v) is enqueued at most once