code: def get_next_index(self, matrix, manipulation, indices_left):
          
          f = manipulation[0]
          indices = list(indices_left.intersection(manipulation[2]))
          sums = np.sum(matrix[indices], axis=1)
          if f < 1:
              next_index = indices[sums.argmax(axis=0)]
          else:
              next_index = indices[sums.argmin(axis=0)]
  
          return next_index
docs: Returns an index that should have the most negative effect on the
          matrix sum