rule visit the next unvisited vertex (if there is onethat' adjacent to the current vertexmark itand insert it into the queue remember rule if you can' carry out rule because there are no more unvisited verticesremove vertex from the queue (if possibleand make it the current vertex remember rule if you can' carry out rule because the queue is emptyyou're finished thus you first visit all the vertices adjacent to ainserting each one into the queue as you visit it now you've visited abcdand at this point the queue (from front to rearcontains bcde there are no more unvisited vertices adjacent to aso you remove from the queue and look for vertices adjacent to bso you remove from the queue it has no adjacent unvisited adjacent verticesso you remove and visit has no more adjacent unvisited verticesso you remove now the queue is fg you remove and visit hand then you remove and visit now the queue is hibut when you've removed each of these and found no adjacent unvisited verticesthe queue is emptyso you're finished table shows this sequence table queue contents during breadth-first search event queue (front to rearvisit visit visit bc visit bcd visit bcde remove cde visit cdef remove def remove ef visit efg