Skip to content

Files

Latest commit

b40ec24 · Mar 17, 2019

History

History

Breadth-first search (BFS)

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 16, 2019
Mar 17, 2019

Breadth-first search (BFS)

Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures. It starts at the tree root (or some arbitrary node of a graph) and explores the neighbor nodes first, before moving to the next level neighbors.

Variables

  • n : Number of nodes in graph
  • m : Number of edges in graph

Parameters

  • start : Starting node (Source node)

Results

  • dist : Array of minimum distances from source node to the others.
  • parent : Array of parents for the shortest path between source node and target node.