In [1]:
using MyMatching
前回と同じくwikipediaの例より
In [2]:
prop_prefs = [[1, 2, 3, 4], [3, 2, 1, 4], [1, 2, 4, 3], [3, 1, 4, 2]]
resp_prefs = [[1, 2, 3, 4], [2, 1, 4, 3], [2, 3, 1, 4], [1, 4, 3, 2]]
Out[2]:
In [3]:
matching3(prop_prefs,resp_prefs)
Out[3]:
医師臨床研修マッチング協議会の例より
In [4]:
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]]
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]]
caps = [2, 2, 2, 2]
Out[4]:
In [5]:
matching3(prop_prefs,resp_prefs,caps)
Out[5]:
最後にテストしてみます
In [6]:
Pkg.test("MyMatching")
……!!!