In [2]:
# coding: UTF-8
%matplotlib inline
import matchfuncs as mf
import matplotlib.pyplot as plt
In [3]:
prop_prefs = [[0, 1, 2],
[0, 2, 1],
[2, 0, 1]]
resp_prefs = [[2, 0, 1],
[2, 0, 1],
[1, 2, 0]]
In [7]:
prop_matched, resp_matched = mf.BOS(prop_prefs, resp_prefs)
mf.Graph(prop_matched, resp_matched, prop_name=["p1", "p2", "p3"], resp_name=["q1", "q2", "q3"])
plt.savefig("3-bos.png")
In [6]:
prop_matched, resp_matched = mf.DA(prop_prefs, resp_prefs)
mf.Graph(prop_matched, resp_matched, prop_name=["p1", "p2", "p3"], resp_name=["q1", "q2", "q3"])
plt.savefig("3-da.png")
In [9]:
prop_prefs = [[2, 3, 4, 4],
[2, 3, 4, 4],
[0, 1, 4, 4],
[0, 1, 4, 4]]
resp_prefs = [[2, 3, 4, 4],
[2, 3, 4, 4],
[0, 1, 4, 4],
[0, 1, 4, 4]]
prop_caps = [2, 2, 2, 2]
resp_caps = [2, 2, 2, 2]
In [11]:
prop_matched, resp_matched, prop_indptr, resp_indptr = mf.DA(prop_prefs, resp_prefs, resp_caps, prop_caps)
mf.Graph(prop_matched, resp_matched, prop_indptr, resp_indptr, prop_name=["p1", "p2", "p3", "p4"], resp_name=["q1", "q2", "q3", "q4"])
plt.savefig("3-mtm.png")
In [ ]: