Implement a breadth-first search on a graph and explain how you would use it to find the shortest path in an unweighted graph.