Simplified group activity selection with group size constraints

Several real-world situations can be represented in terms of agents that have preferences over activities in which they may participate. Often, the agents can take part in at most one activity (for instance, since these take place simultaneously), and there are additional constraints on the number of agents that can participate in an activity. In such a setting, we consider the task of assigning agents to activities in a reasonable way. We introduce the simplified group activity selection problem providing a general yet simple model for a broad variety of settings, and start investigating its special case where upper and lower bounds of the groups have to be taken into account. We apply different solution concepts such as envy-freeness and core stability to our setting and provide a computational complexity study for the problem of finding such solutions.


Introduction
Several real-world situations can be represented in terms of agents that have preferences over activities in which they may participate, subject to some feasibility constraints on the way they are assigned to the different activities.In many scenarios, agents can take part in at most one activity (e.g., since these take place simultaneously), which is the setting considered in this work.In this respect, 'activity' should be taken in a wide sense; typical examples include, for instance, tasks, coalitions, or courses.
The group activity selection problem (GASP) asks how to assign agents to activities in a "good" way.In the original form introduced by Darmann et al. (2012Darmann et al. ( , 2018)), agents express their preferences both on the activities and on the number of participants for the latter; in general, these preferences are expressed by means of weak orders over pairs "(activity, group size)".
We will consider a simplified version of the group activity selection problem, called s-GASP.Here, agents only express their preferences over the set of activities.However, the activities come with certain constraints, such as restrictions on the number of participants, concepts like balancedness, or more global restrictions.The goal is again to find a "good" assignment of agents to activities, respecting both the agents' preferences as well as the constraints.In this work, we investigate the case that activities bare constraints on the number of participants, which are of the following kind: each activity has a lower and upper bound on the number of agents that can take part in it; the activity can only be used if the number of agents assigned to it is in that interval.The applications of such a setting include assignments of agents to "group activities" such as participants of a workshop to social activities in the free afternoon (e.g., for activities with costs to be split as in a bus trip, a certain minimum amount of participants could be required), co-workers to projects or working tasks, or students to courses.
In general, we are therefore concerned with a problem of translating individual preferences into a group decision in a meaningful way, which is the central question of social choice and has gained increasing attention in artificial intelligence in recent years.With the emergence and increase of recommender systems, e-commerce, and online platforms connecting people and serving as a tool to coordinate group activities, the study of properties of solutions and their practicability in terms of the computational complexity involved hence also have rapidly been gaining in relevance.
But what is a good assignment?Clearly, this essentially depends on the application on hand, but there are several concepts in the social choice and game theory literature that propose for an evaluative solution.We consider two classes of solution concepts for assessing the quality of an assignment: stability criteria that mainly come from game theory and that aim at telling whether an assignment is stable enough (that is, immune to some types of deviations) to be implemented.First, individual rationality requires that each agent is assigned to an activity she likes better than not being assigned to any activity at all.Then, a solution concept considered both in hedonic games and in matching theory, is the notion of stability.It asks whether the assignment is stable in the sense that no agent (individual stability) or no group of agents (core stability) would want to or be able to deviate from her coalition, her match, or in our case, her assigned activity.Besides considering these different variants of stability, it also makes sense in our setting to investigate the variations of virtual stability, meaning that it is not possible that an agent or a group of agents deviates from the assigned activity due to the given constraints on the desired activity.welfare and fairness criteria that stem from social choice theory and fair division.
The former measure, qualitatively or quantitatively, the welfare of agents.A common quality measure in terms of efficiency of an assignment is the notion of Pareto optimality: there should be no feasible assignment in which there is an agent that is strictly better off, while the remaining agents do not change for the worse.More generally, one may wish to optimize social welfare, for some notion of utility derived from the agents' preferences: for instance, one may simply be willing to maximize the number of agents assigned to an activity (which is one of the goals pursued in this work).If fairness is important in the design, the notion of envy-freeness makes sense: an assignment respecting the constraints is envy-free if no agent strictly prefers an activity another agent is assigned to to the activity she is currently assigned to.Envy can hence be the reason for an "unstable" assignment, and therefore envy-freeness can also be interpreted as a kind of stability criterion.

Related work
Our model is related to various streams of work: Group Activity Selection Problem (see the survey by Darmann and Lang (2017)).Darmann et al. (2012Darmann et al. ( , 2018) ) introduce the group activity selection problem (GASP), in which agents need to be assigned to activities (each agent to at most one activity).There, agents' preferences depend both on the activities and on the number of participants in the respective activity and are captured by means of weak orders over pairs "(activity, group size)" including a dedicated outside option (the void activity).The works of Darmann et al. (2012Darmann et al. ( , 2018) ) and Darmann (2018a, b) are concerned with the variants of GASP in which the agents' preferences are approvals and strict orders respectively and analyze the computational complexity of finding assignments that are stable or maximize the number of agents assigned to activities.The parametrized complexity of (variants of) GASP has also been studied in the literature.For instance, Ganian et al. (2019) consider the parametrized complexity of GASP with typed agents.Moreover, the model of GASP has been expanded by Igarashi et al. (2017a, b) by introducing social network constraints: any pair of agents can only take part in the same activity if the respective agent-vertices of a given social network graph are connected by an edge in the graph.For that setting, Igarashi et al. (2017a, b) and also Gupta et al. (2017) study stability concepts from a computational viewpoint, with the focus on fixed parameter tractability.Finally, we refer to Eiben et al. (2018) for another extension of the original model of GASP, where agents also express their preferences over other agents by listing enemies and friends.
In contrast to these works, however, in the model of s-GASP the agents have preferences over activities including the void activity, and constraints on the number of agents that can be assigned to each of the activities are given exogenously.We also consider additional aspects such as envy-freeness and the tension between envy-freeness and Pareto optimality, and we focus on weak orders (albeit almost all of our hardness results hold for strict orders as well).
Assignment problems (see, e.g., Chapter 17 in the book by Schrijver (2003)).s-GASP with constraints on the group sizes is similar to the classical assignment problem where agents are assigned to tasks (at most one agent to each task and at most one task to each agent), minimizing some related total cost: our activities correspond to tasks, and for each activity, we introduce as many copies of the corresponding task as the upper bound of the considered activity.The void activity can be represented by a dummy task.The difference in our setting is that activities might come with lower bounds and can only be assigned if enough agents are willing to participate.
Course/Project allocation, (see, e.g.Cechlárová and Fleiner (2017), Kamiyama (2013) and Monte and Tumennasan (2013)).Students bear preferences over courses they would like to be enrolled in (these preferences are typically strict orders), and there are usually constraints given on the size of the courses.Courses will only be offered if a minimum number of participants is found, and there are upper bounds due to space or capacity limitations.Cechlárová and Fleiner (2017) consider a courseallocation framework where agents can be matched to more than one activity (course), and in their model, each agent has a certain capacity of courses she is able to take part in.Cechlárová and Fleiner (2017) are concerned with Pareto optimality, and provide NP-hardness for the problems of (i) deciding if a given matching is Pareto optimal in the case that all agents have strict preferences over a subset of acceptable courses, and (ii) finding a Pareto optimal matching in the case that each agent is indifferent between all courses she finds acceptable.Kamiyama (2013) and Monte and Tumennasan (2013) consider the scenario in which an agent can be assigned to at most one activity (project), each of which needs a minimum number of agents to open, and the agents have strict preferences over projects; the goal here would be a strategyproof and Pareto-optimal matching.These works are very close to our setting, but our setting contains a dedicated outside option (the void activity), and agents' preferences are represented by weak orders over activities instead of strict rankings.Note that we do not restrict to Pareto optimality but also consider solution concepts such as core stability and virtual stability.In addition, our setting is related to the many-to-one weight matching problem considered by Arulselvan et al. (2018).They are concerned with a set of vertices (agents) that need to be matched with another set of vertices (posts) of an undirected graph, and each post comes with a lower and upper bound on the number of agents engaged in the post; each agent can be assigned to at most one post.Each edge in the graph has a weight, and the goal would be a manyto-one matching with total maximum weight.In the unit weight case, this problem corresponds to finding an individually rational assignment maximizing the number of agents involved in a non-void activity in the model of s-GASP considered in this paper, see also Sects. 3 and 5.
Our setting is also related to the college/school admission problems with twosided preferences and quotas as considered by Biró et al. (2010), Boehmer and Heeger (2020), Goto et al. (2014), and Hamada et al. (2017).In the college admission problem (see also Gale and Shapley (1962)), there is a set of students that need to be assigned to colleges; each college has a certain upper bound on the number of students that can be enrolled, while both students bear preferences over the colleges and colleges bear preferences over the students.We point out that in our setting, we are concerned with one-sided preferences only: the agents have preferences over the activities, but not vice versa.Hence, observe that in the college admission problem, a stable assignment takes into account the preferences of both sides, which is not the case in our setting.As an additional contrast to our setting, in the above papers the preferences are assumed to be strict.Similar to our work, however, Biró et al. (2010), Boehmer and Heeger (2020), Yokoi (2020), and Hamada et al. (2017) are concerned with lower quotas, i.e., each college comes also with a lower bound on the number of students that must be admitted to the college to ensure its opening.In such a setting, Yokoi (2020) is concerned with envy-freeness, while Biró et al. (2010) and Boehmer and Heeger (2020) focus on stability; in particular, Biró et al. (2010) show that deciding whether a stable assignment exists is NP-complete, and Boehmer and Heeger (2020) analyze the parametrized complexity involved.In contrast, as we show in this work, in s-GASP, for most of the stability concepts considered, a stable assignment always exists and can be found efficiently.In the variant considered by Hamada et al. (2017), however, in a feasible assignment, all colleges must be open; on the contrary, our setting also allows for activities to which no agents are assigned.Moreover, regional minimum or maximum (common) quotas have been considered in the college admission problem as well, where in each region (i.e., set of colleges) a certain lower, respectively upper, bound on the total number of students (see Goto et al. (2014) resp.Biró et al. (2010)) has to be met.Finally, our work also has a certain vicinity to the problem considered by Garg et al. (2010), where scientific papers need to be assigned to referees.
Hedonic games (see the recent survey by Aziz and Savani (2015)) are coalition formation games where each agent has preferences over coalitions containing her.The stability notions we will focus on are derived from those for hedonic games.However, in our model, agents do not care about who else is assigned to the same activity as them, but only about the activity to which they are assigned to. 1n multiwinner elections, there is a set of candidates, voters have preferences over single candidates, and a subset of k candidates has to be elected.In some approaches to multiwinner elections, each voter is assigned to one of the members of the elected committee, who is supposed to represent her.Sometimes there are no constraints on the number of voters assigned to a given committee member as is the case for the Chamberlin-Courant rule (Chamberlin and Courant 1983), in which case each voter is assigned to her most preferred committee member; on the other hand, for the Monroe rule (Monroe 1995), the assignment has to be balanced.A more general setting, with more general constraints, has been defined by Skowron et al. (2015).Note that multiwinner elections can also be interpreted as resource allocation with items that come in several units (Skowron et al. 2015) and as group recommendation (Lu and Boutilier 2011).While assignment-based multiwinner election problems are similar to simplified group activity selection, an important difference is that for the former, stability notions play no role, as the voters are not assumed to be able to deviate from their assigned representatives.

