Knowledge-Based Stable Roommates Problem: A Real-World Application

The Stable Roommates problem with Ties and Incomplete lists (SRTI) is a matching problem characterized by the preferences of agents over other agents as roommates, where the preferences may have ties or be incomplete. SRTI asks for a matching that is stable and, sometimes, optimizes a domain-independent fairness criterion (e.g., Egalitarian). However, in real-world applications (e.g., assigning students as roommates at a dormitory), we usually consider a variety of domain-specific criteria depending on preferences over the habits and desires of the agents. With this motivation, we introduce a knowledge-based method to SRTI considering domain-specific knowledge, and investigate its real-world application for assigning students as roommates at a university dormitory. This paper is under consideration for acceptance in Theory and Practice of Logic Programming (TPLP).


Introduction
The Stable Roommates problem (SR) (Gale and Shapley 1962) is a matching problem 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 that are acceptable to each other (i.e., they are in the preference lists of each other), such that the matching is stable (i.e., there exist no two agents who prefer each other to their roommates, and thus block the matching).
Optimization variants of SRTI are also studied to find more fair stable solutions. For instance, Egalitarian SRTI aims to maximize the total satisfaction of preferences of all agents. Rank Maximal SRTI aims to maximize the number of agents matched with their first preference, and then, subject to this condition, to maximize the number of agents matched with their second preference, and so on. Almost SRTI aims to minimize the total number of blocking pairs (i.e., pairs of agents who prefer each other to their roommates), if a stable matching cannot be found. These optimization variants are NP-hard (Feder 1992;Cooper 2020;Abraham et al. 2005).
These optimization variants of SRTI are based on domain-independent measures. However, in real-world applications (e.g., in dormitory applications), there are also domain-dependent criteria that necessitates further knowledge: consider, for instance, dormitory applications that request information about the personal habits of the students, as well as their preferences of the living environment.
In our earlier work (Erdem et al. 2020), we have developed a formal framework, called SRTI-ASP, that is flexible enough to provide solutions to all variations of SR mentioned above, including the intractable decision/optimization versions: SRT, SRTI, Egalitarian SRTI, Rank Maximal SRTI, Almost SRTI. SRTI-ASP utilizes the expressive languages and efficient solvers of Answer Set Programming (ASP) (Niemelä 1999;Marek and Truszczyński 1999;Lifschitz 2002;Brewka et al. 2016) based on answer set semantics (Gelfond and Lifschitz 1988;Gelfond and Lifschitz 1991).
In this study, we extend SRTI-ASP to accommodate additional domain-specific criteria in two ways: Personalized-SRTI and Most-SRTI. In addition, we extend SRTI-ASP to accommodate diversity preferences and constraints.
• For Personalized-SRTI, we introduce a new type of preference ordering considering (i) the importance of each criterion for each agent (e.g., one student may give more importance to sleeping habits whereas another student may give more importance to smoking habits), and (ii) the agents' preferred choices for each domain-specific criterion (e.g., whether a student prefers a roommate who does not smoke). We define an extended preference list for each agent, that combines two types of preference lists: a preference list of the agent over other agents (as in SRTI) and this new type of criteria-based personalized preference list of the agent. Personalized-SRTI considers these extended preference lists to compute personalized stable matchings. • For Most-SRTI, we introduce a new incremental definition of a stable matching considering (i) the ordering of the most preferred criteria (e.g., identified by large surveys) and (ii) the agents' preferred choices for each domain-specific criterion, with the motivation that the agents with close choices are matched. Most-SRTI aims to compute such most preferred criteria based stable matchings, by utilizing the weak constraints of ASP. • In addition to the students' preferences over a set of domain-specific criteria, the schools may prefer matchings (or put constraints over matchings) to increase diversity. For example, they may want to match students from different departments, classes, or countries. With this motivation, we extend SRTI-ASP by representing such diversity preferences/constraints using weak/hard constraints of ASP.
We illustrate a real-world application of SRTI-ASP by interacting with at least 200 students at Sabanci University over four surveys: (i) to decide which domain-specific criteria to consider, (ii) to collect the students preferences for domain-specific criteria, and (iii) to evaluate the usefulness of our method.
We also present results of our experiments with objective and subjective measures, to understand the scalability of the proposed two methods, Personalized-SRTI and Most-SRTI.

