docs: def simplex_find_cycle(self):
          '''
          API:
              simplex_find_cycle(self)
          Description:
              Returns a cycle (list of nodes) if the graph has one, returns None
              otherwise. Uses DFS. During DFS checks existence of arcs to lower
              depth regions. Note that direction of the arcs are not important.
          Return:
              Returns list of nodes that represents cycle. Returns None if the
              graph does not have any cycle.
          '''
          # make a dfs, if you identify an arc to a lower depth node we have a
          # cycle
          nl = self.get_node_list()
          q = [nl[0]]
          visited = []
          depth = {nl[0]:0}
          pred = {nl[0]:None}
          for n in nl:
              self.get_node(n).set_attr('component', None)
          component_nr = int(nl[0])
          self.get_node(nl[0]).set_attr('component', component_nr)
          while True:
              while q:
                  current = q.pop()
                  visited.append(current)
                  neighbors = self.in_neighbors[current] +\
                      self.neighbors[current]
                  for n in neighbors:
                      if n==pred[current]:
                          continue
                      self.get_node(n).set_attr('component', component_nr)
                      if n in depth:
                          # we have a cycle
                          cycle1 = []
                          cycle2 = []
                          temp = n
                          while temp is not None:
                              cycle1.append(temp)
                              temp = pred[temp]
                          temp = current
                          while temp is not None:
                              cycle2.append(temp)
                              temp = pred[temp]
                          cycle1.pop()
                          cycle1.reverse()
                          cycle2.extend(cycle1)
                          return cycle2
                      else:
                          pred[n] = current
                          depth[n] = depth[current] + 1
                      if n not in visited:
                          q.append(n)
              flag = False
              for n in nl:
                  if self.get_node(n).get_attr('component') is None:
                      q.append(n)
                      depth = {n:0}
                      pred = {n:None}
                      visited = []
                      component_nr = int(n)
                      self.get_node(n).set_attr('component', component_nr)
                      flag = True
                      break
              if not flag:
                  break
          return None