金正賢です。 MyMatchingのコードは以下より https://github.com/ellenjunghyunkim/MyMatching.jl/blob/master/src/MyMatching.jl my_deferred_acceptanceのデモです。
In [1]:
using MyMatching
In [2]:
Pkg.checkout("MyMatching")
In [3]:
Pkg.test("MyMatching")
In [4]:
m_prefs = [[3], [3, 2, 1], [1, 3, 2], [3, 1]];
f_prefs = [[2, 3], [2, 3, 4, 1], [4, 1, 2]];
In [5]:
my_deferred_acceptance(m_prefs, f_prefs)
Out[5]:
In [6]:
prop_prefs = [[2], [2, 1], [2, 1], [1, 2, 3, 4], [2, 1, 4, 3], [2, 3, 1, 4], [2, 1, 4, 3], [4, 2, 1, 3]];
In [7]:
resp_prefs = [[3, 7], [7, 8, 5, 1, 2, 3, 4, 6], [2, 5, 8, 1, 3, 4, 7], [2, 5, 1, 3, 6, 4, 7]];
In [8]:
caps = [2, 2, 2, 2];
In [9]:
my_deferred_acceptance(prop_prefs::Vector{Vector{Int}},
resp_prefs::Vector{Vector{Int}},
caps::Vector{Int})
Out[9]:
遅くなりました💦