SRTI: Stable Roommates problem with Ties and Incomplete Lists
We define SRTI as in (Erdem et al. 2020). Let A be a finite set of agents. For every agent x ∈ A, let A x of A\{x} be a set of agents that are acceptable to x as roommates. For every y in A x , we assume that x prefers y as a roommate compared to being single.
Let ≺ x be a partial ordering of x's preferences over A x where incomparability is transitive. We refer to ≺ x as agent x's preference list. For two agents y and z in A x , we denote by y ≺ x z that x prefers y to z. In this context, ties correspond to indifference in the preference lists: an agent x is indifferent between the agents y and z, denoted by y ∼ x z, if y ≺ x z and z ≺ x y. We denote by ≺ the collection of all preference lists. A matching for a given SRI instance is a function M : A → A such that, for all {x, y} ⊆ A such that x ∈ A y and y ∈ A x , M(x) = y if and only if M(y) = x. If agent x is mapped to itself, we then say he/she is single.
A matching M is blocked by a pair {x, y} ⊆ A (x = y) if B1 both agents x and y are acceptable to each other, B2 x is single with respect to M, or y ≺ x M(x), and B3 y is single with respect to M, or x ≺ y M(y).
A matching for SRTI is called stable if it is not blocked by any pair of agents. We can declaratively solve SRTI using ASP as described in (Erdem et al. 2020). For that, the input I = (A, ≺) of an SRTI instance is formalized by a set F I of facts using atoms of the forms agent(x) ("x is an agent in A") and prefer2(x, y, z) ("agent x prefers agent y to agent z, i.e., y ≺ x z"). For every agent x, for every y ∈ A x , we also add facts of the form prefer2(x, y, x) to express that x prefers y as a roommate instead of being single.
Based on the preferences of agents, for each agent, the concept of acceptability is defined: accept(x, y) ← prefer(x, y, ). accept(x, y) ← prefer(x, , y).
as well as the concept of mutual acceptability: accept2(x, y) ← accept(x, y), accept(y, x).
The output M : A → A of an SRTI instance is characterized by atoms of the form room(x, y) ("agents x and y are roommates"). The ASP formulation P of SRTI first generates pairs of roommates. For every agent x, exactly one mutual acceptable agent y is nondeterministically chosen as M(x) by the choice rules: 1{room(x, y):agent(y), accept2(x, y)}1 ← agent(x). ← room(x, y), not room(y, x).
Then, the stability of the generated matching is ensured by the hard constraints: where atoms of the form block(x, y) describe the blocking pairs (i.e., conditions B1-B3).
3 Personalized-SRTI: SRTI with Personalized Criteria Some universities and colleges send questionnaires to students before making roommate matches, and they match students as roommates taking into account the additional information included in these questionnaires. For instance, Table 1 shows a questionnaire used for applying to dormitories of the University of North Texas. 1 It contains questions about the sleep preferences, music preferences, and sharing preferences of applicants. In some other surveys, we can see a question about the smoking habits, 2 preferences regarding the room temperature, 3 and willingness to share a room with an international student. 4 In addition to questions about such different criteria, these questionnaires usually request for the applicants to indicate the most important criteria, as seen in Table 1. Table 2: A personalized-SRTI instance defined over an agent set A = {Ayse, Buse, Cem, Duru}, a criteria list B = "smoking", "cleanliness", "room environment", "sleep habits", "study habits" , and the following choice lists for each criterion, C 1 = "Smoker","Non-smoker" , C 2 = "Clean","Messy" , C 3 = "Quiet","Social","Social and quiet" , C 4 = "Goes to bed early","Goes to bed before midnight","Goes to bed after midnight , C 5 = "Studies in the room","Studies out of the room","Studies in and out of the room" . With these motivations, we extend SRTI-ASP to include such personal preferences of applicants. We call this extension Personalized-SRTI-ASP.
Personalized-SRTI-ASP considers an aggregate preference list ≺ x defined over two types of preference lists: ≺ x as defined in the previous section, and ≺ x to capture the additional preferences as discussed above.
Defining the criteria-based personalized preference lists ≺ x . Let us first introduce some definitions and notations as follows.
Let B be a finite list b 1 , b 2 , . . . , b k of criteria. For each criterion b i ∈ B, let C i be a finite list c i1 , c i2 , . . . , c im of choices for b i , that is ordered with respect to a "closeness" measure (i.e., for every choice c i j , the choice c i j ( j < j ) is "closer" than the choice c i j ( j < j )). The closeness measure is useful for matching agents with closer choices, as roommates. For instance, consider the criteria list B = "cleanliness", "sleep habits" . For each criterion, the choice lists can be defined as follows: C 1 = "Clean", "Messy" is the list of choices for "cleanliness", and C 2 = "Goes to bed early", "Goes to bed before midnight", "Goes to bed after midnight" is the list of choices for "sleep habits".
Let f be a function that maps an agent x ∈ A and a criterion b i ∈ B to a positive integer j (1 ≤ j ≤ |C i |), describing the choice c i j of the agent x. Consider the example above, and assume that Ayse is an agent in A. If Ayse's preference for the "cleanliness" criterion is "Clean", then f (Ayse,"cleanliness") = 1. If Ayse's preference for "sleep habits" criterion is "Goes to bed after midnight", then f (Ayse,"sleep habits") = 3.
For every agent x ∈ A, let us denote by P . . , f (x, b k ) the choices of x for each criterion in B respectively. We refer to P x as the agent x's (preference) profile. Consider the example shown in Table 2. The preference profile P Buse for agent Buse is 1, 2, 3, 3, 3 where B = "smoking", "cleanliness", "environment", "sleep habits", "study habits" . According to P Buse , Buse prefers a roommate that is a "Smoker", 'Messy", "Social and quiet","Goes to bed after midnight","Studies in and out of the room." Every criterion in B may have a different importance for each agent. For instance, agent Ayse may give more importance to "study habits" while agent Buse gives more importance to "cleanliness." To take into account the importance of these criteria, we introduce a weight function w that maps an agent x ∈ A and a criterion b i ∈ B to a non-negative integer such that w(x, b i ) denotes the importance of the criterion b i for x ∈ A. For every agent x ∈ A, let us denote by the weight We say that w(x, b i ) = 0 to indicate that the criterion b i is not important for agent x. For the example shown in Table 2, W Buse = 1,0,3,4,5 : the most important criterion for Buse is "study habits", and the "cleanliness" criterion is not important.
For every agent x ∈ A, with a profile P x and a weight list W x , let us denote the criteria of the same weight u > 0 and the agent x's choices for them, by a nonempty set E u of tuples as follows: Then, for every agent x ∈ A, we define a sorted profile P x for x, with respect to P x and W x , as follows: In Table 2, the sorted profile for Cem is P Cem = {(2,"smoking"), (1,"cleanliness")}, {(3,"room environment")}, {(2,"sleep habits")}, {(3,"study habits")} considering the importance of each criterion for him: w(Cem, "smoking") = w(Cem, "cleanliness") = 5, w(Cem, "room environment") = 4, w(Cem,"sleep habits") = 3, w(Cem,"study habits") = 2.
For every agent y ∈ A\A x (i.e., y is not acceptable to x), if there exists some criterion , then we say that y is choice-acceptable to x. We denote by A x the set of all agents in A\A x that are choice-acceptable for x. In Table 2, since Ayse has no common choice with Buse, Ayse is not choice-acceptable for Buse. On the other hand, Duru has a common choice with Buse: f (Duru, "study habits") = f (Buse, "study habits") = 3; and thus Duru is choice-acceptable for Buse. We assume that x prefers every choice-acceptable y as a roommate compared to being single.
For every agent x with a sorted profile P x = E u 1 , E u 2 , . . . , E u m (m ≤ k), for every two agents y and z that are choice-acceptable to x, the agents y and z are choice-equal for x relative to the first j sets E u 1 , E u 2 , . . . , E u j in P x (denoted y = x z| j ) if the following holds: We say that x prefers y to z with respect to a sorted profile P x (denoted y ≺ x z) if the following holds for some j > 0: • y = x z| j−1 , and For agent x, we say that y ∼ x z if y ≺ x z and z ≺ x y.
A criteria-based personalized preference list ≺ x is a partial ordering of x's preferences over A x with respect to a sorted profile P x , where such incomparability is transitive.
For example, in Table 2, for Ayse, Then, the criteria-based personalized preference list ≺ Ayse is Cem : Ayse prefers Cem as a roommate compared to being single.
Since Ayse has no common choice with Buse, Ayse is not choice-acceptable for Buse. On the other hand, Cem and Duru are choiceacceptable for Buse. Then, Duru ≺ Buse Cem since • for the criterion π 1 ="study habits" in E 5 , f (Buse,π 1 )= f (Duru,π 1 )= f (Cem,π 1 )=3, and thus Duru = Buse Cem | 1 ; and • for the criterion π 2 ="sleep habits" in Then, the criteria-based personalized preference list ≺ Buse is Duru, Cem . For Duru, P Duru = E 3 where E 3 = {(3,"study habits"), (3,"sleep habits"), (3,"room environment"), (2,"smoking"), (1,"cleanliness")}. Ayse and Buse are choice-acceptable for Duru. Then, Defining the extended preference lists ≺ x . We define ≺ x as an extended preference list by concatenating ≺ x and ≺ x depending on the importance given to these two types of lists. For the instance in Table 2, suppose that the preference lists ≺ x are more important. Then the preference list ≺ x is appended to end of the preference list ≺ x . Then the extended preference list of Buse is ≺ Buse = Duru, Cem . The extended preference lists for other agents are as shown in Table 2.
Personalized-SRTI is then characterized by (A, ≺ ) where A is a finite set of agent, and ≺ is collection of the extended preference list of each agent x ∈ A. To solve Personalized-SRTI, we utilize SRTI-ASP as described in Section 2.

