CPSolver.Examples.StableMarriage (Fixpoint v0.13.2)

Link to this section Summary

Link to this section Functions

Link to this function

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

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

Link to this function

model(instance)

Link to this function

print(solution, n)

Link to this function

solve(instance, opts \\ [])