Learn R Programming

matchingR (version 1.1.1)

checkStabilityRoommate: Check if a matching solves the stable roommate problem

Description

This function checks if a given matching is stable for a particular set of preferences. This function checks if there's an unmatched pair that would rather be matched with each other than with their assigned partners.

Usage

checkStabilityRoommate(pref, matchings)

Arguments

pref
is a matrix with ordinal rankings of the participants
matchings
is an nx1 matrix encoding who is matched to whom using R style indexing

Value

  • true if the matching is stable, false otherwise