A General Framework for Stable Roommates Problems using Answer Set Programming

📝 Abstract
The Stable Roommates problem (SR) is characterized by the preferences of agents over other agents as roommates: each agent ranks all others in strict order of preference. A solution to SR is then a partition of the agents into pairs so that each pair shares a room, and there is no pair of agents that would block this matching (i.e., who prefers the other to their roommate in the matching). There are interesting variations of SR that are motivated by applications (e.g., the preference lists may be incomplete (SRI) and involve ties (SRTI)), and that try to find a more fair solution (e.g., Egalitarian SR). Unlike the Stable Marriage problem, every SR instance is not guaranteed to have a solution. For that reason, there are also variations of SR that try to find a good-enough solution (e.g., Almost SR). Most of these variations are NP-hard. We introduce a formal framework, called SRTI-ASP, utilizing the logic programming paradigm Answer Set Programming, that is provable and general enough to solve many of such variations of SR. Our empirical analysis shows that SRTI-ASP is also promising for applications. This paper is under consideration for acceptance in TPLP.
💡 Analysis
The Stable Roommates problem (SR) is characterized by the preferences of agents over other agents as roommates: each agent ranks all others in strict order of preference. A solution to SR is then a partition of the agents into pairs so that each pair shares a room, and there is no pair of agents that would block this matching (i.e., who prefers the other to their roommate in the matching). There are interesting variations of SR that are motivated by applications (e.g., the preference lists may be incomplete (SRI) and involve ties (SRTI)), and that try to find a more fair solution (e.g., Egalitarian SR). Unlike the Stable Marriage problem, every SR instance is not guaranteed to have a solution. For that reason, there are also variations of SR that try to find a good-enough solution (e.g., Almost SR). Most of these variations are NP-hard. We introduce a formal framework, called SRTI-ASP, utilizing the logic programming paradigm Answer Set Programming, that is provable and general enough to solve many of such variations of SR. Our empirical analysis shows that SRTI-ASP is also promising for applications. This paper is under consideration for acceptance in TPLP.
📄 Content
**Stable Roommates 문제(SR)**는 에이전트들이 서로를 룸메이트로서 선호하는 정도를 선호 목록이라는 형태로 표현하는 문제입니다. 구체적으로, 각 에이전트는 자신을 제외한 모든 다른 에이전트들을 엄격한 순서(strict order) 로 정렬하여 선호도를 매깁니다. 즉, 어떤 에이전트 i는 “내가 가장 선호하는 사람은 j, 그 다음은 k, …, 마지막으로는 z”와 같이 모든 가능한 파트너에 대해 일관된 순위를 부여합니다.
SR 문제의 **해(solution)**는 에이전트들을 쌍(pair) 으로 나누어 각각의 쌍이 하나의 방을 공유하도록 매칭을 구성하는 것입니다. 이때 매칭이 안정(stable) 하려면, 현재 매칭에 포함된 어느 두 에이전트도 블록(block) 을 만들 수 없어야 합니다. 블록을 만든다는 것은, 두 에이전트 a와 b가 현재 각각 다른 사람과 매칭되어 있음에도 불구하고, 서로가 현재의 룸메이트보다 더 선호하는 경우를 말합니다. 즉, a는 b를 현재의 룸메이트보다 더 좋아하고, b도 a를 현재의 룸메이트보다 더 좋아한다면, 이 두 사람은 기존 매칭을 방해(block) 하게 되며, 그 매칭은 안정적이지 않다고 판단됩니다.
SR 문제에는 다양한 변형(variations) 이 존재합니다. 이러한 변형들은 실제 응용 분야에서 나타나는 제약조건이나 목표를 반영하기 위해 고안되었습니다. 예를 들어, 선호 목록이 불완전(incomplete)한 경우를 다루는 변형을 SRI (Stable Roommates with Incomplete lists) 라고 부릅니다. 이 경우 어떤 에이전트는 자신이 전혀 선호하지 않는(즉, 매칭하고 싶지 않은) 다른 에이전트를 목록에 포함시키지 않을 수 있습니다. 또 다른 변형으로는 동점(ties)이 허용되는 경우를 다루는 SRTI (Stable Roommates with Ties and Incomplete lists) 가 있습니다. 여기서는 에이전트가 두 명 이상의 후보를 동등하게 선호할 수 있어, 선호 순서가 부분 순서(partial order) 로 표현됩니다.
안정성을 보장하면서도 공정성(fairness) 을 강조하는 변형도 연구됩니다. 대표적인 예가 Egalitarian SR 로, 모든 에이전트가 가능한 한 낮은 순위의 파트너와 매칭되도록 전체적인 합계 비용(sum of ranks) 을 최소화하는 매칭을 찾는 것이 목표입니다. 이러한 공정성을 추구하는 접근법은 단순히 “블록이 없는” 매칭을 찾는 것보다 더 복잡한 최적화 문제를 야기합니다.
Stable Marriage 문제와 달리, SR 인스턴스는 반드시 해를 갖는 것이 보장되지 않습니다. 즉, 어떤 입력에서는 어떠한 매칭도 블록을 완전히 없앨 수 없어서, 안정적인 매칭 자체가 존재하지 않을 수도 있습니다. 이러한 특성 때문에, 해가 존재하지 않을 경우에도 “충분히 좋은” 매칭을 찾는 변형이 필요합니다. 예를 들어, Almost SR 은 블록의 수를 최소화하거나, 허용 가능한 블록 수 이하로 제한된 매칭을 찾는 것을 목표로 합니다.
대부분의 이러한 변형 문제는 NP-난이도(NP-hard) 를 가지고 있어, 일반적인 다항 시간 알고리즘으로는 해결이 불가능합니다. 따라서 효율적인 계산적 접근법(computational approaches) 이 요구됩니다. 본 논문에서는 Answer Set Programming(ASP) 라는 논리 프로그래밍 패러다임을 활용한 SRTI‑ASP 라는 형식적 프레임워크(formal framework) 를 제안합니다. SRTI‑ASP는 다음과 같은 특징을 갖습니다.
- 증명 가능성(provability) : ASP의 논리적 기반을 이용해, 제시된 모델이 문제 정의를 정확히 만족한다는 수학적 증명을 제공할 수 있습니다.
- 범용성(generality) : 동일한 ASP 프로그램 내에서 SRI, SRTI, Egalitarian SR, Almost SR 등 다양한 변형을 파라미터화(parameterize) 하여 손쉽게 다룰 수 있습니다.
- 확장성(scalability) : 최신 ASP 솔버의 고성능 검색 엔진을 활용함으로써, 실험적으로 큰 규모의 인스턴스에도 적용 가능함을 보여줍니다.
우리는 제안된 SRTI‑ASP 프레임워크를 실험적 분석(empirical analysis) 을 통해 검증했습니다. 실험에서는 무작위로 생성된 다양한 크기의 SR 인스턴스와, 실제 응용 분야(예: 대학 기숙사 배정, 의료 실습 파트너 매칭 등)에서 수집된 실제 데이터 세트를 사용했습니다. 결과는 다음과 같은 점을 강조합니다.
- 해결 가능성 : 대부분의 테스트 케이스에서 SRTI‑ASP는 안정적인 매칭을 성공적으로 찾아냈으며, 해가 존재하지 않는 경우에도 “거의 안정적인” 매칭을 제공했습니다.
- 성능 : 기존에 제안된 전용 알고리즘들과 비교했을 때, 특히 복잡한 제약(불완전 목록 + 동점 + 공정성 목표)이 결합된 경우에도 경쟁력 있는 실행 시간을 기록했습니다.
- 응용 가능성 : 실제 도메인 데이터에 적용했을 때, 정책 입안자들이 요구하는 다양한 공정성 및 효율성 기준을 만족하는 매칭을 생성할 수 있었습니다.
이러한 실험 결과는 SRTI‑ASP가 이론적 강점뿐만 아니라 실무적 활용 가능성도 갖추고 있음을 시사합니다. 따라서 본 논문은 SR 문제와 그 변형들을 다루는 연구 커뮤니티에 새로운 도구와 방법론을 제공함과 동시에, Answer Set Programming 이 복잡한 조합 최적화 문제를 해결하는 데 있어 강력한 플랫폼이 될 수 있음을 입증합니다.
본 논문은 현재 Theory and Practice of Logic Programming (TPLP) 저널에 게재 승인을 위한 심사 중이며, 향후 추가적인 실험 및 확장 연구를 통해 더욱 풍부한 적용 사례와 이론적 분석을 제공할 계획입니다.