Find a shortest path and its length by Moore’s BFS algorithm, assuming

Find a shortest path and its length by Moore’s BFS algorithm, assuming that all the edges have length 1.

PROBLEM SET 23.3: