






"""simple docstring"""




def        lowerCAmelCase (      UpperCamelCase_:							Any	)       ->							Any:







  '''simple docstring'''







  _a							=	[0] * len(UpperCamelCase_	)
  _a							=	[]
  _a							=	[1] * len(UpperCamelCase_	)

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

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

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

      if long_dist[vertex] + 1 > long_dist[x]:
        _a							=	long_dist[vertex] + 1

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

  print(max(UpperCamelCase_	)	)


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




longest_distance(graph)










"""simple docstring"""




from ..utils import DummyObject, requires_backends




class    lowercase_    (metaclass=_UpperCAmelCase     ):
      A__	:		Any       			=				['''torch''', '''torchsde''']






      def __init__(    self     ,     *a_     ,     **a_	)	->Optional[int]:







        '''simple docstring'''


        requires_backends(self     ,     ["torch", "torchsde"]	)






      @classmethod
      def 			lowerCamelCase__    (    cls     ,     *a_     ,     **a_	)	->List[Any]:







        '''simple docstring'''


        requires_backends(cls     ,     ["torch", "torchsde"]	)






      @classmethod
      def 			lowerCamelCase__    (    cls     ,     *a_     ,     **a_	)	->str:







        '''simple docstring'''


        requires_backends(cls     ,     ["torch", "torchsde"]	)


