



def        __a			(   __lowerCAmelCase   )     ->     bool:
					SCREAMING_SNAKE_CASE							:     set[int]						=				set()
					# To detect a back edge, keep track of vertices currently in the recursion stack
					SCREAMING_SNAKE_CASE							:     set[int]						=				set()
					return any(
					    node not in visited and depth_first_search(__lowerCAmelCase      ,	__lowerCAmelCase      ,	__lowerCAmelCase      ,	__lowerCAmelCase   )
					    for node in graph   )

def        __a			(   __lowerCAmelCase      ,	__lowerCAmelCase      ,	__lowerCAmelCase      ,	__lowerCAmelCase   )     ->     bool:
					visited.add(__lowerCAmelCase   )
					rec_stk.add(__lowerCAmelCase   )

					for node in graph[vertex]:
										if node not in visited:
															if depth_first_search(__lowerCAmelCase      ,	__lowerCAmelCase      ,	__lowerCAmelCase      ,	__lowerCAmelCase   ):
																				return True
										elif node in rec_stk:
															return True

    # The node needs to be removed from recursion stack before function ends
					rec_stk.remove(__lowerCAmelCase   )
					return False


if __name__ == "__main__":
			from doctest import testmod

			testmod()




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()