Hi Charles,
That’s definitely a bug. The problem is in the file BasisExchangeMatroid.pyx, line 2303. We are comparing pairs (X,Y) of bases, testing the exchange axiom. In that line we try to set the current basis (an internal variable) to Y. This may not work if the exchange axioms don’t hold, yet we don’t test for it. After line 2303 (which starts with self.__move), add:
if not bitset_equal(self._current_basis, BB._subsets[pointerY]):
# We failed to set the current basis to Y through basis exchanges.
# Therefore, the exchange axioms are violated!
return False
I’ll open a Trac ticket to fix it formally in a moment.
Thank you so much for the report!
—Stefan.