Most-SRTI: SRTI with Most Preferred Criteria
Instead of considering individual importance of the criteria for each agent, we can consider the most preferred criteria (e.g., identified by large surveys) and try to find stable roommate matchings accordingly. For such applications, we introduce a new definition for stable matchings.
Most-SRTI. Let W be a criteria list b 1 , b 2 , . . . , b k sorted with respect to their overall importance for all agents. For each criterion b i ∈ W , let C i be a finite list of choices ordered with respect to a closeness measure, as discussed in the previous section. Let f be a function that maps an agent x ∈ A and a criterion b i ∈ W to a positive integer j (a ≤ j ≤ |C i |).
We start with the set M of all stable matchings of a given SRTI instance (A, ≺), and define a series of subsets M max (i) of these matchings to maximize the overall satisfaction of the roommates with respect to the closeness of their choices for the criterion b 1 , b 2 , . . . , b k : Then, a stable matching M ∈ M max (|W |) is called a most preferred criteria based stable matching with respect to the criteria list W . We call the problem of finding such a stable matching, Most-SRTI.
For example, consider the instance in Table 2. Instead of considering the individual importance of the criteria for each applicant, let us take W = "smoking", "cleanliness", "room environment", "sleep habits", "study habits" . Hence, we try to find a matching that maximizes first the number of roommates which are close to each others in terms of their smoking criteria, and then, subject to this condition, maximizes the number of roommates which are close to each other in terms of their cleanliness criteria, and then, subject to this condition, maximizes the number of roommates which are close to each others in terms of their room environment criteria, and then, subject to this condition, maximizes the number of roommates which are close to each others in terms of their sleep habits criteria, and then, subject to this condition, to maximizes the number of roommates which are close to each others in terms of their study habits criteria. A stable matching at the end is called a most-preferred stable matching.
Solving Most-SRTI using ASP We can solve Most-SRTI in ASP utilizing weighted weak constraints of different priorities. The idea is to introduce weighted weak constraints to express preferences for each criterion, where the higher priorities are given for the most preferred criteria.
For each agent x, for each criterion b i ∈ W , we describe the choice r ∈ C i of x for b i (i.e., f (x, b i ) = r) by atoms. For instance, we introduce atoms of the form bedTime(x, r) to describe that f (x, "sleep habits") = r. Then the preferences of agents can be represented as follows: • bedTime(x, 1): the agent x prefers a roommate who goes to bed before 11 pm, • bedTime(x, 2): the agent x prefers a roommate who goes to bed before midnight, • bedTime(x, 3): the agent x prefers a roommate who goes to bed after midnight.
Using these atoms, the following weak constraint tries to maximize the number of roommates who are close to each other in terms of their sleep habits: Here, the priority p is assigned a high value if "sleep habits" is one of the most preferred criteria. For the "cleanliness" criterion, the preferences of agents can be represented by the following atoms of the forms: • cleanliness(x, 1): the agent x tends to keep his/her room clean, • cleanliness(x, 2): the agent x tends to keep his/her room messy.
Using these atoms, the following weak constraints try to maximize the number of roommates who are close to each other in terms of their cleanliness degrees: ∼ ←{room(x, y), cleanliness(x, r1), cleanliness(y, r2)}.[|r1 − r2|@p, x, y] Consider, for instance, "smoking" habits. This is an important criterion to match roommates even if they live on a smoke-free campus. According to the following questions: 2 • Are you smoker? • Yes • No • Are you comfortable with a roommate that is a smoker? • Yes • No we can describe the smoking habits of the agents with atoms of the forms smoker(x), nonsmoker(x), and their preferences with the following atoms of the forms: • comfortableSmoker(x, 1): the agent x is comfortable with a smoker roommate, • comfortableSmoker(x, 2): the agent x is not comfortable with a smoker roommate.
Then the following weak constraints can be added to our ASP formulation to maximize the number of roommates who are comfortable with each others in terms of their smoking habits with the given priority p: According to the "room Environment" criterion, 4 the preferences of agents can be represented by atoms of the form: • roomEnvironment(x, 1): the agent x wants his/her room to be quiet and study oriented, • roomEnvironment(x, 2): the agent x wants his/her room to social gathering place for friends to hang out, • roomEnvironment(x, 3): the agent x wants his/her room to be a combination of social and quiet.
Using these atoms, the following weak constraint tries to maximize the number of roommates who are close to each other in terms of their room description: Another important criterion is "study Habits." For this criterion, 4 the preferences of applicants can be represented by the following atoms of the form studyHabit(x, r): • studyHabit(x, 1): the agent x expects to study in his/her room, • studyHabit(x, 2): the agent x expects to study outside of his/her room, • studyHabit(x, 3): the agent x expects to study both inside and outside of his/her room.
Using these atoms, the following weak constraint tries to maximize the number of roommates which are close to each other in terms of their study environment: ∼ ← {room(x, y), studyHabit(x, r1), studyHabit(y, r2)}.[|r1 − r2|@p , x, y] Here, the priority p is assigned a lower value if Study Habits is not one of the most preferred criteria. Note that we can combine different domain-independent measures of SRTI with domainspecific measures, by assigning different priorities to them.

