






lowerCamelCase	:							str				={
    '''A''': ['''B''', '''C''', '''E'''],
    '''B''': ['''A''', '''D''', '''E'''],
    '''C''': ['''A''', '''F''', '''G'''],
    '''D''': ['''B'''],
    '''E''': ['''A''', '''B''', '''D'''],
    '''F''': ['''C'''],
    '''G''': ['''C'''],
}







def 		SCREAMING_SNAKE_CASE							(					__lowerCAmelCase					,    __lowerCAmelCase					,    __lowerCAmelCase			) ->	list[str]:
     UpperCamelCase__			:   Union[str, Any]       				=  set()
     # keep track of all the paths to be checked
     UpperCamelCase__			:   List[str]       				=  [[start]]

     # return path if start is goal
     if start == goal:
          return [start]

     # keeps looping until all possible paths have been checked
     while queue:
          # pop the first path from the queue
          UpperCamelCase__			:   int       				=  queue.pop(0			)
          # get the last node from the path
          UpperCamelCase__			:   Dict       				=  path[-1]
          if node not in explored:
               UpperCamelCase__			:   str       				=  graph[node]
               # go through all neighbour nodes, construct a new path and
               # push it into the queue
               for neighbour in neighbours:
                    UpperCamelCase__			:   str       				=  list(__lowerCAmelCase			)
                    new_path.append(__lowerCAmelCase			)
                    queue.append(__lowerCAmelCase			)
                    # return path if neighbour is goal
                    if neighbour == goal:
                         return new_path

            # mark node as explored
               explored.add(__lowerCAmelCase			)

    # in case there's no path between the 2 nodes
     return []







def 		SCREAMING_SNAKE_CASE							(					__lowerCAmelCase					,    __lowerCAmelCase					,    __lowerCAmelCase			) ->	int:
     if not graph or start not in graph or target not in graph:
          return -1
     if start == target:
          return 0
     UpperCamelCase__			:   List[str]       				=  [start]
     UpperCamelCase__			:   List[Any]       				=  set(__lowerCAmelCase			)
     # Keep tab on distances from `start` node.
     UpperCamelCase__			:   str       				=  {start: 0, target: -1}
     while queue:
          UpperCamelCase__			:   Tuple       				=  queue.pop(0			)
          if node == target:
               UpperCamelCase__			:   Optional[int]       				=  (
                   dist[node] if dist[target] == -1 else min(dist[target]					,    dist[node]			)
               )
          for adjacent in graph[node]:
               if adjacent not in visited:
                    visited.add(__lowerCAmelCase			)
                    queue.append(__lowerCAmelCase			)
                    UpperCamelCase__			:   List[str]       				=  dist[node] + 1
     return dist[target]


if __name__ == "__main__":
 print(bfs_shortest_path(demo_graph, '''G''', '''D'''))  # returns ['G', 'C', 'A', 'B', 'D']
 print(bfs_shortest_path_distance(demo_graph, '''G''', '''D'''))  # returns 4







import numpy as np







def 		SCREAMING_SNAKE_CASE							(					__lowerCAmelCase			) ->	np.array:
     return 1 / (1 + np.exp(-vector			))







def 		SCREAMING_SNAKE_CASE							(					__lowerCAmelCase			) ->	np.array:
     return vector * sigmoid(1.7_0_2 * vector			)


if __name__ == "__main__":
 import doctest

 doctest.testmod()