Computer and mathematical explorations on the Stable marriage problem, code in Python