original_docstring: Assumes graph is a Digraph; start and end are nodes
      Returns a shortest path from start to end in graph
docstring: Assumes graph is a Digraph; start and end are nodes
  Returns a shortest path from start to end in graph
docstring_tokens: Assumes graph is a Digraph ; start and end are nodes Returns a shortest path from start to end in graph
code: def BFS(graph, start, end):
      """Assumes graph is a Digraph; start and end are nodes
      Returns a shortest path from start to end in graph"""
      initPath = [start]
      pathQueue = [initPath]
      while len(pathQueue) != 0:
          #Get and remove oldest element in pathQueue
          tmpPath = pathQueue.pop(0)
          print('Current BFS path:', printPath(tmpPath))
          lastNode = tmpPath[-1]
          if lastNode == end:
              return tmpPath
          for nextNode in graph.childrenOf(lastNode):
              if nextNode not in tmpPath:
                  newPath = tmpPath + [nextNode]
                  pathQueue.append(newPath)
      return None
code_tokens: def BFS ( graph , start , end ) : initPath = [ start ] pathQueue = [ initPath ] while len ( pathQueue ) != 0 : tmpPath = pathQueue . pop ( 0 ) print ( 'Current BFS path:' , printPath ( tmpPath ) ) lastNode = tmpPath [ - 1 ] if lastNode == end : return tmpPath for nextNode in graph . childrenOf ( lastNode ) : if nextNode not in tmpPath : newPath = tmpPath + [ nextNode ] pathQueue . append ( newPath ) return None
short_docstring: Assumes graph is a Digraph; start and end are nodes
  Returns a shortest path from start to end in graph
short_docstring_tokens: Assumes graph is a Digraph ; start and end are nodes Returns a shortest path from start to end in graph
comment: """Assumes graph is a Digraph; start and end are nodes
      Returns a shortest path from start to end in graph"""$SEP$#Get and remove oldest element in pathQueue
  