code: def tarjan(self):
          '''
          API: tarjan(self)
          Description:
          Implements Tarjan's algorithm for determining strongly connected set of
          nodes.
          Pre:
              self.graph_type should be DIRECTED_GRAPH.
          Post:
              Nodes will have 'component' attribute that will have component
              number as value. Changes 'index' attribute of nodes.
          '''
          index = 0
          component = 0
          q = []
          for n in self.get_node_list():
              if self.get_node_attr(n, 'index') is None:
                  index, component = self.strong_connect(q, n, index, componentf tarjan(self):
          '''
          API: tarjan(self)
          Description:
          Implements Tarjan's algorithm for determining strongly connected set of
          nodes.
          Pre:
              self.graph_type should be DIRECTED_GRAPH.
          Post:
              Nodes will have 'component' attribute that will have component
              number as value. Changes 'index' attribute of nodes.
          '''
          index = 0
          component = 0
          q = []
          for n in self.get_node_list():
              if self.get_node_attr(n, 'index') is None:
                  index, component = self.strong_connect(q, n, index, component)
docs: API: tarjan(self)
          Description:
          Implements Tarjan's algorithm for determining strongly connected set of
          nodes.
          Pre:
              self.graph_type should be DIRECTED_GRAPH.
          Post:
              Nodes will have 'component' attribute that will have component
              number as value. Changes 'index' attribute of nodes.