jtilly / matchingR

Algorithms for Matching Markets in R and C++
https://cran.r-project.org/package=matchingR
50 stars 18 forks source link

Is it possible to determine slots (in College Admissions Problem) as a vector? #30

Closed p2004r closed 9 years ago

p2004r commented 9 years ago

Currently, "slots" is the number of slots that each college has available. But is possible each college may a different number of slots.

Is it possible to change this input parameter of the algorithm?

jtilly commented 9 years ago

That's not possible in the current version of the package. However, it's an easy fix. We would need to change what's happening in lines 293-294 and 339-340 in R/galeShapley.R. There, we're expanding the preference matrices of students and colleges to account for the number of slots. I'll take a look at it. Seems like something we can easily implement.

p2004r commented 9 years ago

Thank you very much for your attention!

I think to corresponding change a "matrix" to a "list" in this place? https://github.com/jtilly/matchingR/blob/master/R/galeshapley.R#L315

PS Or (without changing the type), only replace the missing value in the res$matched.colleges (at the college with smaller "slots") on Na?

jtilly commented 9 years ago

Yes, we need to change the output type. I'm thinking a list is the way to go, because I'd like to reserve 'NA' for colleges with slots that remain unmatched.

jtilly commented 9 years ago

I think I have a basic version of this working. The code is on a separate branch. Still needs further testing.

jtilly commented 9 years ago

Done and merged into master.