docs: def simplex_search(self, source, component_nr):
          '''
          API:
              simplex_search(self, source, component_nr)
          Description:
              Searches graph starting from source. Its difference from usual
              search is we can also go backwards along an arc. When the graph
              is a spanning tree it computes predecessor, thread and depth
              indexes and stores them as node attributes. These values should be
              considered as junk when the graph is not a spanning tree.
          Input:
              source: source node
              component_nr: component number
          Post:
              (1) Sets the component number of all reachable nodes to component.
              Changes 'component' attribute of nodes.
              (2) Sets 'pred', 'thread' and 'depth' attributes of nodes. These
              values are junk if the graph is not a tree.
          Return:
              Returns predecessor dictionary.
          '''
          q = [source]
          pred = {source:None}
          depth = {source:0}
          sequence = []
          for n in self.neighbors:
              self.get_node(n).set_attr('component', None)
          while q:
              current = q.pop()
              self.get_node(current).set_attr('component', component_nr)
              sequence.append(current)
              neighbors = self.in_neighbors[current] + self.neighbors[current]
              for n in neighbors:
                  if n in pred:
                      continue
                  self.get_node(n).set_attr('component', component_nr)
                  pred[n] = current
                  depth[n] = depth[current]+1
                  q.append(n)
          for i in range(len(sequence)-1):
              self.get_node(sequence[i]).set_attr('thread', int(sequence[i+1]))
          self.get_node(sequence[-1]).set_attr('thread', int(sequence[0]))
          for n in pred:
              self.get_node(n).set_attr('pred', pred[n])
              self.get_node(n).set_attr('depth', depth[n])
          return pred