Diversity Preferences
In addition to the student's preferences, the schools may prefer matchings to increase diversity. For example, they may want to match student from various departments, different classes, countries. Also, some students may be forbidden to match with each other (like in the hedonic diversity games (Boehmer and Elkind 2020)) where the school partition the students into two groups for diversity preferences.
Consider, for instance, maximizing the number of roommates from different departments at a university. A student's department can be defined by atoms of the form department(x, d) ("the student x's department is d"). Then, the following weak constraints can be added to our ASP formulation, to maximize the number of roommates from different departments: The school may not want to allow some students to be roommates. Then, such students can be defined by atoms of the form forbidden(x, y) ("students x and y are forbidden to be roommates"), and the following hard constraints can be added to our ASP formulation: ← forbidden(x, y), room(x, y) (x = y).
Therefore, the diversity-related constraints and preferences can be easily added to SRTI-ASP.

Experimental Evaluations
We have experimentally evaluated Personalized-SRTI to understand its scalability over SRTI instances with additional knowledge, and compared Personalized-SRTI with Most-SRTI.
Scalability of Personalized-SRTI. For benchmarks, as a basis, we have used the SRTI instances randomly generated for our earlier experiments (Erdem et al. 2020). It is based on the following idea (Mertens 2005): 1) generate a random graph ensemble G(n, p) according to the Erdos-Renyi model (Erdös and Rényi 1960), where n is the required number of agents and p is the edge probability (i.e., each pair of vertices is connected independently with probability p); 2) since the edges characterize the acceptability relations, generate a random permutation of each agent's acceptable partners to provide the preference lists. We define the completeness degree for an instance as the percentage p * 100. We have considered instances of different sizes, where the number of agents are 40, 60, 80,100, 150 and 200, and the completeness degrees are 25%, 50%. For each number of agents and for each completeness degree, there are 20 instances. Then, for each instance, for each agent in that instance, we have randomly generated the agent's choices for each criterion, and the importance of each given criteria according to the agent. For each instance, we have considered 2-5 criteria.
In our experiments, we have used CLINGO (Version 5.2.2) on a machine with Intel Xeon(R) W-2155 3.30GHz CPU and 32GB RAM. The results are shown in Figure 1.
We make the following observations from this figure, similar to our observations (Erdem et al. 2020) over SRTI experiments: As the number of agents and the completeness degree increase, the computation times increase. In addition, as the number of criteria increase, the computation times increase.
Note that the initial completeness degree changes as additional knowledge is included about preferences of agents over different criteria. For Personalized-SRTI instance, the completeness Fig. 1: Scalability of Personalized-SRTI-ASP as the number of criteria and the completeness degrees increase, for instances where the initial completeness degree is 25% (the left figure) and the initial completeness degree is 50% (the right figure).
degree is around where n is the number of agents, d is the initial completeness degree, and m is the number of criteria. Therefore, the completeness degree of a Personalized-SRTI depends on the initial completeness degree and the number of criteria but not on the number of agents. Consider an instance where d = 25 and m = 3. We expect that the completeness degree be around 81% depending on the preferences of the agents. In fact, the completeness degree in our experiments is 83% (Figure 1).
Personalized-SRTI vs. Most-SRTI. For benchmarks, as a basis, we have used the SRTI instances randomly generated for our earlier experiments (Erdem et al. 2020) as described above. For each instance, for each agent, we have randomly generated the agent's choices for the most popular three criteria, which are cleanliness, sleep habit and study habit. The importance of each given criteria is fixed as 1, 2, 3 respectively.
The results of our experiments for 40-200 agents are shown in Table 3. We can observe that Most-SRTI performs better than Personalized-SRTI. For both approaches, the computation times for finding a stable matching (if one exists) and finding out that there exists no stable matching are comparable to each other. We can make further observation: As the completeness degree increase, the computation times of Most-SRTI more increase than Personalized-SRTI.

