Principles and Practice of Constraint Programming — CP 2001

Volume 2239 of the series Lecture Notes in Computer Science pp 225-239


A Constraint Programming Approach to the Stable Marriage Problem

  • Ian P. GentAffiliated withSchool of Computer Science, University of St. Andrews
  • , Robert W. IrvingAffiliated withDepartment of Computing Science, University of Glasgow
  • , David F. ManloveAffiliated withDepartment of Computing Science, University of Glasgow
  • , Patrick ProsserAffiliated withDepartment of Computing Science, University of Glasgow
  • , Barbara M. SmithAffiliated withSchool of Computing and Mathematics, University of Huddersfield

* Final gross prices may vary according to local VAT.

Get Access


The Stable Marriage problem (SM) is an extensively-studied combinatorial problem with many practical applications. In this paper we present two encodings of an instance I of SM as an instance J of a Constraint Satisfaction Problem. We prove that, in a precise sense, establishing arc consistency in J is equivalent to the action of the established Extended Gale/Shapley algorithm for SM on I. As a consequence of this, the man-optimal and woman-optimal stable matchings can be derived immediately. Furthermore we show that, in both encodings, all solutions of I may be enumerated in a failure-free manner. Our results indicate the applicability of Constraint Programming to the domain of stable matching problems in general, many of which are NP-hard.