Contents and outline
In this work, we will take into account various solution concepts and consider two tasks: First, do "good" assignments exist?Can we decide this efficiently?And if they exist, can we find them efficiently?Our second concern is optimization: we are looking for desirable assignments that maximize the number of agents which can be assigned to an activity.Again, we may ask whether an assignment that is optimal in this sense exists, and we can try to find it.
We will focus on one family of constraints concerning the size of the groups-we assume that each activity comes with a lower and an upper bound on the number of participants-and give a detailed analysis of the described problems for this class.
Our results for this class are twofold.First, we show that it is often possible to find assignments with desirable properties in an efficient way: we propose several polynomial-time algorithms to find good assignments or to optimize them, meaning that we want to maximize the number of agents assigned to a non-void activity.We complement these findings with NPand coNP-completeness results for certain solution concepts.Whenever we encounter computational hardness, we identify tractable special cases: we will see that basically all our problems can be solved in polynomial time if there is no restriction on the minimum number of participants for the activities to take place.This corresponds to the setting of the assignment problem where tasks do not have a limitation on the lower bound of agents.An overview of our computational complexity results is given in Table 1 in Sect.3. Second, we show that also in this class of problems considered, there is a certain tension between the concepts of envy-freeness and Pareto optimality, even for small instances.
From a technical point of view, we mainly use reductions to establish our hardness results and flow networks to obtain polynomial-time algorithms.Many of our hardness results are obtained by reductions from the NP-complete problem Exact Cover by 3-Sets (X3C).The constructions we use are often similar to a certain extent, but the argumentation to justify the desired properties of the constructed instances differs.We therefore give two of these proofs in detail in the main part of this work and defer the remaining constructions and their discussion to the Appendix.The special structure of the problems considered in Sect.5, however, was helpful for working with matchings, either to obtain polynomial-time algorithms, or as a base problem for reductions to obtain computational hardness.
The remainder of this work is organized as follows.In Sect.2, we formally introduce the simplified model as well as possible constraints and several solution concepts.Section 3 is the main part and provides an analysis of the computational complexity of the questions described above.Section 4 deals with the tension between envyfreeness and Pareto optimality.A special type of constraint asking for a certain kind of balancedness is considered in Sect. 5 where we investigate the case that an activity can only take place if exactly q agents are assigned to it, for some fixed number q.In Sect.6, we conclude and discuss the general model of the simplified group activity selection problem, as well as future directions of research.

Model, constraints, solution concepts
We start with defining our model and with introducing the solution concepts we want to consider.

Simplified group activity selection, constraints
An instance (N , A, P, R) of the simplified group activity selection problem (s-GASP) is given as follows.The set N = {1, . . ., n} denotes a set of agents and A = A * ∪ {a ∅ } a set of activities with A * = {a 1 , . . ., a m }, where a ∅ stands for the void activity.An agent who is assigned to a ∅ can be thought of as not participating in any activity.The preference profile P = 1 , . . ., n consists of n votes (one for each agent), where i is a weak order over A (with strict part i and indifference part ∼ i ) for each i ∈ N .The set R is a set of side constraints, i.e., conditions that an assignment must satisfy.
A mapping π : N → A is called an assignment.Given assignment π , #(π ) = |{i ∈ N : π(i) = a ∅ }| denotes the number of agents π assigns to a non-void activity; for activity a ∈ A, π a = {i ∈ N : π(i) = a} is the set of agents π assigns to a.
The goal will be to find "good" assignments that satisfy the constraints in R. The structure of the set R depends on the application.In this work, we assume that each activity a ∈ A * comes with a lower bound (a) and an upper bound u(a), and all constraints in R are of the following type: for each a We lay particular focus on the special cases of (a) = 1 and u(a) = n respectively.In Sect.5, we also have a look at the special case that each interval consists of a single number only.

Feasible assignments, solution concepts
Let an instance (N , A, P, R) of s-GASP be given.A feasible assignment is an assignment meeting the constraints in R. We will consider the following properties (see also Fig. 1).A feasible assignment π is envy-free if there is no pair of agents (i, j) ∈ N × N with π( j) ∈ A * such that π( j) i π(i) holds (i.e., no agent prefers any activity of A * assigned to another agent to her own activity); individually rational if for each i ∈ N we have π(i) i a ∅ (i.e., every agent ends up with an activity that is acceptable for her); individually stable if there is no agent i and no activity a ∈ A such that (1) a i π(i) and (2) the mapping π defined by π (i) = a and π (k) = π(k) for k ∈ N \{i} is a feasible assignment (i.e., no agent can switch to a preferred activity without violating the constraints); core stable if there is no pair (E, a) where E ⊆ N and a ∈ A such that (1) a i π(i) for all i ∈ E, (2) π a ⊂ E holds if a ∈ A * , and (3) the mapping π defined by π (i) = a for i ∈ E and π (k) = π(k) for k ∈ N \ E is a feasible assignment (i.e., no set of agents can reorganize itself in a way that each of them receives a more preferred activity and no constraint is violated); (Note that the respective activity a to which the set E of agents wishes to deviate must be either a ∅ or currently unused because the agents in a non-empty set π a , a ∈ A * , are not better off by agents joining as their preferences only depend on the activities.)strictly core stable if there is no pair (E, a) where E ⊆ N and a ∈ A such that (1) a i π(i) for all i ∈ E where a i π(i) for at least one i ∈ E, (2) π a ⊂ E holds if a ∈ A * , and (3) the mapping π defined by π (i) = a for all i ∈ E and π (k) = π(k) for k ∈ N \ E is a feasible assignment (i.e., no set of agents can reorganize itself in a way that some of them receive a more preferred activity whereas the remaining agents do not change for the worse, and no constraint is violated); -Pareto optimal if there is no feasible assignment π that Pareto-dominates π : that is, if there is no feasible assignment π = π such that π (i) i π(i) for all i ∈ N and π (i) i π(i) for at least one i ∈ N (i.e., the whole group of agents cannot reorganize in a way that some agents receive a more preferred activity whereas the remaining agents do not change for the worse, and no constraint is violated).
Requirement E ⊃ π a in the definition of (strict) core stability follows the idea that agents cannot be removed from their assigned activity.Observe that, with the set of constraints R considered in this paper, a main difference between the concepts of (strict) core stability and individual stability is based on the size constraints for the activities.
Most of the above solution concepts are typically considered to assess the quality of an assignment in problems from matching theory and, in particular, hedonic games2 depending on the particular setting, it makes more sense to consider one or the other of them.Since simplified group activity selection has a certain vicinity to both of the problems, we translated them to our setting and consider this whole variety of criteria.
Remark 1 Another common notion of stability is Nash stability.In the hedonic games framework, the difference between Nash stability and individual stability is that the latter refers to deviations in which all members of a coalition C welcome the agent that wishes to join C. In contrast to hedonic games, in the setting of s-GASP the agents do not have preferences over other agents.Therefore, in s-GASP the solution concepts of Nash stability and individual stability coincide.
We begin with a short example highlighting some of the above solution concepts.
Example 1 Let N = {1, 2, 3, 4} and A * = {a, b}, with (a) = 1, (b) = 2, and u(a) = u(b) = 4.The agents' preferences are given as follows: Consider the assignment π with π(1) = a and π(2) = π(3) = π(4) = b; in particular, we have π a = {1}.(The activity assigned to each agent by π is printed in bold in each agent's preference order above.)The assignment π is individually rational because there is no agent i who prefers a ∅ over π(i).However, π is not envyfree since agent 2 envies agent 1 for activity a.In addition, it turns out that π is not individually stable, because agent 2 wants to deviate to a with the resulting assignment π given by π (1) = π (2) = a and π (3) = π (4) = b being feasible.Similarly, π is not strictly core stable since in the coalition E = {1, 2} ⊃ π a , agent 2 can be made better off by making her join a, while agent 1 does not change for the worse.On the other hand, π is core stable: the only possible coalition E making each of its members strictly better off would be E = {2} with a deviation towards a, but the transition to activity a is not permitted as a is neither the void activity nor unused under π .Finally, in contrast to π , assignment π is not Pareto optimal.
Stability of a solution can have several reasons: the agents are all happy with the assignment and do not want to change it; or they are not as happy as they could be, but they cannot deviate because of the constraints. 3The constraints might be violated in different ways.For the class of constraints we consider, an alternative notion of stability, namely the notion of virtual stability, is interesting.Both types of stability notions incorporate the condition that agents cannot be simply removed from assigned activities.However, in contrast to the above defined stability notions in which a deviation requires the feasibility of the resulting assignment, virtual stability captures the idea that a deviating (group of) agent(s) is only concerned with the "feasibility" with respect to the activity the (group of) agent(s) wants to join, irrespective of whether or not the size constraints of the left activities are met: it thus requires that a deviation from the assigned activity towards a more preferred activity a violates the capacity constraints of a.
Formally, we define the following stability concepts (for the sake of conciseness we set (a ∅ ) = 1 and u(a ∅ ) = n).
A feasible assignment π is virtually individually stable if there is no agent i and no activity a ∈ A with (a) ≤ |π a | + 1 ≤ u(a) such that a i π(i) holds; virtually core stable if there is no pair (E, a) where E ⊆ N and a ∈ A with (a) ≤ |E| ≤ u(a) such that (i) a i π(i) for all i ∈ E, and (ii) π a ⊂ E holds if a ∈ A * ; virtually strictly core stable if there is no pair (E, a) where E ⊆ N and a ∈ A with (a) ≤ |E| ≤ u(a) such that (i) a i π(i) for all i ∈ E where a i π(i) for at least one i ∈ E, and (ii) Note that as in the definition of core stability, also in virtual core stability the respective activity a to which the set E of agents wishes to deviate must be either the void activity a ∅ or currently unused.The following example indicates the difference between stability and virtual stability, which lies in the fact that the latter notion refers to deviations which do not take into account the level of lower bounds on the activities that are left; in the example, this is illustrated by means of the respective notions of (virtual) individual stability.
Example 2 Let N = {1, 2, 3}, A * = {a, b} with (a) = 1, u(a) = 2 and (b) = 2 = u(b), with the following preference profile: Assignment π with π(1) = a and π(2) = π(3) = b is individually stable (and also individually rational), because due to the lower bound of 2 on activity b, agent 2 cannot deviate towards a without violating feasibility.On the other hand, π is not virtually individually stable, because a deviation of agent 2 towards activity a meets the capacity bounds of a since u(a) = 2 and π assigns only one agent to a.
The relationships between the solution concepts are shown in Fig. 1.Notably for none of the relations the converse holds as well.As the below Theorem 1 shows, the technical subtleties of the solution concepts lead to some surprising results.This also fixes an error in the corresponding figure in our previous work (Darmann et al. 2017) where we erroneously claimed that (virtual) core stability implies (virtual) individual stability.
Before turning to Theorem 1, however, we briefly provide the key arguments for the relations between the solution concepts depicted in Fig. 1: virtually strictly core stable ⇒ virtually individually stable.This follows directly from the definition of a virtually strictly core stable assignment by setting E = {i}.virtually strictly core stable ⇒ virtually core stable.Consider a feasible assignment π and some pair (E, a) with E ⊆ N and a ∈ A. If a i π(i) does not hold for all members of E, then a i π(i) does not hold for all members of E.
Therewith, the statement follows.virtually strictly core stable ⇒ strictly core stable.This follows from the fact that, if the size constraints of the activity a which the group of agents wants to join is not met, then the resulting assignment cannot be feasible.-Pareto optimal ⇒ strictly core stable.Assume a feasible assignment π is not strictly core stable.Then a group E of agents can deviate towards an activity a in a way that (1) makes at least one member of E better off without making one member of E worse off, and (2) results in a feasible assignment π .Thus, π Pareto-dominates π , which proves our statement.virtually individually stable ⇒ individually stable.This follows from the fact that, if the size constraints on the activity a towards which the agent wants to deviate is not met, then the resulting assignment is not feasible.virtually individually stable ⇒ individually rational.An assignment that is virtually individually stable is necessarily also individually rational, because an agent assigned to an activity she prefers a ∅ to can trivially deviate towards a ∅ without violating its size constraints, as there are no constraints on a ∅ .virtually core stable ⇒ individually rational.Analogously to the above, a group of agents E in which all of its members are better off by deviating to a ∅ can trivially Relations between the solution concepts we consider.An arrow directed from A to B means A implies B; e.g., a Pareto optimal assignment is also strictly core stable.
For the solution concepts in bold a respective assignment always exists (see also Sect. 3) 123 deviate towards a ∅ without violating its size constraints, as there are no constraints on a ∅ .virtually core stable ⇒ core stable.This follows analogously to (virtually strictly core stable ⇒ strictly core stable).strictly core stable ⇒ core stable.This follows analogously to (virtually strictly core stable ⇒ virtually core stable).
Theorem 1 There are instances of s-GASP with assignments which are Consider the following preference profile: Then, the assignment π with π(1) = b and π(2) = a is virtually strictly core stable but not Pareto optimal.
Example 4 Let N = {1, 2}, A * = {a, b} with (x) = 2 = u(x) for all x ∈ A * , and the following preference profile: Assignment π with π(1) = π(2) = a is Pareto optimal and individually stable (agent 2 cannot deviate to a ∅ without violating the constraints of activity a), but neither individually rational nor virtually individually stable (there are no constraints on a ∅ , hence a deviation of agent 2 towards a ∅ trivially satisfies the constraints on a ∅ ).Hence, π is also not virtually strictly core stable.
We point out that for the special case of (a) = 1 for each activity a ∈ A * , virtual (strict) core stability coincides with (strict) core stability, and virtual individual stability coincides with individual stability.In addition, in this case all of the considered solution concepts except envy-freeness imply individual rationality; the latter is a consequence of the below proposition and the relations between the solution concepts displayed in Fig. 1.