A Real-World Application
In collaboration with more than 200 students at Sabanci University, we have investigated the applicability of our methods for Personalized-SRTI.
First, we have conducted a survey to select the most important 5 criteria that should be included in a dormitory application. Next, we have conducted a survey to get the preferences of each student for each criterion. Next, we have conducted a survey to evaluate the usefulness of  Personalized-SRTI from the perspective of students. The surveys are given several months apart from each other, considering the availabilities of students.
7.1 First Survey: Which criteria should be considered in a dormitory questionnaire?
Students prefer short application forms. With this motivation, first we have conducted a survey to find out which multiple choice questions presented in the second part of Table 4 should be included in a dormitory questionnaire. We have conducted this survey online (due to pandemic), at Sabanci University: 156 students have participated, 120 of them live in the dormitories, and 36 of them do not. Figure 2 shows the most popular five questions, chosen by more than 100 students.  As a result of the first survey in Table 4, a roommate questionnaire (Table 5) is prepared with respect to the most preferred five criteria. The purpose of this survey is to generate real data for roommate matching: for each student, we gather the importance of criteria as well as their preferences for each criterion.
We have conducted this survey online (due to pandemic), at Sabanci University: 81 students have filled this survey.
According to the survey results, the following order of the given criteria describes the overall importance: smoking habits, cleanliness, room environment, sleep habits, and study habits.
This suggests solving a Most-SRTI problem instance, where the goal is to find a most preferred criteria based stable matching that tries to maximize first the number of roommates which are comfortable with each others in terms of their smoking habits, and then, subject to this condition, the number of roommates which are close to each others in terms of their cleanliness degree, and then, subject to this condition, the number of roommates which are close to each others in terms of their room description, and then, subject to this condition, the number of roommates which are prefer the same bedtime as close as possible, and then, subject to this condition, the number of roommates which are close to each others in terms of their study environment.
As described in Section 4, we add weighted weak constraints to our ASP formulation of SRTI (as described in Section 2) to express preferences for each one of these five criteria, where the higher priorities are given for the most preferred criteria. Since the most important criteria is smoking habits, we add a weak constraint (3) where the priority p is 5. Then, the next important criteria is cleanliness, we add a weak constraint (2) where the priority p is 4. Then, we add a weak constraint (4) where the priority p is 3. Then, we add a weak constraint (1) where the priority p is 2. Finally, we add a weak constraint (5) where the priority p is 1.
Using our ASP program augmented with all these weak constraints, we have experimented over the real data collected in this survey (i.e., preferences of agents for each criterion). A most preferred criteria based stable matching is computed in 4403.51 seconds, where roommates are comfortable to each others in terms of the first three optimization criteria (smoking habits, cleanliness, room environment) but the importance of the sleep and study habits are 20 and 6 respectively. With anytime search, Figure 3 shows that the most preferred criteria based stable matching is actually computed in 250 seconds; so the rest of the time is spent for optimality check.
7.3 Third Survey: How good are the results of Personalized-SRTI-ASP compared to unstable matchings?
In this survey, we have presented to the participants 3 Personalized-SRTI instances with 3 agents (like in Figure 4). Each instance is presented with 3 matchings, including a personalized stable matching computed by Personalized-SRTI-ASP and 2 unstable matchings. We have requested the participants to choose the matching that makes sense the most. If they choose a matching different from the one computed by our method, we have asked for an explanation.  We have conducted this survey online (due to pandemic), at Sabanci University: 59 students have participated in this survey. The survey is conducted in three groups (Red, Blue, Green) with different orderings of instances.
The percentages of choosing the stable matching computed by our method is shown in Table 6. According to the results, for 3 questions, many participants have chosen the personalized stable matchings computed by Personalized-SRTI-ASP. This shows that extending the preferences of agents with additional information about their habits and room environments is useful for the stable roommates problems. We have also made interesting observations from the feedback and explanations provided by the participants, when they choose a matching different from the one computed by our method (over the remaining 2 instances). For instance, for the question shown in Figure 4 (Red Group, Question 2), although both Ayşe and Duru stated that they want Buse as their roommate, 85% of the survey respondents chose Ayşe and Duru as the best roommate pair based on the given preferences. Eight of these participants stated that the reason why they chose Ayşe and Duru is that "They give more importance to both smoking habits and cleanliness habits", one of them stated that "They both prefer non-smoker roommates", and one of them specified the reason as "only cleaning matters". This feedback shows that the participants focus more on the additional information about habits and room environments, rather than specific preferences of roommates. In that sense, extending the preferences of agents with such additional information is useful. Furthermore, these results show that the participants have also considered their own preferences and priorities while choosing the best roommates.
7.4 Fourth Survey: How good are the results of Personalized-SRTI-ASP compared to the results of SRTI-ASP?
In this survey, we have presented to the participants 3 Personalized-SRTI instances (like in Section 7.3). These instances consider 4 agents. Each instance comes with 3 matchings to choose from: a personalized stable matching computed by Personalized-SRTI-ASP, a stable matching computed by SRTI-ASP, and an unstable matching. We have requested the participants to choose the matching that makes sense the most. We have conducted this survey online (due to pandemic), at Sabanci University: 42 students have participated in this survey. The survey is conducted in two groups (Blue, Green) with different orderings of instances.
According to the results (Table 7), while the overall percentage of choosing the stable matchings computed by SRTI-ASP is 29%, the overall percentage of choosing the personalized stable matchings computed by Personalized-SRTI-ASP is 49%. These results illustrate that extending the preferences of agents with additional information about their habits and room environments is useful.

