Here's an obvious algorithm for checking if a given marriage is stable.
Here, RB[b] is the ROL for boy b, RG[g] is the ROL for girl g, MB[b] is the mate of boy b in matching M, and MG[g] is the mate of girl g in matching M.
MG[MB[b]] =?.