ADD: Implementation of the breadth first search algorithm