Conclusion
We have extended SRTI-ASP to consider domain-specific knowledge about each individual's preferences about a set of criteria (e.g., about the habits of their roommates and the room environments), and about the diversity preferences of dormitories and schools (e.g., for assigning roommates from different departments). We have in particular introduced two methods taking into account these additional preferences. Personalized-SRTI considers personal preferences for each criterion, and the importance of the criteria for each agent, while Most-SRTI considers personal preferences for the most preferred criteria (e.g., obtained by a survey as in our application).
We have also evaluated Personalized-SRTI-ASP over different sizes of randomly generated Personalized-SRTI instances, and compared it with Most-SRTI-ASP. We have observed that, although Personalized-SRTI-ASP pays more attention to individuals' preferences, Most-SRTI-ASP performs better in computation time.
We have illustrated a real-world application of Personalized-SRTI-ASP by interacting with at least 200 students at Sabanci University. First, we have conducted a survey to select the most important five criteria that should be included in a dormitory application. Next, we have conducted a survey to get the preferences of each student for each criterion; in this way we have also collected real data for our experiments. Next, we have conducted two surveys to evaluate the usefulness of Personalized-SRTI from the perspective of students. We have observed that many participants have chosen the solutions computed by Personalized-SRTI-ASP, and have given more importance to the additional information about habits and room environments. In that sense, extending SRTI to include additional domain-specific knowledge is useful.