CPSolver.Examples.StableMarriage (Fixpoint v0.10.2)

Summary

Functions

check_solution(solution, instance)

Pseudocode for checking stability (https://stackoverflow.com/questions/58439880/algorithm-to-verify-stable-matching)

for w in women:
    for m in [men w would prefer over current_partner(w)]:
        if m prefers w to current_partner(m) return false

return true

instances()

Stable marriage problem. https://en.wikipedia.org/wiki/Stable_marriage_problem.

model(instance)

print(solution, n)

solve(instance, opts \\ [])