



"""simple docstring"""






from typing import Any

import numpy as np






def 					snake_case__       (		__lowerCamelCase    :   np.ndarray     ):
			"""simple docstring"""
			return np.array_equal(lowerCAmelCase__							,		matrix.conjugate().T     )






def 					snake_case__       (		__lowerCamelCase    :   np.ndarray							,		__lowerCamelCase    :   np.ndarray     ):
			"""simple docstring"""
			lowerCamelCase__		:		Optional[int]		     =v.conjugate().T
			lowerCamelCase__		:		List[Any]		     =v_star.dot(lowerCAmelCase__     )
			assert isinstance(lowerCAmelCase__							,		np.ndarray     )
			return (v_star_dot.dot(lowerCAmelCase__     )) / (v_star.dot(lowerCAmelCase__     ))






def 					snake_case__       (		):
			"""simple docstring"""
			lowerCamelCase__		:		List[str]		     =np.array([[2, 2 + 1J, 4], [2 - 1J, 3, 1J], [4, -1J, 1]]     )
			lowerCamelCase__		:		Any		     =np.array([[1], [2], [3]]     )
			assert is_hermitian(lowerCAmelCase__     ), f'''{a} is not hermitian.'''
			print(rayleigh_quotient(lowerCAmelCase__							,		lowerCAmelCase__     )     )

			lowerCamelCase__		:		Tuple		     =np.array([[1, 2, 4], [2, 3, -1], [4, -1, 1]]     )
			assert is_hermitian(lowerCAmelCase__     ), f'''{a} is not hermitian.'''
			assert rayleigh_quotient(lowerCAmelCase__							,		lowerCAmelCase__     ) == float(3     )


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		tests()









"""simple docstring"""






def 					snake_case__       (		__lowerCamelCase    :   int     ):
			"""simple docstring"""
			lowerCamelCase__		:		List[Any]		     =[0] * len(__lowerCamelCase     )
			lowerCamelCase__		:		List[Any]		     =[]
			lowerCamelCase__		:		List[Any]		     =[1] * len(__lowerCamelCase     )

			for values in graph.values():
						for i in values:
									indegree[i] += 1

			for i in range(len(__lowerCamelCase     )     ):
						if indegree[i] == 0:
									queue.append(__lowerCamelCase     )

			while queue:
						lowerCamelCase__		:		Tuple		     =queue.pop(0     )
						for x in graph[vertex]:
									indegree[x] -= 1

									if long_dist[vertex] + 1 > long_dist[x]:
												lowerCamelCase__		:		Optional[Any]		     =long_dist[vertex] + 1

									if indegree[x] == 0:
												queue.append(__lowerCamelCase     )

			print(max(__lowerCamelCase     )     )


# Adjacency list of Graph
_lowercase			:			Optional[Any]										=						{0: [2, 3, 4], 1: [2, 7], 2: [5], 3: [5, 7], 4: [7], 5: [6], 6: [7], 7: []}

longest_distance(graph)




