galeshapley稳定匹配我要分享

GaleShapley Stable Matching

稳定 匹配 galeshapley

关注次数: 192

下载次数: 2

文件大小: 2.27 kB

代码分类: 其他

开发平台: matlab

下载需要积分: 2积分

版权声明:如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

代码描述

中文说明:鉴于男女之间的关系,以及对异性的偏好,一个稳定的匹配是一个男人和女人之间的匹配,这样就有没有男人和女人谁更喜欢对方在他们的各自匹配的合作伙伴。Gale-Shapley算法确定这样一个稳定的匹配。根据不同的配方,它提供了一个男人的最佳或一个女人的最佳稳定匹配。给定的函数确定最佳的稳定匹配。通过切换输入的偏好,可以确定最佳的稳定匹配的女性。提供了一个例子。


English Description:

Given N men and N women, and the preferences of each of them over the members of the opposite gender, a stable matching is a matching between the N men and women such that there is no man and woman who prefer each other over their respectively matched partners. The Gale-Shapley algorithm determines such a stable matching. Depending on the formulation, it provides either a men-optimal or a women-optimal stable matching. The given function determines the men-optimal stable matching. One can determine the women-optimal stable matching by switching the preferences in the input. An example is provided.


代码预览

stableMatching.m

stableMatchingDriver.m

license.txt