Proposition 1
In s-GASP, if for each activity a ∈ A * we have (a) = 1, then any assignment that is core stable or individually stable is individually rational.Proof In the case (a) = 1 for all a ∈ A * , consider an assignment π which is not individually rational.Then there must be an agent i who is assigned to some activity a she has ranked below a ∅ and hence would prefer to deviate to a ∅ .By (a) = 1, the assignment π with π (i) = a ∅ and π ( j) = π( j) for j ∈ N \ {i} is feasible.Hence, π is neither individually stable nor core stable.
Before we move on to the next sections where we present our complexity results, we conclude this section with the definition of the NP-complete problem Exact Cover by 3-Sets (X3C) which is used in most of the reductions in this paper.The input of an instance of X3C consists of a pair X , Z , where X = {1, . . ., 3q} and Z = {Z 1 , . . ., Z p } is a collection of 3-element subsets of X ; the question is whether we can cover X with exactly q sets of Z. Throughout the paper, we assume that each element of X is contained in exactly three sets of Z; this implies that p = 3q holds.X3C is known to be NP-complete in this case (Gonzalez 1985).For each i ∈ X , we will always denote the sets containing i by

Computing "good" assignments
We will now consider the computational complexity of s-GASP for the various solution concepts presented in the previous section.An overview of our results is given in Table 1.For each of the considered solution concepts, we first deal with the question of finding assignments with the desired properties or verifying them; then, we turn to an optimization variant.
Naturally, the first interesting question is whether "good" assignments exist and how to find them.In this section, we either provide hardness results for the first question (implying hardness of finding a respective assignment) or we provide a polynomial-time algorithm for finding a respective assignment (except for Pareto optimal assignments, which always exist but in general turn out to be computationally hard to determine).For each of the considered concepts, we then turn to an optimization problem: among all feasible assignments that feature a certain property, one is usually interested in finding one that maximizes the number of agents that are assigned to a non-void activity, thus keeping the number of agents who cannot be enrolled in any activity low.The decision version of this problem asks the question whether, for some given k, at least k agents can be assigned to non-void activities.In this section, we either provide a polynomial-time algorithm that determines a "good" assignment maximizing the number of agents assigned to non-void activities (implying that the corresponding decision problem is in P), or provide hardness results for the above stated decision problem (which in turn implies hardness of finding a corresponding assignment).
This section is structured as follows.We begin with the two most basic concepts of feasibility and individual rationality in Sect.3.1.Section 3.2 is dedicated to Pareto optimal assignments.Then, we consider the stability notions4 of (virtual) individual   We state whether the corresponding problem is solvable in polynomial time (in P), NP-hard (NP-h), or NP-complete (NP-c).Unsolved cases are marked by '?'.For the problems that are in P, a respective assignment can be found in polynomial time stability, (virtual) core stability, and (virtual) strict core stability in Sect.3.3.We conclude the section with envy-free assignments in Sect.3.4.

Feasible and individually rational assignments
Obviously, assigning the void activity to every agent results in a feasible, individually rational and also envy-free assignment.In addition, it can be checked in polynomial time whether a given assignment is feasible or individually rational.
The task of maximizing the number of agents assigned to a non-void activity in a feasible or individually rational assignment, however, is more challenging.On the positive side, if we are only interested in a feasible assignment maximizing the number of agents assigned to a non-void activity, we can find such an assignment in polynomial time.
Proposition 2 In s-GASP, in polynomial time we can find a feasible assignment that maximizes the number of agents assigned to a non-void activity.
Proof We need to find the maximum number k ≤ n such that taking, for each a ∈ A * , exactly one number of {0} ∪ [ (a), u(a)], adds up to k.This problem corresponds to the Multiple-Choice Subset-Sum problem (Pisinger 1995); in our case, the latter allows for an overall polynomial-time algorithm since u(a) is bounded by n.
But already for individually rational assignments it is NP-complete to decide whether all agents can be assigned to a non-void activity (stated in Theorem 2 below).We note that Theorem 2, where we consider the decision for an assignment of all agents, is stronger than the result implied by Arulselvan et al. (2018, Theorem 1), namely that the decision problem whether it is possible to assign ≥ k agents to nonvoid activities such that the assignment is individually rational is NP-complete.
Theorem 2 It is NP-complete to decide whether s-GASP admits an individually rational assignment that assigns each agent to some a ∈ A * , even when each agent has strict preferences and for each activity a ∈ A * we have (a) = 3 and u(a) = n.Proof This is shown by a reduction from Exact Cover by 3-Sets (see Appendix).
However, if we have (a) = 1 for each a ∈ A * , then we can find a maximum individually rational assignment-i.e., an individually rational assignment which maximizes the number of agents assigned to a non-void activity-efficiently, since it is straightforward to translate this task to a (many-to-one) simple b-matching problem, which can be solved in polynomial time (see, e.g., the textbook by Korte and Vygen 2012, Chapter 12).In a simple b-matching problem, we are given an undirected graph G = (V , E) and a mapping b : V → N 0 ; a b-matching is a subset T ⊆ E such that for each vertex v there are at most b(v) edges in T that have v as an endpoint; the goal is to find a b-matching of maximum cardinality.In this kind of matching problems, the vertices of an undirected graph come with a bound b on the number of vertices they can be matched with (the case b = 1 for all vertices corresponds to the ordinary matching problem).Proposition 3 In s-GASP, if for each activity a ∈ A * we have (a) = 1, then in polynomial time we can find a maximum individually rational assignment.

Pareto optimal assignments
We now turn our attention to Pareto optimal assignments.Our first result shows that finding a Pareto optimal assignment in s-GASP is NP-hard even for the case u(a) = n for each activity a. Theorem 3 In s-GASP, it is NP-hard to find a Pareto optimal assignment, even when for each activity a ∈ A * we have (a) = 3 and u(a) = n.Proof This is shown by a reduction from Exact Cover by 3-Sets (see Appendix).
However, in the case of (a) = 1 for each a ∈ A * , we can even find a Pareto optimal assignment that maximizes the number of agents assigned to a non-void activity in polynomial time (see Corollary 1 at the end of Sect.3.2).
Next, we turn to the question of verification of Pareto optimality.In particular, checking whether a given assignment is Pareto optimal is coNP-complete as the following theorem shows.

Theorem 4
In s-GASP, it is coNP-complete to decide if a given assignment is Pareto optimal, even when each agent has strict preferences and for each activity a ∈ A * we have u(a) = n.Proof This is shown by a reduction from Exact Cover by 3-Sets (see Appendix).
We remark that if there are no restrictions on the minimum number of participants of each activity, the latter problem can be modeled as a minimum cost flow problem and hence becomes tractable.

Theorem 5
In s-GASP, if for each activity a ∈ A * , we have (a) = 1, then in polynomial time we can decide if a given assignment is Pareto optimal.
Proof Given instance I = (N , A, P, R) of s-GASP with (a) = 1 for all a ∈ A * and assignment π , we construct instance C of the minimum cost flow problem with lower bounds (see, e.g., Ahuja et al. 1993, Chapter 2.4).Note that π must be individually rational.In instance C, the directed graph G = (V , E) along with edge costs, lower bounds (i.e., the minimum amount that must flow on an edge) and capacities (i.e., the maximum amount that can flow on an edge) of the edges are given as follows (see also Fig. 2 for an illustration).G = (V , E) has vertex set V = {s, t} ∪ N ∪ A * , the edge set E consists of the following edges: -for i ∈ N , edge (s, i) of zero cost, and, for a  3) = a ∅ ; lower bound and capacity of an edge are displayed in brackets, the costs are displayed in italic.Assignment π is not Pareto optimal, because there is a flow of negative total cost in the graph.For instance, the flow (displayed in bold) that sends one unit along each of the edges (s, 1), (1, a), (a, t), (s, 2), (2, c), (s, 3), (3, c) and two units along (c, t) induces a feasible assignment π with π (1) = a and π (2) = π (3) = c, which Pareto-dominates π Both lower bound and capacity of edge (s, i) are equal to 1 iff π(i) i a ∅ holds.Unless otherwise specified above, the lower bound of edge e ∈ E is 0, its capacity is 1, and its cost is 0.
Assume there is an integer flow f of negative total cost.Consider the assignment π defined by π (i) = a iff f sends flow through edge (i, a).Then, by construction we must have π (i) ∼ i π(i) or π (i) i π(i) for each i ∈ N , where the latter holds for at least one agent i ∈ N by the negative total cost of f .Thus, π is not Pareto optimal.
If, on the other hand, π is not Pareto optimal, then there is an assignment π with π (i) ∼ i π(i) or π (i) i π(i) for each i ∈ N , where the latter holds for at least one i ∈ N .The integer flow f that, for each i ∈ N and a ∈ A with π (i) = a, sends one unit along the edges (s, i), (i, a), (a, t) has negative total cost.
Therewith, for verifying if π is Pareto optimal it is sufficient to find an integer minimum cost flow in instance C.Under the use of a standard transformation to remove non-zero lower bounds (see Ahuja et al. 1993, Chapter 2.4), such an integer minimum cost flow can be determined in polynomial time by applying, e.g., a network simplex algorithm (see Ahuja et al. 1993, Chapter 11); for instance, with |V | ∈ O(n + m), |E| ∈ O(m + n + mn) and maximum cardinality edge cost of 1, the algorithm of Tarjan (1997) In the remainder of Sect.3.2, we consider the computational complexity involved in maximizing the number of agents assigned to non-void activities in Pareto optimal assignments.In the framework of course allocation, if all agents have strict preferences, it is known that a Pareto optimal matching-that assigns an agent to an activity (course) only if the activity is acceptable for the agent-can be found in polynomial time (Cechlárová and Fleiner (2017); Kamiyama (2013)).Since in our setting (1) the agents' preferences are represented by weak orders and (2) Pareto optimality does not require individual rationality, these results do not immediately translate.For the latter reason, the computational intractability result by Cechlárová and Fleiner (2017) (for finding a Pareto optimal matching maximizing the number of agents assigned to a non-void activity if each agent can be assigned to at most one activity) does not immediately translate to our setting either.
By Theorem 3 we know that finding a Pareto optimal assignment that maximizes the number of agents assigned to non-void activities is NP-hard even for the case u(a) = n for each activity a.
The general problem of deciding if there exists a Pareto optimal assignment that assigns each agent to a non-void activity turns out to be computationally hard.
Theorem 6 It is NP-hard to decide whether s-GASP admits a Pareto optimal assignment that assigns each agent to a non-void activity.
Proof This is shown by a reduction from Exact Cover by 3-Sets (see Appendix).
However, as the following theorem shows, if we relax the constraints on the lower bound of the group sizes, the problem becomes computationally tractable.

