original_docstring: Assumes graph is a Digraph; start and end are nodes;
      path and shortest are lists of nodes
      Returns a shortest path from start to end in graph
docstring: Assumes graph is a Digraph; start and end are nodes;
  path and shortest are lists of nodes
  Returns a shortest path from start to end in graph
docstring_tokens: Assumes graph is a Digraph ; start and end are nodes ; path and shortest are lists of nodes Returns a shortest path from start to end in graph
code: def DFS(graph, start, end, path, shortest): #depth-first-search
      """Assumes graph is a Digraph; start and end are nodes;
      path and shortest are lists of nodes
      Returns a shortest path from start to end in graph"""
      path =(path + [start]) #lets begin
      print ('Current DFS path:', printPath(path))
      if start == end: #first and last node are same
          return path
      for node in graph.childrenOf(start): #for each node go to child
          if node not in path: #avoid cycles, ie. if the node is not in path then don't go there??
              if shortest == None or len(path) < len(shortest):
                  newPath = DFS(graph, node, end, path, shortest) #recursion at work
                  if newPath != None:
                      shortest = newPath
      return shortest
code_tokens: def DFS ( graph , start , end , path , shortest ) : path = ( path + [ start ] ) print ( 'Current DFS path:' , printPath ( path ) ) if start == end : return path for node in graph . childrenOf ( start ) : if node not in path : if shortest == None or len ( path ) < len ( shortest ) : newPath = DFS ( graph , node , end , path , shortest ) if newPath != None : shortest = newPath return shortest
short_docstring: Assumes graph is a Digraph; start and end are nodes;
  path and shortest are lists of nodes
  Returns a shortest path from start to end in graph
short_docstring_tokens: Assumes graph is a Digraph ; start and end are nodes ; path and shortest are lists of nodes Returns a shortest path from start to end in graph
comment: #depth-first-search
  $SEP$"""Assumes graph is a Digraph; start and end are nodes;
      path and shortest are lists of nodes
      Returns a shortest path from start to end in graph"""$SEP$#lets begin
  $SEP$#first and last node are same
  $SEP$#for each node go to child
  $SEP$#avoid cycles, ie. if the node is not in path then don't go there??
  $SEP$#recursion at work
  