def breakCycles(self, origcyclic):
        """Remove cycles if possible."""

        numcyclic = len(origcyclic)
        best = -1

        for i in range(len(self.pairs)):
            if not self.pairs[i][0][0].isaxis:
                p = self.pairs[:i] + self.pairs[i+1:]
                ordered, cyclic = utils.topological_sort(p)
                if len(cyclic) <= numcyclic:
                    numcyclic = len(cyclic)
                    best = i

        # delete best, or last one if none better found
        p = self.pairs[best]
        del self.pairs[best]

        try:
            idx = self.deps[p[1]].index(p[0])
            del self.deps[p[1]][idx]
        except ValueError:
            pass