Theorem 7
In s-GASP, if for each activity a ∈ A * we have (a) = 1 then in polynomial time we can find a Pareto optimal assignment that maximizes the number of agents assigned to a non-void activity.
Proof Recall that in the case (a) = 1 for all a ∈ A * a Pareto optimal assignment is also individually rational (see Proposition 1 and Fig. 1).Let k be the maximum number of agents assigned to non-void activities by an individually rational assignment (recall that, due to Proposition 3, such an assignment can be found in polynomial time).Hence, it is sufficient to find a Pareto optimal assignment π with #(π ) = k.
Given an instance I = (N , A, P, R) of s-GASP with (a) = 1 for all a ∈ A * , we construct an instance F of the min cost flow problem with directed graph G = (V , E). Set V = {s, t} ∪ N ∪ A * , and let the edges and their capacities be given as follows: for each i ∈ N , introduce edge (s, i) with capacity 1; for each a ∈ A * and i ∈ N introduce an edge (i, a) of capacity 1 if a i a ∅ holds; for each a ∈ A * , introduce edge (a, t) of capacity u(a).
We introduce non-zero costs on some edges of the graph: for each a ∈ A * and i ∈ N , edge (i, a) Observe that there is a one-to-one correspondence between a feasible assignment π with #(π ) = k and a (feasible) flow of size k.First, given π , sending a unit of flow along the sequence of edges (path) (s, i), (i, a), (a, t) iff i is assigned to activity a yields a flow of size k from s to t meeting all the edge capacity constraints.Second, a flow of size k from s to t must send a total of k units through edges (i, a) with i ∈ N and a ∈ A * such that at most one unit is sent through (s, i) for any i ∈ N ; since the capacity constraints of the edges (a, t) correspond to u(a) for a ∈ A * , the assignment π defined by setting π(i) = a iff f sends a unit of flow through edge (i, a) is feasible.Now, let f be a minimum integer cost flow of size k in instance F. Then f induces the assignment π by setting π(i) = a iff f sends a unit of flow through edge (i, a).Assignment π is Pareto optimal since otherwise a flow f of lower total cost than the total cost of f could be induced.
Recall that due to Proposition 1 in the case (a) = 1 for each a ∈ A * , also any strictly core stable, core stable, or individually stable assignment is individually rational.In addition, in this case virtual (strict) core stability coincides with (strict) core stability, and virtual individual stability coincides with individual stability.Hence we can state the following corollary.

Corollary 1
In s-GASP, if for each activity a ∈ A * we have (a) = 1, then in polynomial time we can find a maximum individually rational assignment that is Pareto optimal, (virtually) individually stable, (virtually) core stable and (virtually) strictly core stable.

Stable assignments
The good news is that for several stability concepts, a corresponding assignment always exists and can efficiently be found, as, for instance, the following theorem shows.

Theorem 8
In s-GASP, a strictly core stable assignment always exists and can be found in polynomial time.
Proof We present in Algorithm 1 a polynomial-time algorithm for finding a strictly core stable assignment.
Outline The basic idea behind Algorithm 1 is as follows.Starting with a feasible assignment π , for each agent i and each activity b which i prefers to a = π(i), we check whether there is a subset of agents including agent i that want to deviate to b such that the resulting assignment is feasible.That is, we check whether there is a set of agents E ⊃ π b such that (1) for all j ∈ E we have that b j π( j) holds (recall that for agent i it holds that b i π(i)) and (2) π with π (i) = b for i ∈ E and π ( j) = π( j) for j ∈ N \ E is a feasible assignment.In order to do so, we store all activities agent i prefers over a = π(i) into set D (lines 5-6).While D is non-empty (line 7), we take an activity b ∈ D and compute the set of agents B which are not worse off by deviating to b (lines 8-9).Then, for each activity c ∈ A \ {b}, we compute the possible numbers of agents in the set π c that agree with joining b and can be removed from π c while still enabling a feasible assignment-these numbers are stored in the set R c (lines 10 − 17).Note that 0 must be removed from R a since we need to include agent i (line 18).Given these numbers, we then verify if-including i and the agents in π b -these add up to an integer contained in [ (b), u(b)] by taking exactly one number from each activity (note that for activity b we need to include the whole amount |π b | of agents assigned to b under π ; line 20).If this is the case we can assign a subset of agents including {i} ∪ π b to B, and we update our assignment accordingly (lines 21 − 29).Finally, we update D to the set of activities different from b that agent i prefers over the activity she is currently assigned to (line 30).
Termination and correctness Each for-loop in the algorithm iterates over at most max{m, n} elements.For the inner while-loop starting in line 7 ("while D = ∅"), note that the last line of the loop (line 30) implies that the set D in the statement of the loop is updated to a proper subset of itself.Next, observe that during execution of the algorithm, an agent either remains assigned to the originally assigned activity, say a, or is assigned to some activity that does not make her worse off than a (in lines 21, 22, 24 or 26); in addition, whenever some agent is assigned to a new activity, at least one agent is better off than before.Hence, at most mn times some agents can be assigned to a new activity.Now, for the outer while-loop starting in line 3 ("while N \ N = ∅"), consider lines 32-35.If agent i is not assigned to a new activity, the set N is augmented by the singleton set {i} in line 33.If she is assigned to a new activity, N is set to the empty set in line 35, and the loop in line 3 ("while N \ N = ∅") re-starts with the whole set N \ N = N .However, at the end of the loop, we either augment the set N or set N = ∅, and the latter can happen at most mn times.Thus, the algorithm terminates.For correctness, observe that the algorithm terminates when each agent i is contained in N .By construction, the algorithm sets N = ∅ whenever it is possible to assign some agent i to an activity b with b i π(i), such that for some set E ⊃ π b it holds that (1) each agent j ∈ E \ {i} is not worse off with a deviation towards b, and (2) the resulting assignment is feasible.Therefore, the assignment π which is finally determined by the algorithm is strictly core stable.
Running time As far as the running time of Algorithm 1 is concerned, its bottleneck is to decide whether we can add up the above-mentioned numbers to be in the interval [ (b), u(b)].That problem reduces to the Multiple-Choice Subset-Sum problem (Pisinger 1995), which can be stated as follows: Given k classes N 1 , . . ., N k , each class N i containing non-negative integer weights w 1i , . . ., w n i i , and a capacity bound c, we ask whether we can select exactly one element from each class such that the total weight sum adds up to c.For our problem, the weights in class N i correspond to the possible numbers of agents in the set R a i for activity a i .We can now apply Pisinger's algorithm (Pisinger 1995) 5 , which has a complexity in O(ab), where a is the largest weight-hence bounded by the number n of agents in our case-and b is the number of all weights, which is bounded by m(n + 1) in our case since there are at most as many weights per activity as the number of agents plus 1 (for weight 0).We hence have a running time of O(mn 2 ) per execution of line 20.For each agent, we need to execute line 20 of our algorithm at most m • mn times.Thus, the overall running time of Algorithm 1 can roughly be bounded by O(m 3 n 4 ).
Recall that a strictly core stable assignment is also core stable and individually stable.Hence, as a consequence of the above theorem, also a core stable and individually stable assignment always exists and can efficiently be found.As it turns out, an analogous result holds for virtually individually stable assignments.
Algorithm 1 Algorithm for finding a strictly core stable assignment in an instance (N , A, P, R) of s-GASP 1: Let π be a feasible assignment.2: R a := ∅ for all a ∈ A, N := ∅, B := ∅, i := 0, π ( j) = a ∅ for all j ∈ N 3: while N \ N = ∅ do 4: i := min N \ N 5: a := π(i) 6: D := {b ∈ A : b i a} 7: while D = ∅ # check whether there is a deviation that makes i better off do 8: take b ∈ D 9:

