docs: def simplex_determine_leaving_arc(self, t, k, l):
          '''
          API:
              simplex_determine_leaving_arc(self, t, k, l)
          Description:
              Determines and returns the leaving arc.
          Input:
              t: current spanning tree solution.
              k: tail of the entering arc.
              l: head of the entering arc.
          Return:
              Returns the tuple that represents leaving arc, capacity of the
              cycle and cycle.
          '''
          # k,l are the first two elements of the cycle
          cycle = self.simplex_identify_cycle(t, k, l)
          flow_kl = self.get_edge_attr(k, l, 'flow')
          capacity_kl = self.get_edge_attr(k, l, 'capacity')
          min_capacity = capacity_kl
          # check if k,l is in U or L
          if flow_kl==capacity_kl:
              # l,k will be the last two elements
              cycle.reverse()
          n = len(cycle)
          index = 0
          # determine last blocking arc
          t.add_edge(k, l)
          tel = t.get_edge_list()
          while index < (n-1):
              if (cycle[index], cycle[index+1]) in tel:
                  flow = self.edge_attr[(cycle[index], cycle[index+1])]['flow']
                  capacity = \
                      self.edge_attr[(cycle[index],cycle[index+1])]['capacity']
                  if min_capacity >= (capacity-flow):
                      candidate = (cycle[index], cycle[index+1])
                      min_capacity = capacity-flow
              else:
                  flow = self.edge_attr[(cycle[index+1], cycle[index])]['flow']
                  if min_capacity >= flow:
                      candidate = (cycle[index+1], cycle[index])
                      min_capacity = flow
              index += 1
          # check arc (cycle[n-1], cycle[0])
          if (cycle[n-1], cycle[0]) in tel:
              flow = self.edge_attr[(cycle[n-1], cycle[0])]['flow']
              capacity = self.edge_attr[(cycle[n-1], cycle[0])]['capacity']
              if min_capacity >= (capacity-flow):
                  candidate = (cycle[n-1], cycle[0])
                  min_capacity = capacity-flow
          else:
              flow = self.edge_attr[(cycle[0], cycle[n-1])]['flow']
              if min_capacity >= flow:
                  candidate = (cycle[0], cycle[n-1])
                  min_capacity = flow
          return (candidate, min_capacity, cycle)