docs: def fifo_label_correcting(self, source):
          '''
          API:
              fifo_label_correcting(self, source)
          Description:
              finds shortest path from source to every other node. Returns
              predecessor dictionary. If graph has a negative cycle, detects it
              and returns to it.
          Pre:
              (1) 'cost' attribute of arcs. It will be used to compute shortest
              path.
          Input:
              source: source node
          Post:
              Modifies 'distance' attribute of nodes.
          Return:
              If there is no negative cycle returns to (True, pred), otherwise
              returns to (False, cycle) where pred is the predecessor dictionary
              and cycle is a list of nodes that represents cycle. It is in
              [n_1, n_2, ..., n_k] form where the cycle has k nodes.
          '''
          pred = {}
          self.get_node(source).set_attr('distance', 0)
          pred[source] = None
          for n in self.neighbors:
              if n!=source:
                  self.get_node(n).set_attr('distance', 'inf')
          q = [source]
          while q:
              i = q[0]
              q = q[1:]
              for j in self.neighbors[i]:
                  distance_j = self.get_node(j).get_attr('distance')
                  distance_i = self.get_node(i).get_attr('distance')
                  c_ij = self.get_edge_attr(i, j, 'cost')
                  if distance_j > distance_i + c_ij:
                      self.get_node(j).set_attr('distance', distance_i+c_ij)
                      if j in pred:
                          pred[j] = i
                          cycle = self.label_correcting_check_cycle(j, pred)
                          if cycle is not None:
                              return (False, cycle)
                      else:
                          pred[j] = i
                      if j not in q:
                          q.append(j)
          return (True, pred)