Theorem 9 In s-GASP, a virtually individually stable assignment always exists and can be found in polynomial time.
Proof In an instance (N , A, P, R) of s-GASP, we initially assign each agent to a ∅ , i.e., set π(i) = a ∅ for i ∈ N .For a ∈ A * with (a) ≥ 2, if no agent is assigned to such a, then (a) ≤ |π a | + 1 cannot hold.Hence, in what follows, we only consider activities a ∈ A * with (a) = 1.For 1 ≤ i ≤ n, assign agent i to the best ranked such activity a i a ∅ with |π a | < u(a) and update π (i.e., set π(i) = a while π( j) remains unchanged for j ∈ N \ {i}).The resulting assignment π is virtually individually stable: for each agent i, by construction, each activity a with a i π(i) has (1) no agent assigned to and (a) ≥ 2-which implies that the agent alone cannot deviate to a without violating the lower bound on a-or (2) already u(a) agents assigned to, and thus the agent cannot join a without violating the upper bound on a.
In contrast, a virtually core stable (and thus a virtually strictly core stable) assignment does not always exist, as the following example shows.It corresponds to the phenomenon referred to as Condorcet's voting paradox (Marquis de Condorcet 1785) which reappears in many settings dealing with preferences.
Example 5 Let N = {1, 2, 3} and A * = {a, b, c}, with a 1 b 1 c 1 a ∅ , b 2 c 2 a 2 a ∅ , and c 3 a 3 b 3 a ∅ .The restrictions on the activities are given by (x) = 2 and u(x) = 3 for each x ∈ A * .By the restrictions given, there is at most one non-void activity to which agents can be assigned.Clearly, for any activity z ∈ A, there is an activity y ∈ A * such that two agents prefer y to z.As a consequence, there can be no virtually core stable assignment.
In addition, the problem to decide whether or not a virtually strictly core stable assignment exists turns out to be computationally hard.
Theorem 10 It is NP-complete to decide whether s-GASP admits a virtually strictly core stable assignment, even when each agent has strict preferences and for each activity a ∈ A * we have u(a) = n.Proof For membership in NP, we check if assignment π is virtually strictly core stable as follows.For each agent i and each activity a i π(i) such that |π a | < u(a) (otherwise, a deviation towards a would violate its capacity constraint), determine the set E(i, a) = { j ∈ N \ {i} | a j π( j)}.Observe that E(i, a) ⊃ π a holds.Now, it remains to check if |E(i, a) ∪ {i}| ≥ (a) holds, because then-with π a < u(a)it follows that there is a set E with i ∈ E, E ⊃ π a such that a i π(i) and a j π( j) for each j ∈ E (e.g., take set E made up of π a ∪ {i} together with max{0, (a) − |π a | − 1} agents of E(i, a) \ π a ).Determining the set E(i, a) and checking whether |E(i, a) ∪ {i}| ≥ (a) holds can be done in polynomial time for each agent i and activity a, and hence we can check whether π is virtually strictly core stable in polynomial time.
For NP-hardness we provide a reduction from Exact Cover by 3-Sets , making use of Example 5 as a gadget.Given an instance X , Z of X3C, we define the instance and (y i ) = 9.For each a ∈ A * , let u(a) = |N |.For each i ∈ {1, . . ., p}, the agents v i,1 , v i,2 , v i,3 represent element i ∈ X ; the set Y = {y 1 , . . ., y p } represents the set Z, where, for i ∈ X and j ∈ {1, 2, 3}, we denote by y i j the activity in Y that refers to the set Z i j .Since any virtually strictly core stable assignment is individually rational, in the profile P we omit the activities ranked below a ∅ ; the rankings of the agents v i,1 , v i,2 , v i,3 are given as follows (for the sake of readability, we omit subscripts in the rankings): Note that each set Z contains three elements, and hence each y i , 1 ≤ i ≤ p, is preferred to a ∅ by exactly 9 agents.We show that there is an exact cover in instance X , Z if and only if there is a virtually strictly core stable assignment in instance I.
Assume there is an exact cover C. Consider the assignment π defined by π(v i,h ) = y j if i ∈ Z j and Z j ∈ C, for i ∈ {1, . . ., p} and h ∈ {1, 2, 3}.Since C is an exact cover, assignment π is well-defined and feasible; note that each agent is assigned to an activity she ranks first, second or third.In addition, note that for Z j ∈ C, each agent that prefers y j to a ∅ is assigned to y j .Assume a set of agents E wishes to deviate to another activity d, such that at least one member i ∈ E prefers d over π(i) while there is no j ∈ E with π( j) j d.By the definition of π , d ∈ {y i | 1 ≤ i ≤ p} holds.Observe that π d = ∅ holds because C is an exact cover: for each i, exactly one of Z i,1 , Z i,2 , Z i,3 is in C, and therefore to exactly one of y i,1 , y i,2 , y i,3 some agents are assigned.Due to (d) = 9, it hence follows that each agent of those who prefer d to a ∅ must prefer d to the assigned activity, which is impossible since, by construction of the instance, for at least one of these agents j the assigned activity is top-ranked, i.e., π( j) j d holds.Therewith, π is virtually strictly core stable.
Conversely, assume there is a virtually strictly core stable assignment π .Assume that there is an agent v i,h who is not assigned to one of the activities y i 1 , y i 2 , y i 3 .Then, by (y i ) = 9 and the fact that exactly 9 agents prefer y i to a ∅ for each i ∈ {1, . . ., p}, it follows that no agent is assigned to one of y i 1 , y i 2 , y i 3 ; in particular none of v i,1 , v i,2 , v i,3 is assigned to one of these activities.Analogously to Example 5 it then follows that there is no virtually strictly core stable assignment, in contradiction with our assumption.
Thus, π assigns each agent v i,h to one of the activities y i 1 , y i 2 , y i 3 .For each i ∈ {1, . . ., p}, by (y i ) = 9 and the fact that exactly 9 agents prefer y i to a ∅ it follows that to exactly one of y i 1 , y i 2 , y i 3 exactly 9 agents are assigned, while no agent is assigned to the remaining two activities.As a consequence, the set As a consequence of the above theorem, we obtain the following corollary.
Corollary 2 It is NP-complete to decide whether s-GASP admits a virtually core stable assignment, even when each agent has strict preferences and for each activity a ∈ A * we have u(a) = n.Proof In the instance considered in the proof of Theorem 10, an assignment is virtually strictly core stable if and only if it is virtually core stable.More precisely, analogously to the second part of that proof, it follows that in a virtually core stable assignment for each i the following holds: to exactly one of y i 1 , y i 2 , y i 3 , exactly 9 agents are assigned, while no agent is assigned to the remaining two activities.Therewith, any group deviation would require an unused activity, and by the agents' strict orders over their three top choices, the two solution concepts coincide.However, recall that for the case of (a) = 1 for each a ∈ A * , we get a positive complexity result (see Corollary 1 in Sect.3.2).In particular, in this case a virtually strictly core stable assignment that maximizes the number of agents assigned to a non-void activity can be found in polynomial time.
Finally, we point out that in polynomial time we can verify whether a given assignment is stable, for each of the stability concepts considered in this section.While for (virtual) individual stability this is rather straightforward, checking for strict core stability and virtual strict core stability is less obvious: Algorithm 1 checks for the former (as a part of the algorithm) as described in the proof of Theorem 8; for the latter, we refer to the first lines of the proof of Theorem 10.Note that the respective notions of (virtual) core stability can be verified in a similar manner, with the difference that each member of the deviating group must prefer the new activity to the assigned one (and hence that activity is either a ∅ or currently unused).
Let us now turn to stable assignments that maximize the number of agents assigned to non-void activities.Concerning stable assignments, we have already seen (stated in Theorem 10, Corollary 2) that it is NP-complete to decide whether a virtually (strictly, respectively) core stable assignment exists, even if the upper bound of each activity equals n.This implies hardness for the corresponding optimization problems.In contrast, recall that a strictly core stable assignment and a virtually individually stable assignment always exist (stated in Theorems 8 and 9).However, deciding whether or not there is a strictly core stable or a virtually individually stable assignment that assigns each agent to a non-void activity-and thus the corresponding optimization problem of maximizing the number of agents assigned to a non-void activity-turns out to be computationally hard even if the upper bound of each activity equals n, as we will show in the following theorems.The complexity of the optimization problem remains open for individual stability and for core stability (unless (a) = 1, for which it is solvable in polynomial time as shown by Corollary 1 in Sect.3.2).
Theorem 11 It is NP-complete to decide whether s-GASP admits a virtually individually stable assignment that assigns each agent to some a ∈ A * , even when each agent has strict preferences and for each activity a ∈ A * we have (a) = 3 and u(a) = n.
Proof The proof follows analogously to the proof of Theorem 2.
In a similar manner as Theorem 2, we can prove the following theorem.
Theorem 12 It is NP-complete to decide whether s-GASP admits a strictly core stable assignment that assigns each agent to some a ∈ A * , even when for each activity a ∈ A * we have (a) = 3 and u(a) = n.Proof This is shown by a reduction from Exact Cover by 3-Sets (see Appendix).

Envy-free assignments
As already mentioned, assigning each agent to the void activity a ∅ results in an envyfree assignment.In addition, in polynomial time it can be verified whether a given assignment is envy-free by simply checking, for each agent, if she prefers to the activity she is assigned to one of the activities to which some other agent is assigned.On the other hand, for envy-freeness maximizing the number of "active" agents turns again out to be hard, even in a restricted setting.
Theorem 13 It is NP-complete to decide whether s-GASP admits an envy-free assignment that assigns each agent to some a ∈ A * , even when each agent has strict preferences and for each activity a ∈ A * we have (a) = u(a) = 3. Proof This is shown by a reduction from Exact Cover by 3-Sets (see Appendix).
However, we obtain tractability for envy-freeness if we loosen the constraints on the upper bounds of the group sizes: Clearly, if there is an activity with "unlimited" capacity (i.e., its upper bound equals n), we can assign all agents to it and obtain envy-freeness.It is not clear yet whether the problem becomes tractable if (a) = 1 holds for all a ∈ A * .This is the case though if all preference orders are strict, as the following proposition shows.

Proposition 4
In s-GASP, if all agents have strict preferences and we have (a) = 1 for all a ∈ A * , then it can be decided in polynomial time if there exists an envy-free assignment which assigns all agents to a non-void activity.
Proof A simple greedy algorithm can determine if there exists such an envy-free assignment.The first step is to assign each agent to her most preferred non-void activity; this meets the lower bound of each activity because of (a) = 1 for all a ∈ A * .If the resulting (provisional) assignment π is feasible, i.e., for all activities a ∈ A * the statement u(a) ≥ |π a | holds true, we are done.If this is not the case, we remove all activities a with u(a) < |π a | from the set of activities (envy-freeness will only be accomplished if no agent is assigned to any of these activities) and start over with the first step.This algorithm either stops because all activities have been removed, or it produces an envy-free assignment which assigns all agents to a non-void activity.

