广度优先 Given a graph G=(V,E)and a distinguished source vertex s,breadth-first search systematically explores the edges of Gto"discover"every vertex that is reachable from s.It computes the distance (smallest number of edges)from s to each reachable vertex.It also produces a"breadth-first tree"with root s that contains all reachable vertices.For any vertexrechable froms,the simple path in the breadth-first tree from s to corresponds to a"shortest path"from s tov in G,that is,a path containing the smallest number of edges.The algorithm works on both directed and undirected graphs. 两个关键的动词广度优先 两个关键的动词