0

In a one-sided matching problem (so called roommate problem) I would like find all possible stable matchings. I found the package matchingR, and there seems to be an error. Hence, I now have two questions.

Here is an example. Suppose that we have 6 agents who need to be matched with each other (we need 3 groups with 2 agents in each group). The values that each group creates is the same for both agents in my application (but preferences can be very different in general case). Suppose that the utilities are as follows:

MyUtilities <- c(NA,107,185,117,198,144,107,NA,96,66,89,68,185,96,NA,178,222,183,117,66,178,NA,133,122,198,89,222,133,NA,184,144,68,183,122,184,NA)
MyUtilities <- matrix(MyUtilities,nrow=6,ncol=6,byrow=TRUE)

So, for each agent we have a utility when being matched with another agent, and we would like to find stable matchings (where we cannot find 2 agents who would prefer to be together rather than with their current partner). If I read the manual, then it says that I can use roommate function to find ONE stable matching. That is, if it returns NULL, there are no stable matchings, and it would give a stable matching if it can find one (but we would never know if there is more than one that is shown).

  1. If I run this:
results = roommate(utils = MyUtilities)

then it would give me NULL as output implying that there is no stable matching in this problem. However, when checking manually I can see that agent1+agent6, agent2+agent4 and agent3+agent5 seems to be a stable matching. I check and the code tells me that this matching is stable:


MyMatching2=as.matrix(c(6,4,5,2,3,1))
roommate.checkStability(utils = u, matching = MyMatching2)

I get TRUE as output. So, is there an error in the package or do I misunderstand something?

  1. And my original question - is there a way to find all stable matchings? That is, we have MyUtilities as input and would like to have all stable matchings as a matrix. Is there a way to do that without checking all matchings one-by-one manually?

Thanks!

Avocado
  • 70
  • 8

0 Answers0