



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


def A    (							__UpperCamelCase			,						__UpperCamelCase			,						__UpperCamelCase       )    ->   list[str]:
			A__	  =     set()
			# keep track of all the paths to be checked
			A__	  =     [[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
						A__	  =     queue.pop(0       )
						# get the last node from the path
						A__	  =     path[-1]
						if node not in explored:
									A__	  =     graph[node]
									# go through all neighbour nodes, construct a new path and
									# push it into the queue
									for neighbour in neighbours:
												A__	  =     list(__UpperCamelCase       )
												new_path.append(__UpperCamelCase       )
												queue.append(__UpperCamelCase       )
												# return path if neighbour is goal
												if neighbour == goal:
															return new_path

            # mark node as explored
									explored.add(__UpperCamelCase       )

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


def A    (							__UpperCamelCase			,						__UpperCamelCase			,						__UpperCamelCase       )    ->   int:
			if not graph or start not in graph or target not in graph:
						return -1
			if start == target:
						return 0
			A__	  =     [start]
			A__	  =     set(__UpperCamelCase       )
			# Keep tab on distances from `start` node.
			A__	  =     {start: 0, target: -1}
			while queue:
						A__	  =     queue.pop(0       )
						if node == target:
									A__	  =     (
									    dist[node] if dist[target] == -1 else min(dist[target]			,						dist[node]       )
									)
						for adjacent in graph[node]:
									if adjacent not in visited:
												visited.add(__UpperCamelCase       )
												queue.append(__UpperCamelCase       )
												A__	  =     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









from __future__ import annotations

import typing
from collections.abc import Iterable

import numpy as np

_lowerCamelCase    :		Dict		      =    typing.Union[Iterable[float], Iterable[int], np.ndarray]  # noqa: UP007
_lowerCamelCase    :		Any		      =    typing.Union[np.floataa, int, float]  # noqa: UP007

def        __a			(   __lowerCAmelCase      ,	__lowerCAmelCase   )     ->     VectorOut:
					return np.sqrt(np.sum((np.asarray(__lowerCAmelCase   ) - np.asarray(__lowerCAmelCase   )) ** 2   )   )

def        __a			(   __lowerCAmelCase      ,	__lowerCAmelCase   )     ->     VectorOut:
					return sum((va - va) ** 2 for va, va in zip(__lowerCAmelCase      ,	__lowerCAmelCase   )   ) ** (1 / 2)


if __name__ == "__main__":

			def        __a			(   )     ->     None:
								from timeit import timeit

								print('Without Numpy'   )
								print(
								    timeit(
								        'euclidean_distance_no_np([1, 2, 3], [4, 5, 6])'      ,	number=1_0000      ,	globals=globals()      ,	)   )
								print('With Numpy'   )
								print(
								    timeit(
								        'euclidean_distance([1, 2, 3], [4, 5, 6])'      ,	number=1_0000      ,	globals=globals()      ,	)   )



			benchmark()