cpp_wrapper_galeshapley {matchingR} | R Documentation |
C++ wrapper for Gale-Shapley Algorithm
Description
This function provides an R wrapper for the C++ backend. Users should not
call this function directly and instead use
galeShapley.marriageMarket
or
galeShapley.collegeAdmissions
.
Usage
cpp_wrapper_galeshapley(proposerPref, reviewerUtils)
Arguments
proposerPref |
is a matrix with the preference order of the proposing
side of the market. If there are |
reviewerUtils |
is a matrix with cardinal utilities of the courted side
of the market. If there are |
Value
A list with elements that specify who is matched to whom. Suppose
there are n
proposers and m
reviewers. The list contains
the following items:
proposals
is a vector of lengthn
whosei
th element contains the number of the reviewer that proposeri
is matched to using C++ indexing. Proposers that remain unmatched will be listed as being matched tom
.engagements
is a vector of lengthm
whosej
th element contains the number of the proposer that reviewerj
is matched to using C++ indexing. Reviwers that remain unmatched will be listed as being matched ton
.