BFS (breadth-first search) BFS

  • BFS (breadth-first search) BFS:
  1. The shortest path algorithm to solve the problem is called breadth-first search.
  2. You can answer two types of questions:
  3. From there a path to a node node b do
  4. Starting that path shortest travel from node a node b
  5. Run time O (V + E) V is the number of vertices, E is the number of edges

Guess you like

Origin www.cnblogs.com/jsersudo/p/11764424.html