Envy-freeness versus Pareto optimality
In many social choice settings, there is a tension between envy-freeness and Pareto optimality.This is also the case for our simplified group activity selection problem, as the following propositions show.
Proposition 5 For any n ≥ 2, there is an instance (N , A, P, R) of s-GASP with (a) = 1 for each a ∈ A * , for which there does not exist an assignment π which is both Pareto optimal and envy-free.
Proof We provide a proof for n = 2, which easily extends to n > 2. Consider the instance with N = {1, 2}, A * = {a}, with the rankings a 1 a ∅ and a 2 a ∅ , and the restrictions given by (a) = u(a) = 1.Any Pareto optimal assignment assigns exactly one agent to a, which is clearly not envy-free.
Interestingly, this tension also holds if the only relevant constraint is the lower bound of the activities (i.e., u(a) = n for all a).Proposition 6 For any n ≥ 6, there is an instance (N , A, P, R) of s-GASP with u(a) = n for each a ∈ A * , for which there does not exist an assignment π which is both Pareto optimal and envy-free.
Proof We provide the proof for n = 6, which easily extends to n > 6.Consider the instance of s-GASP with N = {1, 2, 3, 4, 5, 6}, A * = {a, b, c} and for each x ∈ A * we have (x) = 3, u(x) = 6.The rankings are Due to the feasibility constraints, there are only 4 types of feasible assignments: (i) between three and five agents are assigned to the same activity x = a ∅ , and the rest to a ∅ ; (ii) all agents are assigned to the void activity; (iii) all agents are assigned to the same activity x = a ∅ ; (iv) three agents are assigned to the same activity x = a ∅ and the other three agents are assigned to another activity y / ∈ {x, a ∅ }.
Observe that the assignments of type (i) and (ii) are Pareto-dominated by some assignment of type (iii).To verify this, consider an assignment of type (i) first.If it assigns exactly three, four or five agents to some activity, say a, and the rest to a ∅ , then this assignment is Pareto-dominated by the assignment that assigns all agents to a, because the agents previously assigned to a ∅ are made better off.Next, consider the only assignment of type (ii), i.e., the assignment that assigns all agents to a ∅ .That assignment is Pareto-dominated by any assignment of type (iii) since the latter would make all agents better off.
However, an assignment π 1 of type (iii) is envy-free but not Pareto optimal.Due to the symmetrical construction of the preferences profiles, we can assume without loss of generality π 1 (i) = a for all i ∈ N .But then the assignment is Pareto-dominated by the assignment Finally, an assignment of type (iv) cannot be envy-free.Without loss of generality, we can assume x = a and y = b, because by construction the pair (a, b) is symmetric to all other pairs.Assume, for the sake of contradiction, that there is such an envy-free assignment.Agents 1 and 4 must then be assigned to activity a and agents 2 and 5 to activity b.As the preference profiles of the remaining agents both rank a strictly better than b, the assignment cannot be an envy-free assignment.
Propositions 5 and 6 imply that there is no mechanism that determines an assignment that is both Pareto optimal and envy-free for each given instance (N , A, P, R) of s-GASP, even if there are no upper or lower bound restrictions on the sizes of the activities.
The decision problem whether there is an assignment which is both Pareto optimal and envy-free turns out to be NP-hard even if we have u(a) = n for each activity a ∈ A * .A finer placement of that decision problem in the computational complexity hierarchy is an interesting task for future research.Also, whether or not the problem remains NP-hard if (a) = 1 holds for each a ∈ A * remains an interesting open question.
Theorem 14 It is NP-hard to decide whether s-GASP admits an assignment which is both Pareto optimal and envy-free, even when each agent has strict preferences and for each activity a ∈ A * we have u(a) = n.
Proof We prove hardness by reducing from X3C.Given an instance X , Z of X3C, we construct instance the sets containing element i ∈ X .We associate set Z j with activity y j ; in particular, we denote by y i j the activity in set Y = {y i | 1 ≤ i ≤ p} that refers to the set Z i j .Next, let σ be a fixed strict order over A * .
A main tool of the proof is to make use of the example used in the proof of Proposition 6 for each i ∈ {1, . . ., p}; hence, for each i, activities a i , b i , c i represent activities a, b, c of that example.For each i ∈ {1, . . ., p} let and the activities representing the three sets containing element i in instance X , Z .The agents' preferences6 are such that for each v i,t ∈ N , (i) a a ∅ for each a ∈ A i , (ii) a ∅ a for each a ∈ A * \ A i , and (iii) for d, e ∈ A * \ A i we have d e ⇔ d σ e; for each 1 ≤ i ≤ p the rankings restricted to the activities in A i ∪ {a ∅ } are -for agents v i,1 and v i,4 : y i 1 y i 2 y i 3 a i b i c i a ∅ , -for agents v i,2 and v i,5 : y i 2 y i 3 y i 1 b i c i a i a ∅ , -for agents v i,3 and v i,6 : Observe that each activity y j ∈ A * is ranked above a ∅ by exactly 18 agents (the six agents v i,1 , . . ., v i,6 for each of the three elements i ∈ Z j ); each of the activities {a i , b i , c i } is is ranked above a ∅ by exactly the six agents v i,1 , . . ., v i,6 .
The restrictions on the activities are given by [18, n] for all y ∈ Y , where n = |N |.We claim that there is an exact cover by 3-sets in instance X , Z if and only if there is an assignment which is both envy-free and Pareto optimal in instance I of s-GASP.
Assume there is an exact cover C in instance X , Z .Construct assignment π in instance I of s-GASP by, for each Z j ∈ C, assigning the 18 agents who prefer y j over a ∅ to y j .By the fact that C is an exact cover, for each i exactly one Z i 1 , Z i 2 , Z i 3 is in C; i.e., for each agent, to exactly one of the three top-ranked activities some agents (in fact, exactly 18 agents) are assigned.Since π assigns each agent to an activity she prefers over a ∅ , π is envy-free.To verify Pareto optimality, recall that each activity y ∈ Y requires at least 18 agents.Also, recall that each agent is assigned to some y ∈ Y , i.e., to one of her three top-ranked activities.Assume assignment π Paretodominates π .Then π must assign an agent V to an activity c (say c = y i 2 ) she prefers over π(V ) (say, π(V ) = y i 1 ).But since π must be individually rational (because π is individually rational), π needs to assign all the 18 agents to c that prefer c over a ∅ ; these 18 agents include the six agents with top-ranked activity π(V ), which contradicts with our assumption that π Pareto-dominates π .
On the other hand, assume there is a Pareto optimal and envy-free assignment π in instance I of s-GASP.
For the sake of contradiction, assume that for some agent v = v i,t it holds that π(v) / ∈ {y i 1 , y i 2 , y i 3 }.By envy-freeness, this implies that none of the six agents v i,1 , . . ., v i,6 is assigned to an activity y ∈ {y i 1 , y i 2 , y i 3 }.
We will now show that v cannot be assigned by π to an activity she ranks below a ∅ .Assume the opposite, i.e., π assigns agent v to some activity d she ranks below a ∅ .
Recall that the agents v i,1 , . . ., v i,6 all have the activities of A i top-ranked and have the same restricted ranking over A * \ A i .By envy-freeness, the five agents of {v i,1 , . . ., v i,6 } different from v must therefore be assigned either to d or to a ∅ under π .By the pigeonhole principle, at least three of these agents, denoted by v 1 , v 2 , v 3 , are jointly assigned to d or to a ∅ .In the latter case, assigning that three agents to a i and leaving the rest unchanged yields a feasible assignment which makes v 1 , v 2 , v 3 better off but no agent worse off.In the other case that the three agents are assigned to d, we distinguish the following cases.
Case 1: d ∈ {a j , b j , c j } for some j.Then (d) = 3 holds.As a consequence, assigning v to a ∅ instead of d and leaving the rest unchanged yields an assignment under which v is better off and none one the agents worse off, in contradiction with the fact that π is Pareto optimal.
Case 2: d ∈ {y j 1 , y j 2 , y j 3 } for some j.By assumption, the agents v, v 1 , v 2 , v 3 are assigned to d. Recall that we have (d) = 18.If all 18 agents who prefer d over a ∅ were assigned to d, reassigning v, v 1 , v 2 , v 3 to a i and leaving the rest unchanged would yield an assignment which makes no agent worse off but v, v 1 , v 2 , v 3 better off, in contradiction with the Pareto optimality of π .Thus, at least one of these 18 agents, say v h,t , has to be assigned to an activity e which she prefers over d.By the fact that d is among the three top-ranked activities of agent v h,t , it follows that e ∈ {y h t | 1 ≤ h ≤ p, 1 ≤ t ≤ 3} and hence requires at least 18 agents itself.Observe that one of the agents v h,1 , v h,2 , v h,3 , has d top-ranked, and hence cannot be assigned to e. Therefore, since there are exactly 18 agents preferring e over a ∅ , at least one agent w who prefers a ∅ over e has to be assigned to e. Now consider the two agents v and w.By envy-freeness, e must be ranked below d in the ranking of v, and d must be ranked below e in the ranking of w.This implies that both agents rank both activities d, e below a ∅ , and thus by the definition of their preferences by use of σ , both agents have either d e (if d σ e), or e d (if e σ d), a contradiction.
Therewith, if v is not assigned to one of her three top-ranked alternatives under π , she must be assigned to a ∅ or to one of a i , b i , c i .However, by envy-freeness none of the agents v i,1 , . . ., v i,6 can be assigned to one of her three top-ranked activities.As a consequence, all of them must be assigned to a ∅ or to one of a i , b i , c i .However, as shown by means of the instance used in the proof of Proposition 6 (with a i , b i , c i instead of a, b, c), this cannot be done in a way that π is both envy-free and Pareto optimal.
Therefore, each agent must be assigned to one of her three top-ranked alternatives.To any y j ∈ Y , if some agents are assigned to y j it must be exactly the 18 agents who rank y j over a ∅ -observe that these are the 6 agents v i,1 , . . ., v i,6 for each of the 3 indices i for which, in instance X , Z of X3C element i ∈ Z j holds.Hence, the collection of sets Z = {Z j | y j ∈ A * with |π y j | = 18} forms an exact cover by 3-sets in instance X , Z of X3C.

On balanced assignments
In this section, we consider a special kind of constraint.We assume that for each activity, the upper bound equals the lower bound, i.e., for all activities a ∈ A * , we have (a) = u(a) = q for some q ∈ N-an activity can only take place if exactly q agents are assigned to it.As a first step, we focus on Pareto optimal and maximum individually rational assignments respectively (Table 2 summarizes the main results for this section).Observe that with this kind of constraint, maximizing the number of agents assigned to an activity is equivalent to maximizing the number of activities that can take place.
The considered constraints can be thought of as asking for some kind of balancedness as done, e.g., in the Monroe scheme for proportional representation (Monroe 1995).Such constraints are natural in many applications.For example, for q = 1, the time slots available for taking an oral exam with a teacher can be seen as activities on which students express their preferences.Each student can only be assigned to one of these dates.For q = 2, the activities could be squash courts or climbing routes and can only be used by pairs of agents.In both cases, one naturally would be interested in satisfying as many students/players as possible (as well as in charging the maximum number of time slots/courts or routes), while respecting individual rationality.
Maximum individually rational assignments for such settings can be found in polynomial time for q = 1 and for two-agents activities (q = 2); these results follow from a more general theorem for weighted many-to-one matchings (Arulselvan et al. 2018, Theorem 3).In contrast, for q ≥ 3, the problem turns out to be NP-complete as we show below.We note that the construction from Arulselvan et al. (2018, Theorem 1) together with the fact that Independent Set is NP-hard on q-regular graphs for each fixed q ≥ 3 (Fricke et al. 1998) implies that deciding whether there is an individually rational assignment that assigns ≥ k agents to non-void activities in this setting is NP-hard.
Theorem 15 For each fixed q ≥ 3, it is NP-complete to decide whether s-GASP admits an individually rational assignment that assigns each agent to some a ∈ A * , even when each agent has strict preferences and for each activity a ∈ A * we have (a) = u(a) = q.
Proof Membership in NP is easy to see.We show NP-hardness by reduction from Perfect H-matching, where we are given a graph G = (V , E) and a second graph H .The task is to cover the graph G with vertex-disjoint copies of H , i.e., the vertex  We indicate whether the corresponding problem is solvable in polynomial time (in P), NP-hard (NP-h), or NP-complete (NP-c) sets of the copies of H must be a partition of V .The problem to decide if such a cover exists is NP-complete for all graphs H containing a component with at least three vertices (Kirkpatrick and Hell (1978); our notation is similar to Berman et al. (1990)).Now, let q ≥ 3 and K q be the complete graph on q vertices (i.e., a clique of size q).Then, Perfect H-matching with H = K q is NP-complete by the result by Kirkpatrick and Hell (1978) since K q itself is a component containing at least three vertices.Note that in this particular version of Perfect H-matching, the task is to find a partition of the vertex set V such that each subset of the partition has size q and is fully connected in G.
Given an instance of Perfect H-matching with H = K q , we construct the instance of s-GASP as follows.
Let V = {v 1 , v 2 , . . ., v n } be the set of vertices of G. Further, let c q be the number of cliques of size q in G and let C = {C j | 1 ≤ j ≤ c q } be the corresponding subsets of vertices.Note that C can be computed in polynomial time since q is a constant.For each clique C j ∈ C we create an activity a j .The set A of activities is thus A = {a ∅ }∪ c q j=1 {a j }.Then, we create an agent i for each vertex v i and construct her preference as follows: Let A + i be the set of activities corresponding to the cliques {C j ⊆ C | v i ∈ C j }, i.e., the cliques of size q that contain the vertex v i .The agents' preferences are such that (i) a i a ∅ for each a ∈ A + i , and (ii) a ∅ i a for each a ∈ A * \ A + i .The ranking of the activities in A + i and A * \ A + i can be chosen arbitrarily.Now, the restrictions R are given by |π a | ∈ {0, q} for all a ∈ A * .Then there exists a vertex-disjoint cover of G if and only if there is an individually rational assignment as required.
"⇒" Let S ⊆ C cover the graph with vertex-disjoint copies of the complete graph with q vertices.For each clique C j ∈ S, we assign all agents i where v i ∈ C j to the activity a j .By construction, the restrictions are satisfied and each agent is assigned to exactly one (non-void) activity ranked higher than the void activity.Hence, the assignment is individually rational.
"⇐" Let π be an individually rational assignment of the agents to non-void activities that satisfies |π a | ∈ {0, q} for each activity a ∈ A * .Let J be the set of indices of the activities a j with |π a j | = q.Then, S = j∈J {C j } covers the graph G with vertex-disjoint copies of the complete graph with q vertices (this follows from the fact that each agent is assigned to exactly one non-void activity).
Clearly, the instance of s-GASP can be constructed in polynomial time.
As alluded to above (see remark preceding Theorem 15), the following corollary can be derived without Theorem 15 from known results (Arulselvan et al. 2018;Fricke et al. 1998).However, the corollary is also a direct consequence of Theorem 15, since for k = n all agents have to be assigned to non-void activities.
Corollary 3 Let k ∈ N.For each fixed q ≥ 3 it is NP-complete to decide whether s-GASP admits an individually rational assignment that assigns at least k agents to non-void activities, even when each agent has strict preferences and for each activity a ∈ A * we have (a) = u(a) = q.
Turning to Pareto optimal assignments, it turns out that we can find such an assignment in polynomial time if both lower and upper bound equal two for each activity (Corollary 4).Again this establishes the boundary between polynomial time solvable and computationally intractable cases: for the case of (a) = u(a) = 3 for each activity a ∈ A * , the problem of finding a Pareto optimal assignment becomes NP-hard as we will see in Theorem 17. Below we first show that with lower and upper bound equal to two for each activity it can be decided in polynomial time if a given assignment is Pareto optimal.The approach for providing this result can then be used to actually determine a Pareto optimal assignment in this case.
Theorem 16 Let (a) = u(a) = 2 for each activity a ∈ A * .Then, in s-GASP we can decide in polynomial time if a given assignment is Pareto optimal.
Proof Let I = (N , A, P, R) be an instance of s-GASP as required (with n = |N | and m = |A * |) and let π be an assignment of the agents N to the activities A. Recall that π is Pareto optimal if there is no feasible assignment π = π such that π (i) i π(i) for all i ∈ N and π (i) π(i) for at least one i ∈ N .We present a polynomial-time algorithm using a solver for finding a matching with maximum weight as a subroutine.A matching with maximum weight can be found in polynomial time (see, e.g., the work by Galil (1986)).Intuitively, we construct a graph G j for each agent j ∈ N that has a matching of a certain weight if the agent j can switch to a strictly preferred activity while no agent changes for the worse.
For each agent j ∈ N we construct an edge-weighted graph G j = (V , E) as follows (see also Figure 3; we define the edge weights at the end of the construction): For each agent i ∈ N \ { j} -and each activity a ∈ A * , we create the edges {v i , v a } and {v i , v a } if and only if a i π(i) -we introduce the edge {v i , v Next, we create the edges {v j , v a }, {v j , v a } for each a ∈ A * with a j π( j) and the edge {v j , v a ∅ j } in case a ∅ j π( j).Finally, we create the edge {v a , v a } for each activity a ∈ A * .
The edge-weights are now defined as follows: We set -the weight of each edge in {{v a , v a } | a ∈ A * } to 4 -the weight of each edge in {{v i , v a }, {v i , v a } | a ∈ A * and i ∈ N } to 3 -the weight of each edge in {{v i , v a ∅ i }} to 1.A matching M in the graph G j induces an assignment π as follows: If for an agent i ∈ N and an activity a ∈ A, we set π (i) = a.Otherwise, we set π (i) = a ∅ .Note that no agent is assigned to any activity a ∈ A * with {v a , v a } ∈ M. The following lemma shows that each maximum weight matching in the graph G j induces a feasible assignment π .
Lemma 1 Any maximum weight matching in G j contains, for each a ∈ A * , either the edge {v a , v a } or two edges {v i , v a }, {v i , v a } for some i, i ∈ N , i = i .
Proof Assume that a maximum weight matching M matches only one of the vertices v a , v a for some a ∈ A * .Then, by construction, replacing the respective edge in M with {v a , v a } leads to a matching of higher weight, in contradiction to the choice of M. On the other hand, if none of the vertices v a , v a is matched it would be possible to additionally include the edge {v a , v a } into M, contradicting the fact that M is a maximum weight matching.Hence, in M, for each a ∈ A * , both of v a , v a are matched and Lemma 1 is proven.♦ The following lemma establishes a connection between the weight of a maximum weight matching M in the graph G j and the number of agents whose assignment is induced by some edge {v i , v} ∈ M with i ∈ N and v ∈ V .

Lemma 2
The weight of a maximum weight matching M in G j is given by 4m + |{v i | i ∈ N and {v i , v} ∈ M for some v ∈ V }|.In particular, the weight of each matching in G j is bounded from above by Proof Consider a maximum weight matching M. Let a ∈ A * .If {v a , v a } ∈ M, then a weight of 4 is contributed to the weight of M. Otherwise, two edges {v i , v a }, {v i , v a } must be in M by Lemma 1, and hence a weight of 6 is contributed to the weight of M. On the other hand, if vertex v i , i ∈ N , is not matched with some vertex v a , v a , it can only be matched with the vertex v a ∅ i , thereby contributing a weight of 1 to the weight of M. Putting things together, it follows that the weight of M is composed of the number of matched vertices v i plus 4 times the total number of activities in A * .Hence, the weight of M is bounded by w. ♦ It remains to show that π is not Pareto optimal if and only if there is a j ∈ N such that there is a matching with weight w in G j (see Fig. 3 for an example).If π is not Pareto optimal, then there is a feasible assignment π that makes some j ∈ N better off while no agent changes for the worse.In the corresponding graph G j , π induces a matching M of weight w: For each a ∈ A * with (i) π a = ∅, include {v a , v a } in M, (ii) π a = ∅, include the edges {v i , v a } and {v i , v a } in M for i, i ∈ π a (i.e., for one of the agents i assigned to a match v i with v a , and for the other agent i ∈ π a , match v i with v a ); for each i ∈ π a ∅ , match the vertex v i with v a ∅ i .Note that for each agent i, v i is matched to some vertex in V \ V N .Thus, as indicated above, M has weight w.
On the other hand, assume there is a j ∈ N such that there is a matching M with weight w in G j .By Lemma 2, M matches each vertex v i with some other vertex.Together with Lemma 1, it follows that the induced assignment π which assigns each agent i ∈ N to a ∈ A * if and only if v i is matched with v a or v a , and to a ∅ otherwise, is feasible.Also, by construction, agent j is made better off while no agent changes for the worse; hence π is not Pareto optimal.
As a consequence of the above proof, we can also find a Pareto optimal (and individually rational) assignment in polynomial time.
Corollary 4 Let (a) = u(a) = 2 for each activity a ∈ A * .Then, in s-GASP we can find a Pareto optimal and individually rational assignment in polynomial time.
Proof Let I = (N , A, P, R) be such an instance of s-GASP.Start with an individually rational assignment π and repeatedly use the construction described in Theorem 16 to either verify that π is Pareto optimal or to obtain a feasible assignment π such that π (i) i π(i) for all i ∈ N and π (i) i π(i) for at least one i ∈ N .After O(|N | • |A|) repetitions, we will find a Pareto optimal assignment.By construction, this assignment is also individually rational.
However, our problem turns out to be computationally hard for k ≥ 3, as the following theorem shows.

Theorem 17
In s-GASP, for each fixed k ≥ 3 it is NP-hard to find a Pareto optimal assignment even when for each activity a ∈ A * we have (a) = u(a) = k.
Proof The proof proceeds similar to the proof of Theorem 3 (see Appendix).

Conclusion
We have investigated a simplified version of the group activity selection problem (GASP) where the assignment of agents to activities depends on the agents' preferences as well as on exogenous constraints.The constraints considered in this work were given by intervals restricting the number of participants for each activity.Depending on the existence and size of upper and lower bounds for the group sizes, this problem is similar to course allocation problems or one-sided matching and assignment problems.We have studied various solution concepts for this kind of constraints.
We consider the relations between these solution concepts to be interesting and aim at fostering an understanding of the subtleties and the computational hardness of the related decision problems as well as of the tension between different desirable properties of an assignment.Some of the questions we considered remain open.For instance, what is the computational complexity involved in finding individually stable assignments that maximize the number of agents engaged in some non-void activity?Similarly, how difficult is it to find a Pareto optimal assignment that maximizes the number of agents engaged in some non-void activity when exactly two agents can be assigned to each activity?In addition, while most of our hardness results hold even when restricted to strict preferences, it is open whether this is also true for Theorems 3, 6, 12, and 17.
While we have focused on the described class of constraints, the model of s-GASP is powerful enough to capture many real world applications, ranging from the considered course allocation and assignment problems to resource allocation, committee election, multiwinner elections, or hedonic games.Some practical examples of the general model are as follows: 1. a group of co-workers may have to decide in which project to work, given that each project needs a fixed number of participants; 2. the participants to a big workshop, who are too numerous to fit all in a single restaurant, want to select a small number of restaurants (say, between two and four) out of a wider selection, with different capacities, and that serve different types of food, and to assign each participant to one of them; 3. a group of pensioners have to select two movies out of a wide selection, to be played simultaneously in two different rooms, and each of them will be able to see at most one of them; 4. a group of students have to choose one course each to follow out of a selection, given that each course opens only if it has a minimum number of registrants and also has an upper bound; 5. a group of friends want to buy a set of pizzas; a pizza of a certain kind can be bought only if there are enough persons who want to eat from it; of course, the pizza can be ordered in several 'copies'; 6. a set of voters want to select a committee of k representatives, given that each voter will be represented by one of the committee members.
All these examples share the general structure of a s-GASP problem, i.e., there is a set of agents and a set of available activities; each agent has preferences over the possible activities; there are constraints bearing on the selection of activities and the way agents are assigned to them; the goal is to assign each agent to one activity, respecting the constraints, and respecting as much as possible the agents' preferences.
The nature of the constraints can vary: sometimes there are constraints that are local to each activity (like the considered bounds on the number of participants, but we might imagine more complex constraints), as Examples (1), ( 2), (4), (5) and also (3) if the rooms have a capacity smaller than the number of pensioners; sometimes there are global constraints that bear on the whole assignment (like bounds on the number of activities that can be selected; once again, we may consider more complex constraints), as in Examples (2), (3), (6).Sometimes each agent must be assigned to an activity (as in Example (1)), sometimes she has the option of not being assigned to any activity.
Typical constraints are hence (combinations of) the following cases: 1. each activity comes with a lower and/or upper bound on the number of participants; 2. no more than k activities can have some agent assigned to them; 3. the number of participants per activity should be balanced in some way.
Our investigations in Sect. 5 can be seen as belonging to both cases (1) and (3).Intuitively, if there are no constraints or the constraints are flexible enough, then agents go where they want and the problem becomes trivial.If the constraints are tight enough (e.g., perfect balancedness, provided |A| and |N | allow for it), then some agents are generally not happy, but they are unable to deviate because most deviations violate the constraints.The interesting cases can therefore be in between these two extreme cases.
Hence, an obvious next step is to derive a similar analysis for other classes of constraints as described in Sect. 2. In particular, it would be interesting to characterize families of constraints guaranteeing or not guaranteeing existence of a stable solution for the different solution concepts we considered, or exploring forbidden structures that prevent stability.
Also, it would be nice to provide a detailed analysis of the parameterized complexity of the hard cases, as done by Lee and Williams (2017) for the stable invitation problem, by Igarashi et al. (2017a, b) and Gupta et al. (2017) for GASP on social networks, and by Eiben et al. (2018) and Ganian et al. (2019) for other variants of GASP.One might also consider typed agents in the sense that agents express preferences over the roles taken by the agents, but not over their identity, as it is the case in the setting of hedonic coalition formation games, inspired by massively multiplayer online games.Here, players have to be matched by their preferences, which they can express over the possible roles they can play in the game, and over team compositions, see the work by Spradling and Goldsmith (2015).
3-element subsets of X ; we ask whether X can be covered by q sets of Z.We can assume that each element of X is contained in exactly three sets of Z (see Gonzalez (1985)) (this implies p = 3q holds).For i ∈ X recall that Z i 1 , Z i 2 , Z i 3 denote the three sets containing element i.
Given X , Z we construct instance I = (N , A, P, R) of s-GASP as follows.Let N = X , A * = {a 1 , . . ., a p }.We associate set Z j with activity a j ; in particular, we denote by a i j the activity in A * that refers to the set Z i j .Let P be some profile such that for each i ∈ N , (i) the ranking restricted to the four top-ranked activities corresponds to a i 1 ∼ i a i 2 ∼ i a i 3 i a ∅ , and (ii) for every remaining activity c we have a ∅ i c.
Consider instance I of s-GASP.Let π be a Pareto optimal assignment.If π assigns an agent i ∈ N to a ∅ or to an activity c with a ∅ i c, then by Pareto optimality of π it follows that there does not exist a Pareto optimal assignment μ with μ(i) i a ∅ for each agent i. I.e., either each Pareto optimal assignment or no Pareto optimal assignment assigns at least one agent i to an activity different from a i 1 , a i 2 , a i 3 .Therefore, determining a single Pareto optimal assignment suffices to decide whether a Pareto optimal assignment exists that assigns each agent to an activity she prefers to a ∅ .We complete the proof by showing that a Pareto optimal assignment μ with μ(i) i a ∅ for each i ∈ N exists if and only if there is an exact cover in instance X , Z of X3C.
If there is a Pareto optimal assignment for μ(i) i a ∅ for each i ∈ N , each agent i ∈ N is assigned to a non-void activity.By (a) = 3 for a ∈ A * and since each a j is preferred over a ∅ by exactly three agents, it follows that the collection D = {Z j | |π a j | = 3, 1 ≤ j ≤ p} is an exact cover for X .On the other hand, given an exact cover C for instance X , Z , the assignment π which assigns i ∈ N to activity a j for the unique set Z j of C which contains element i is feasible and assigns each agent to one of her top-ranked activities.As a consequence, π is Pareto optimal.Theorem 4 In s-GASP, it is coNP-complete to decide if a given assignment is Pareto optimal, even when each agent has strict preferences and for each activity a ∈ A * we have u(a) = n.
Proof Membership in coNP is easy to see.For the hardness part, we again make use of the NP-completeness of X3C.Consider instance X , Z of X3C where X = {1, . . ., 3q} and Z = {Z 1 , . . ., Z p } is a collection of 3-element subsets of X .We can assume that each element of X is contained in exactly three sets of Z. Instance I = (N , A, P, R) of s-GASP is given as follows: N = X and A * = {a 1 , . . ., a p }∪{b}.We denote by a i j the activity in A * \ {b} that refers to the set Z i j .P is a profile such that for each i ∈ N the ranking restricted to the four top-ranked activities is given by a i 1 i a i 2 i a i 3 i b; the restrictions in R are given by |π b | ∈ {0} ∪ [n, n], and, for a ∈ A * \{b}, |π a | ∈ {0}∪ [3, n].We show that X , Z is a "no"-instance of X3C iff the assignment π given by π(i) = b for all i ∈ N is Pareto optimal in instance I. Clearly, π is a feasible assignment.If there is an exact cover C for X , then the assignment π with π (i) = a j if i ∈ Z j and Z j ∈ C is feasible and satisfies π (i) i b for all i ∈ N .Thus, π is not Pareto optimal.On the other hand, if there is no exact cover for X , then any feasible assignment π = π must assign at least one agent i ∈ N to an activity over which i prefers activity b.Therefore, π is Pareto optimal.refers to the set Z i j .Let P be an arbitrary profile such that for each i ∈ N the ranking restricted to the four top-ranked activities is given by a i 1 ∼ i a i 2 ∼ i a i 3 i a ∅ and a ∅ i a for any a / ∈ {a i 1 , a i 2 , a i 3 }.The restrictions are given by |π a | ∈ {0} ∪ [3, n], for all a ∈ A * .Observe that each set Z ∈ Z consists of three elements and thus each activity a ∈ A is preferred over a ∅ by exactly three agents.
We now show that there is an exact cover in instance X , Z of X3C if and only if there is a strictly core stable assignment which assigns each agent to a non-void activity in the constructed instance I = (N , A, P, R) of s-GASP.
Assume there is an exact cover C. Let the assignment π be given by π(i) = a j , with i ∈ Z j and Z j ∈ C, for i ∈ N .Because C is an exact cover, π is well-defined and feasible (each set Z j contains exactly three elements of X , therefore either exactly three agents or no agent at all is assigned to activity a j ).Also, π assigns each agent to one of the three activities she has top-ranked.As a consequence, π is strictly core stable because no agent i can prefer any activity over π(i).
On the other hand, assume there is a strictly core stable assignment π which assigns each agent to a non-void activity.Observe that to any non-void activity either zero or exactly three agents are assigned: by construction, for any a with |π a | > 3, there are at least |π a | − 3 agents that prefer a ∅ to a; therefore, the singleton set of one such agent wants to deviate to a ∅ which would result in a feasible assignment.Hence, for exactly q activities a ∈ A * we have |π a | > 0 because each agent is assigned to a non-void activity.Now, assume an agent i is assigned to an activity a with a ∅ i a.Then, since each set Z ∈ Z contains exactly three elements, the group E of agents with E = { j ∈ N | a i 1 j a ∅ } ∪ π a i 1 is of size at least 3, and each e ∈ E has a e π(e) with our agent i ∈ E strictly preferring a i 1 over a = π(i).This, however, contradicts with strict core stability of π .Hence, each agent is assigned to one of her three top-ranked activities.By the fact that to each activity exactly three agents are assigned that means that D = {Z j | |π a j | > 0, 1 ≤ j ≤ p} is an exact cover for X .
Theorem 13 It is NP-complete to decide whether s-GASP admits an envy-free assignment that assigns each agent to some a ∈ A * , even when each agent has strict preferences and for each activity a ∈ A * we have (a) = u(a) = 3.
Proof We give a reduction from X3C.Given an instance X , Z of X3C construct instance I = (N , A, P, R) of s-GASP as follows.Let N = {1, . . ., 6q} and A * = {a 1 , . . ., a p } ∪ {b 1 , . . .b 3q }.Let σ be a fixed strict ranking on A = {a 1 , . . ., a p }.We denote by a i j the activity in A that refers to the set Z i j .Finally, let P be a profile such that (i) for each i ∈ X the ranking restricted to the (2 + p) top-ranked activities is given by a i 1 i a i 2 i a i 3 i b i i a ∅ i σ i , where σ i corresponds to the ranking σ restricted to the set A \ {a i 1 , a i 2 , a i 3 }; and (ii) for 1 ≤ i ≤ 3q the ranking of agent (3q + i) restricted to the (2 + p) top-ranked activities is b i (3q+i) a ∅ (3q+i) σ .The restrictions in R are given by |π a | ∈ {0}∪ [3,3], for a = a j ∈ A * with j ∈ {1, . . ., p}, and |π b | ∈ {0} ∪ [1, 1], for b = b j ∈ A * , j ∈ {1, . . ., 3q}.
We now show that there is an exact cover in instance X , Z of X3C if and only if there is an envy-free assignment as required in the constructed instance I = (N , A, P, R) of s-GASP.
Given an exact cover C, consider the assignment π defined by (i) for i ∈ N \ X : π(i) = b i and (ii) for i ∈ X : π(i) = a j iff i ∈ Z j with Z j ∈ C. Assignment π is feasible and assigns each agent to a non-void activity.Obviously, none of the agents i ∈ N \ X envies another agent because each of these agents is assigned to her topranked activity.On the other hand, each agent i ∈ X is assigned to one of her three top-ranked activities.By the fact that C is an exact cover, it follows that from the three top-ranked activities of agent i, only π(i) is used, i.e., a positive number of agents is assigned.Thus, also i ∈ X does not envy another agent.
On the other hand, let assignment π satisfy the stated properties.In particular, each agent is assigned to a non-void activity.Clearly, no agent i ∈ X can be assigned to some b j because otherwise agent 3q + j would envy i, i.e., π(i) ∈ A for all i ∈ X (1) holds.Let N = {g ∈ N \ X | π(g) ∈ {a 1 , . . ., a p }}.We distinguish the following cases.
Case 1: N = ∅.Then π(3q + i) = b i follows for each i ∈ {1, . . ., 3q}.Thus, in order to avoid envy, each agent i ∈ X must be assigned to one of her three top-ranked activities.For any activity a ∈ A with π a = ∅ the restrictions imply that exactly three agents are assigned to a. Hence, it is not difficult to verify that D = {Z j ∈ Z : |π a j | > 0, 1 ≤ j ≤ p} forms an exact cover for X in instance X , Z .
Case 2: N = ∅.If N contains two agents g, h such that π(g) = π(h), then one of these agents must envy the other by the fact that the two agents' rankings over {a 1 , . . ., a p } coincide.Hence, all members of N must be assigned to the same activity a ∈ {a 1 , . . ., a p }. Let X = {i ∈ X : π(i) / ∈ {a i 1 , a i 2 , a i 3 }}.
• Assume X = ∅, i.e., there is an agent i ∈ X which is not assigned to one of her three top-ranked activities.
First, we show that π(i) = a must hold for each i ∈ X .Assume the opposite, i.e., π(i) = a for some i ∈ X .Recall that π(i) ∈ A holds (see (1)), and thus π(i) ∈ A \ {a i 1 , a i 2 , a i 3 } follows.Then, in the strict ranking σ we must have a σ π(i) because otherwise the members in N envy i.However, this implies that in i we must have a i π(i) due to π(i) ∈ A \ {a i 1 , a i 2 , a i 3 }; i.e., i envies the members in N .Therewith, π(i) = a follows.
From π a = ∅ (due to N = ∅) and the given restrictions we can conclude that exactly three agents are assigned to a.With |N | = 0 it follows that |X | ∈ {1, 2} holds.Recall that each agent of X \ X is assigned to one of her three top-ranked activities.In addition, note that by the given restrictions to each activity a ∈ A \ {a} exactly three agents must be assigned, all of which must be members of X \ X (recall that (i) all members of X are assigned to a and (ii) all members of N \ X are either assigned to a or to some b ∈ {b 1 , . . ., b 3q }).This, however, is impossible, since from |X | = 3q and |X | ∈ {1, 2} with X ⊂ X it follows that |X \ X | ∈ {3q − 1, 3q − 2} holds.• Thus, X = ∅ holds.Assume π(i) = a for some i ∈ X .By N = ∅ we know that there can be at most two such agents and we get a contradiction to the size of X analogously to above.Hence, π(i) = a holds for all i ∈ X .As a consequence, Fig. 1Relations between the solution concepts we consider.An arrow directed from A to B means A implies B; e.g., a Pareto optimal assignment is also strictly core stable.

Fig. 2
Fig. 2 Illustration of the construction of a flow instance in the proof of Theorem 5. Consider instance I of s-GASP with N = {1, 2, 3} and A * = {a, b, c}, where u(a) = 1, u(b) = 3, and u(c) = 2.The agents' preferences are given by a 1 b 1 c 1 a ∅ , b 2 c 2 a 2 a ∅ , and c 3 a ∅ 3 b 3 a.The graph in the figure refers to assignment π with π(1) = π(2) = c and π(3) = a ∅ ; lower bound and capacity of an edge are displayed in brackets, the costs are displayed in italic.Assignment π is not Pareto optimal, because there is a flow of negative total cost in the graph.For instance, the flow (displayed in bold) that sends one unit along each of the edges (s, 1), (1, a), (a, t), (s, 2), (2, c), (s, 3), (3, c) and two units along (c, t) induces a feasible assignment π with π (1) = a and π (2) = π (3) = c, which Pareto-dominates π there an ind.rational assignment with #(π ) = n?I n P (follows from Arulselvan et al. (2018)) NP-c (Thm 15)

Fig. 3
Fig. 3 Testing Pareto optimality by considering matchings with maximum weight (see Theorem 16).In this example, the set of agents is N = {1, 2, 3, 4}, the set of non-void activities is A * = {a, b, c} and the preferences are b 1 a ∅ ∼ 1 a 1 c, b ∼ 2 a 2 a ∅ 2 c, b 3 c 3 a 3 a ∅ and a ∅ 4 c 4 b 4 a.The given assignment π is defined by π(1) = π(2) = a and π(3) = π(4) = b.The figure above depicts the construction described in Theorem 16 for agent 4. A maximum matching of weight 4m + n = 16 is indicated by bold edges.Hence, the assignment π is not Pareto optimal.Note that the assignment π induced by the matching indicated by the bold edges (π (1) = π (4) = a ∅ and π (2) = π (3) = b) is Pareto optimal 1. (virtually) core stable but neither (virtually) individually stable nor (virtually) strictly core stable, 2. virtually strictly core stable but not Pareto optimal, 3. Pareto optimal but not individually rational 4. individually stable but not individually rational, 5. individually stable and individually rational but not virtually individually stable.Proof Statement 1 follows from Example 1, Statement 5 from Example 2. The Statements 2-4 hold as a consequence of the two examples below.In particular, the Example 3 below proves Statement 2. Example 4 given below shows Statement 3 and Statement 4.

Table 1
Overview of complexity results obtained for constraints

Table 2
Overview of complexity results for balanced assignments