Stable and Pareto optimal group activity selection from ordinal preferences

In several situations agents need to be assigned to activities on basis of their preferences, and each agent can take part in at most one activity. Often, the preferences of the agents do not depend only on the activity itself but also on the number of participants in the respective activity. In the setting we consider, the agents hence have preferences over pairs “(activity, group size)” including the possibility “do nothing”; in this work, these preferences are assumed to be strict orders. The task will be to find stable assignments of agents to activities, for different concepts of stability such as Nash or core stability, and Pareto optimal assignments respectively. In this respect, particular focus is laid on two natural special cases of agents’ preferences inherent in the considered model, namely increasing and decreasing preferences, where agents want to share an activity with as many (as few, respectively) agents as possible.


Introduction
There are numerous situations in which agents need to be assigned to activities, where the agents have differing preferences over the activities and each agent can be assigned to at most one activity.However, often the preferences of the agents do not depend only on the activity itself, but also on the number of participants in the activity [see also Darmann et al. (2017)].For instance, consider the situation in which working tasks (that take place simultaneously) have to be split among agents, where the agents' preferences are not only over the different working tasks but also over the number of agents working on the specific tasks.Additional examples include a company that wishes to set up free sports classes for its employees (Skowron et al. 2015) or the organizers of a workshop who have to organize social activities for the free afternoon.For example, these activities could include a bus trip, a table tennis tournament, or taking a sauna.Now, an agent might be willing to take part in a bus trip with many participants, but does not want to take a sauna in case it is too crowded or participate in a table tennis tournament with too many participants.Obviously, as this is quite natural for the different activities, also the opinions over the group size for a specific activity might vary from agent to agent.Of course, the possibility to abstain from any activity is a viable alternative as well.The goal now would be to assign agents to activities in a reasonable way, based on such preferences. 1We are thus concerned with a setting in which agents have preferences over pairs "(activity, group size)", including the possibility "do nothing" to which we refer as the void activity a ∅ .A general model in which the agents' preferences are weak orders over such pairs is introduced in Darmann et al. (2017) as the group activity selection problem (GASP).In this paper, we consider o-GASP, the variant of GASP in which the agents' preferences are strict orders.
Given the agents' preferences, the aim is to assign agents to activities in a reasonable way.There are, of course, different approaches towards this task.One possibility would be to take a social choice perspective, aiming at assignments that maximize positional scores such as approval or Borda scores, or at a Condorcet winner among the assignments [see Darmann (2018)].In this work, we take a more game-theoretical approach by aiming at stable assignments, i.e., assignments that do not admit an incentive to deviate from, for different notions of stability such as Nash, individual and core stability.In addition, we will consider Pareto optimal solutions for our problem.After considering the relations between these concepts in the setting of o-GASP, we take into account two natural special cases of agents' preferences and we provide computational complexity results both for the decision version of the respective problems and for the related verification problems of deciding whether a given assignment is stable (and Pareto optimal, respectively).
As in Darmann et al. (2017) we require that no agent is assigned to an activity such that the agent would rather do nothing, i.e., prefers a ∅ to the pair "(assigned activity, group size)"; an assignment satisfying this property is called individually rational.Clearly, in an individually rational assignment no agent has an incentive to deviate to the void activity a ∅ .

Relation to the literature
This work is closely related to Darmann et al. (2017), where the general model of the group activity selection problem (GASP) is introduced; in GASP, the agents' preferences are weak orders over the pairs "(activity, group size)".The focus of Darmann et al. (2017), however, is laid on the variant a-GASP, where the agent's preferences are trichotomous: each agent partitions the set of pairs "(activity, group size)" into approved ones (i.e., pairs that are preferred to the void activity), the void activity, and disapproved ones (pairs to which the void activity is preferred).In that paper, the main concepts considered are maximum individually rational assignments (i.e., individually rational assignments that assign the maximum number of agents to a non-void activity) and stable assignments respectively.The main objective of Darmann et al. (2017) is a computational complexity study of the problem of finding such assignments, which includes several special cases such as increasing and decreasing preferences.
In our work, we focus on the variant o-GASP of the group activity selection problem in which the agents' preferences are strict orders.While o-GASP is approached from a social choice viewpoint in Darmann (2018), we apply the stability concepts of a-GASP to strict orders and analyse the computational complexity involved in finding stable assignments, with respect to the two intuitive special cases of increasing and decreasing preferences.In addition, we include the concept of Pareto optimality (and weak Pareto optimality) in our analysis and provide an efficient algorithm to find a Pareto optimal (and thus also weakly Pareto optimal) assignment.
The model of GASP, and hence o-GASP, is closely related to the one of hedonic games [see Banerjee et al. (2001) and Bogomolnaia and Jackson (2002)], and in particular anonymous hedonic games (Banerjee et al. 2001).In hedonic games, agents have preferences over the possible coalitions (i.e., subgroups of agents) they are part of; in anonymous hedonic games, the agents' preferences depend only on the size of that coalition.The goal would be a partition of the agents into subgroups in a reasonable manner.Note that GASP can be embedded in the hedonic game framework [see Darmann et al. (2017) for details].However, observe that o-GASP (and GASP in general) allows for a more compact representation of agents' preferences and bears two natural special cases that, in some cases, allow for finding stable assignments efficiently.
Stable partitions have been studied by Ballester (2004) from a computational viewpoint, both for anonymous and non-anonymous hedonic games.In particular, Ballester (2004) shows that deciding whether there is an outcome that is core stable, Nash stable, individually stable or contractually individually stable is NP-complete for both anonymous and non-anonymous hedonic games.While these results translate to the general group activity selection problem GASP, they do not directly imply similar hardness results for the setting of o-GASP considered in this work.In addition, the computational complexity of stable partitions with respect to different notions of stability such as Nash stability, individual stability or core stability has also been considered in the context of additively separable hedonic games, e.g., in the works of Aziz et al. (2011) (where also the concept of Pareto optimality is considered), Dimitrov et al. (2006) and Olsen (2007).Aziz et al. (2013) focus on the computational complexity involved in finding Pareto optimal solutions in hedonic games and variants thereof, including anonymous hedonic games and roommate games.They show that it is NP-hard to find a Pareto optimal solution both in anonymous and non-anonymous hedonic games, and provide an algorithm which determines a Pareto optimal solution for some of its variants, including roommate games, in polynomial time.These results, however, do not immediately carry over to our setting.In particular, while o-GASP can be embedded in the general (non-anonymous) hedonic game framework, for o-GASP we provide an algorithm that computes a Pareto optimal assignment in polynomial time (see Sect. 3.4).
Further related work includes the works of Lee and Shoham (2015) and Spradling et al. (2013).In Lee and Shoham (2015), the stable invitation problem is introduced, both in an anonymous and non-anonymous version.In the stable invitation problem, the goal is to find a set of agents to be invited to an event.In the anonymous stable invitation problem, the agents have preferences over the number of invitees; in the non-anonymous version, the agents additionally specify a set of accepted agents and a set of rejected agents.Lee and Shoham (2015) provide a number of complexity results for finding stable invitations and also consider strategic behaviour of the agents.
In the work of Spradling et al. (2013), agents have preferences over pairs made up of a role and a coalition; the role refers to the actual role the agent takes in the coalition, and the coalition specifies the composition of roles that make up the coalition.Spradling et al. (2013) provide a number of computational complexity results for finding stable partitions of the agents, for different notions of stability.
Very recently, however, Igarashi et al. (2017a, b) expand the group activity selection problem GASP by adding social networks to the setting, and agents can only take part in the same activity if they form a connected subgroup of the network.Finally, for a survey of group activity selection we refer to Darmann and Lang (2017).
The paper is organized as follows.The formal framework, including a presentation of the relationship between the concepts and an overview over the results, is presented in Sect. 2. In Sect. 3 we discuss the decision problem whether a stable assignment exists, and, given this decision problem can be solved efficiently, provide polynomial-time algorithms for finding such assignments.In that section, we also provide a polynomial-time algorithm for finding a Pareto optimal assignment.In Sect. 4 we consider the related decision problem whether a given assignment is stable respectively (weakly) Pareto optimal.Section 5 concludes the paper.

Formal framework
Before turning to stability concepts in Sect.2.1, we formally present the considered model and provide some basic definitions [see also Darmann et al. (2017), Darmann (2018)].
Definition 1 An instance (N , A, P) of the Group activity selection problem with ordinal preferences (o-GASP) is given as follows.N is a set of agents with n = |N |; unless stated otherwise, the agents are denoted by N = {1, . . ., n}.A = A * ∪ {a ∅ } is a set of activities, where A * = {a 1 , . . ., a m }; X = (A * × {1, . . ., n}) ∪ {a ∅ } is the set of alternatives.Finally, the profile P = V 1 , . . ., V n consists of n votes, one for each agent.For agent i, a vote V i (also denoted by i ) is a strict order over X ; the set S i ⊆ X such that for each x ∈ S i we have x i a ∅ , is the induced approval vote of agent i.We say that agent i approves of the alternatives in S i .
The definition below considers the following special cases of agents' preferences.If an agent wants to share the activities with as many other agents as possible, we say that the agent has increasing preferences.In contrast, if an agent would like as few other agents as possible to join, the agent's preferences are called decreasing.
Definition 2 Given an instance (N , A, P) of o-GASP, we say that agent i has increasing preferences if for each a ∈ A * , (a, k) i (a, k − 1) holds for each k ∈ {2, . . ., n}.
An agent i has decreasing preferences if for each a ∈ A * , (a, k − 1) i (a, k) holds for each k ∈ {2, . . ., n}.
An instance (N , A, P) of o-GASP has increasing (decreasing) preferences, if each agent i ∈ N has increasing (decreasing) preferences.
Definition 3 Given an instance (N , A, P) of o-GASP, a mapping π : N → A is called assignment.The set π a := {i ∈ N | π(i) = a} denotes the set of agents assigned to a ∈ A. The set π i := { j ∈ N | π( j) = π(i)} denotes the set of agents assigned to the same activity as agent i ∈ N .
An assignment is said to be individually rational if for every a ∈ A * and every agent i ∈ π a it holds that (a, |π a |) i a ∅ .
Abusing notation, given assignment π with π(i) = a and k = |π a | we also say that π assigns agent i to alternative (a, k).Note that if an assignment is not individually rational, then there exists an agent who prefers the void activity (i.e., do nothing) to the pair "(assigned activity, group size)", and hence wishes to deviate from that activity to the void activity.Observe that an individually rational assignment exists in each instance of o-GASP: the assignment π with π(i) = a ∅ for all i ∈ N is always individually rational.
As done in Darmann et al. (2017), we consider individual rationality as a minimum requirement an assignment should satisfy, and focus on individually rational assignments only.As a consequence, in instances of o-GASP we can restrict the attention to the part of the agents' rankings which contains approved alternatives only.In what follows, we assume that each agent approves of at least one alternative, since otherwise in any individually rational assignment the respective agent can only participate in the void activity.

Stability concepts
In this paper, we focus on the following stability concepts.First, we consider concepts that capture the idea of stability against individual deviations.A Nash stable assignment requires that no single agent i ∈ N has the wish to deviate from the assignment, i.e., from the pair (π(i), |π i |).Abusing notation, for any k ∈ N, we associate (a ∅ , k) with a ∅ , i.e., we define (a ∅ , k) := a ∅ .Definition 4 Given an instance (N , A, P) of o-GASP, an assignment π : N → A is Nash stable if it is individually rational and there is no agent i ∈ N and no a ∈ A * \{π(i)} such that (a, Note that in the above definition of Nash stability an agent is allowed to deviate in favour of activity a even if the agents currently assigned to a are opposed to this.In contrast, in the notion of individual stability an agent is allowed to join such a group of agents only if none of the group members objects.Contractual individual stability additionally requires that none of the agents assigned to the activity the agent leaves are worse off. Definition 5 Given an instance (N , A, P) of o-GASP, an individually rational assignment π : N → A is individually stable, if there is no agent i ∈ N and no a ∈ A * \π(i) such that (a, |π a | + 1) i (π(i), |π i |), and for all i ∈ π a it holds that (a, |π a | + 1) i (a, |π a |).
Definition 6 Given an instance (N , A, P) of o-GASP, an individually rational assignment π : N → A is contractually individually stable, if there is no agent i ∈ N and no a ∈ A * \π(i) such that (1) (a, |π a | + 1) i (π(i), |π i |), (2) for all i ∈ π a it holds that (a, |π a | + 1) i (a, |π a |), and (3) there is no h ∈ π i \{i} with (π(i), In contrast to the stability concepts introduced so far, the concept of the core captures stability against group deviations.In a core stable assignment π , there is no subset E of agents such that, by deviating from π , all members of E can strictly improve their situation.In a strictly core stable assignment π , there is no subset E of agents such that, by deviating from π , at least one member of E can strictly benefit without harming any of the other members of E. Generalizing the notion of individual stability, both of these stability notions require the deviating group of agents to join a group of agents π a assigned to some activity a or to start a new activity.
Definition 7 Given an instance (N , A, P) of o-GASP, an individually rational assignment π : Definition 8 Given an instance (N , A, P) of o-GASP, an individually rational assignment π : N → A is strictly core stable (or in the strict core) if there is no Next, contractual core stability requires that a deviating subset of agents cannot make all its members benefit without making any agent worse off who is assigned to an activity to which some of the deviating agents are originally assigned.Formally, it is defined as follows.
Definition 9 Given an instance (N , A, P) of o-GASP, an individually rational assignment π : Finally, we will consider Pareto optimality.A Pareto optimal assignment is an assignment that cannot be "globally improved upon" in the sense that there is no other assignment under which at least one agent benefits while no agent is worse off.In its weaker version, an assignment is weakly Pareto optimal if there is no other assignment under which each agent is better off.
Definition 10 Given an instance (N , A, P) of o-GASP, an individually rational assignment π : N → A is Pareto optimal if there is no assignment π such that there is

Relations between the concepts
From their definitions it follows that a Nash stable assignment is also individually stable, and an individually stable assignment is also contractually individually stable.In addition, a core stable assignment is also contractually core stable, and a (contractually) core stable assignment is also (contractually) individually stable.Clearly, any Pareto optimal assignment is also weakly Pareto optimal.
Next, any strictly core stable assignment is core stable as well.In particular, we can observe that in our setting the concepts of core and strict core coincide.
Proposition 1 In o-GASP, an assignment π is core stable if and only if π is strictly core stable.
Proof Clearly, the if-part holds.For the only-if-part, consider a core stable assignment π .If π is not in the strict core, then there exist a subset E ⊆ N and an activity a for at least one agent i ∈ E, while there is no 1) and |π a | = |E| imply that for agent i we get i ∈ E\π a .In turn, with |π a | = |E| this implies that π a \E = ∅ holds.This contradicts to π a ⊂ E.
Finally, we can observe that Pareto optimality implies contractual core stability.
Proposition 2 In o-GASP, any Pareto optimal assignment is contractually core stable.
Proof Consider a Pareto optimal assignment π .If π is not contractually core stable, then there is a subset E ⊆ N and an activity a . Hence, π is not Pareto optimal which contradicts with our assumption.In addition, in the case of increasing preferences, we can observe that the concepts of Nash stability and individual stability coincide, since any agent prefers (a, k + 1) to (a, k), for any choice of a ∈ A * and k ∈ N.
In the case of decreasing preferences, it follows that contractual individual stability implies individual stability, since no agent assigned to an activity objects to another agent leaving the activity.For the same reason, contractual core stability implies core stability as well.Note that this also means that in the decreasing preferences case any Pareto optimal assignment is in the core.In addition, we can show that individual stability implies core stability in the case of decreasing preferences.

Proposition 3 In an instance of o-GASP with decreasing preferences, any individually stable assignment is in the core.
Proof In an instance of o-GASP with decreasing preferences, each agent assigned to an activity objects to any positive number of other agents additionally joining the activity by the definition of decreasing preferences.Thus, given an assignment π , any agent (or group of agents) can only deviate to an activity a ∈ A * with π a = ∅.By decreasing preferences, if there is no agent i and no activity a ∈ A * with π a = ∅ such that (a, 1) i (π(i), |π i |) holds, there cannot exist a group of agents E such that (a, |E|) i (π(i), |π i |) holds for each of them, since (a, k) i (a, k + 1) holds for any choice of a ∈ A * and k ∈ N. Thus, individual stability implies core stability.
Observe that Proposition 3 implies that in the decreasing preferences case, each Nash stable assignment is in the core.
Summarizing, in the case of decreasing preferences the following relations additionally hold (see also Fig. 2): -core stable ⇔ individually stable ⇔ contractually individually stable ⇔ contractually core stable (for the first equivalence, see Proposition 3); -Nash stable ⇒ core stable; Pareto optimal ⇒ core stable.

Problem definitions and overview of results
Given an instance I of o-GASP, for each of the stability2 concepts defined in Sect.2.1 we are interested in the following two types of questions: -Does I admit a stable assignment?If so, can such an assignment be determined efficiently?-Given an assignment π , is π stable w.r.t. the considered stability concepts?Formally, we hence define the following decision problems, for each notion of stability defined in Sect.2.1.

Given:
Instance I = (N , A, P) of o-GASP Question: Does I admit a stable assignment?

Stability-Verification
Given: Instance I = (N , A, P) of o-GASP and an assignment π : N → A. Question: Is π a stable assignment?
An overview of the computational complexity results achieved in this paper is given in Table 1.There, "NP-c" and "coNP-c" stands for NP-complete and coNP-complete respectively; with respect to Stability-Existence, "in P" means that a respective stable assignment always exists and can be found in polynomial time.

Stable and Pareto optimal assignments: existence and determination
In this section, with respect to the different notions of stability defined in Sect.2.1 we analyse the computational complexity of Stability-Existence, i.e., the decision problem whether a stable assignment exists.In the case this problem belongs to the class P we give polynomial time algorithms for finding such a stable assignment.

Nash stability
The first stability concept we consider is Nash stability.In the setting of a-GASP, it is NP-complete to decide whether a Nash stable assignment exists; however, in the case of increasing or decreasing preferences, a Nash stable assignment always exists and can be found in polynomial time (Darmann et al. 2017).In contrast, as Example 1 shows, in the setting of o-GASP even when all agents have increasing preferences a Nash stable assignment does not necessarily exist.In particular, we show that in o-GASP (1) it is NP-complete to decide whether a Nash stable assignment exists even if all agents have increasing preferences, while (2) in the case of decreasing preferences, a Nash stable assignment always exists and can be found in polynomial time.
Example 1 Let N = {1, 2, 3, 4, 5, 6} and A * = {a, b, c}.The (truncated) preference profile P made up of increasing preferences is given as follows: Note that for each activity α ∈ A * there are exactly three agents who rank (α, k) above a ∅ for some k.
Assume that there is a Nash stable assignment π .Then, π must assign agent 1 to a non-void activity, because otherwise agent 1 would like to join a. Analogously, agents 3 and 5 must be assigned to a non-void activity.
Assume π(1) = a.Then π(2) = a must hold since π is Nash-stable.For the same reason, π(5) = a must hold as well.Recall that also agent 3 has to be assigned to a non-void activity, i.e., π(3) ∈ {b, c} holds.π(3) = c would imply that three agents are assigned to c, which is impossible due to π(5) = a and the individual rationality of π .Thus, π(3) = b holds.This, however, implies π( 4 Thus, a Nash stable assignment does not exist.Note that removing any agent from the above instance results in a new instance which admits a Nash stable assignment.E.g., if agent 6 is removed, then the assignment π with π ( 2 We will make use of the above example in proving the following hardness result.
Theorem 1 It is NP-complete to decide whether o-GASP admits a Nash stable assignment, even when all agents have increasing preferences.
Proof Given an assignment π , for each i ∈ N it can be verified quickly whether i wants to deviate from π(i).Thus, membership in NP follows.
We provide a reduction from Exact Cover by 3-Sets (X3C).In an instance of X3C, we are given a pair F, Y , where F = {1, . . ., 3q} and Y = {Y 1 , . . ., Y p } is a collection of 3-element subsets of F, and ask if F can be covered by exactly q sets from Y. It is known that X3C is NP-complete even if each element of F appears in exactly three sets of Y [see Hein et al. (1996) and Hickey et al. (2008)]; note that in such a case p = 3q holds.For each Given such an instance F, Y of X3C, we construct an instance I of o-GASP as follows.Let n := 3q.Now, we set Note that for each a ∈ A * there are exactly three agents who prefer (a, k) to a ∅ for some choice of k.
In what follows, we argue that F, Y admits an exact cover if and only if I admits a Nash stable assignment.
Assume that there is an exact cover in F, Y , i.e., there is a set of indices I ⊆ {1, . . ., p} such that |I | = q and ∪ h∈I Y h = F. Define the assignment π as follows: As {Y h } h∈I is a partition of F, for each i, |I ∩ {i 1 , i 2 , i 3 }| = 1 holds.Hence the assignment is well-defined.Since {Y h | h ∈ I } is an exact cover for F and each set Y h ∈ Y contains exactly three elements, for any choice of y ∈ {y i | 1 ≤ i ≤ n} the number of agents assigned to y under π is either 0 or 3. Therefore, for each i -agent λ i does not want to deviate from y j in order to join another activity.To verify this, note that λ i could only wish to deviate to an activity y ∈ {y i | 1 ≤ i ≤ n}.
On one hand, however, λ i does not want to join such a y with π y = ∅ since (a, 1) / ∈ S λ i holds for each a ∈ A * .On the other hand λ i cannot want to join y with |π y | = 3 because for each a ∈ A * , there are only three agents that rank (a, k) above a ∅ for some choice of k.
On the other hand, assume there is a Nash stable assignment π in instance I. Suppose that for some i ∈ {1, . . ., n}, agent λ i is not assigned to an activity y ∈ {y i 1 , y i 2 , y i 3 }.Analogously to Example 1 it then follows that π is not Nash stable.Hence, for each i ∈ {1, . . ., n} agent λ i is assigned to an activity y ∈ {y i 1 , y i 2 , y i 3 }.By construction, π(λ i ) = y implies that exactly three agents are assigned to y. I.e., the collection {Y j | ∃i ∈ {1, . . ., n} : π(λ i ) = y j } is an exact cover for F.
On the positive side, for the case of decreasing preferences, we propose a polynomial-time algorithm that computes a Nash stable assignment.Given an individually rational assignment π , if i wants to deviate from π(i) we denote by fc(i, π) agent i's favourite choice, i.e., the activity a ∈ A * \{π(i)} such that (a, |π a | + 1) is the best-ranked among all alternatives in the ranking i that satisfy (a , Now, the algorithmic idea is as follows.Assume some agent i wishes to deviate from activity a assigned to the agent by an individually rational assignment π .Then we assign agent i to her favourite choice, say b, which increases the number of agents assigned to b by exactly 1. If, as a consequence of the increased group size, one of the agents originally assigned to b now may prefer to join the void activity or another activity of A * , such an agent is (after being assigned to a ∅ in an intermediate step) chosen as the next agent whose wish to deviate is considered.

Theorem 2 Given an instance of o-GASP with decreasing preferences, a Nash stable assignment always exists and can be determined in polynomial time.
Proof We show that Algorithm 1 terminates in polynomial time, with the resulting assignment π being Nash stable.Note that for each b ∈ A * , during the execution of Algorithm 1 the number of agents assigned to b, i.e., |π b |, is non-decreasing in the sense that, for loops , with < , the number of agents assigned to b at the beginning of loop is at least as high as at the beginning of loop .(3), because the agents have decreasing preferences and the number of agents assigned to d is at least as high at the beginning of loop as after loop .

Complexity
As a consequence, at the beginning of loop we must have |π b | ≥ k.This, however, contradicts with the fact that, in loop g, b with |π b | = k − 1 is i's favourite choice, because the number of agents assigned to b at the beginning of loop g is at least as high as at the beginning of loop .
Hence, for each i ∈ N , b ∈ A * and 1 ≤ k ≤ n, b is at most once i's favourite choice with currently k − 1 agents assigned to b.With m = |A * | that means that the algorithm terminates after at most n • mn = mn 2 loops.In each loop, the highest computational effort is the execution of line 10, which, in the worst case, requires checking (d, |π d | + 1) j (b, |π b |) for all agents j and activities d ∈ A * \{b}; this can roughly be bounded by O(m 2 n 2 ).Thus, the running time of the algorithm can be bounded by O(mn 2 • m 2 n 2 ), i.e., by O(m 3 n 4 ).
Correctness After termination of the algorithm, we have C = N ; let π * denote the final assignment, i.e., the assignment π after the final loop.It is easy to verify that π * is individually rational.Let i ∈ N , with π * (i) = a ∈ A * ∪ {a ∅ }.Let denote the loop in which i was put into set C for the last time.By construction, right after loop agent i did not want to deviate from π(i) in order to join another activity b ∈ A * ∪ {a ∅ }.Since the number of agents assigned to an activity is non-decreasing and each agent has decreasing preferences, i does not want to deviate from π * (i) and join an activity to which agents are assigned by π * .

Individual stability
In the case of increasing preferences individual stability coincides with Nash stability.Theorem 1 hence implies the following corollary.
Corollary 1 It is NP-complete to decide whether o-GASP admits an individually stable assignment, even when all agents have increasing preferences.
In contrast, for the case of decreasing preferences we already know that a Nash stable assignment can be found in polynomial time by use of Algorithm 1 (see Theorem 2).Since Nash stability implies individual stability, we can conclude that in case of decreasing preferences an individually stable assignment can be determined in polynomial time.

Corollary 2 Given an instance of o-GASP with decreasing preferences, an individually stable assignment always exists and can be determined in polynomial time.
On the other hand, a contractually individually stable assignment exists and can be found efficiently in any instance of o-GASP.While there is a natural greedy algorithm to determine such an assignment (which in general is not Pareto optimal) we can conclude this also from the fact that a Pareto optimal assignment can be found in polynomial time (Theorem 4 in Sect.3.4; see also Fig. 1).
Corollary 3 Given an instance of o-GASP, a contractually individually stable assignment always exists and can be determined in polynomial time.

Core stability
For the setting of a-GASP, a core stable assignment always exists and can be determined efficiently (Darmann et al. 2017).While in o-GASP an analogous result holds for decreasing preferences as well (see Corollary 4), in general this is not the case.As Example 2 shows, even in the special case of increasing preferences a core stable assignment does not always exist.In particular, it turns out that deciding whether o-GASP admits a core stable assignment is computationally hard even in the case of increasing preferences.
Example 2 Let us again consider instance (N , A, P) of Example 1. Assume that there is a core stable assignment π .Suppose π(1) = a ∅ .Then π a = ∅ follows, and the set E = {1} would prefer joining a, which violates core stability.Thus, agent 1 must be assigned to a non-void activity; analogously, agents 3 and 5 must be assigned to a non-void activity.
If π(1) = a, then π(2) = π(5) = a follows (otherwise |π a | ≤ 2 holds and hence each member of E = {1, 2, 5} ⊃ π a would be better off with all members of E being assigned to a).Recall that agent 3 is assigned to a non-void activity.By individual rationality of π , π(5) = c hence implies that π(3) = b holds.However, by π(1) = a it follows that |π b | ≤ 2 holds; but then each member of E = {1, 3, 4} ⊃ π b would be better off with all members of E being assigned to b.This violates core stability.
Theorem 3 It is NP-complete to decide whether o-GASP admits a core stable assignment, even when all agents have increasing preferences.
Proof For membership in NP, observe that a core stable assignment π serves as certificate: For each a ∈ A * , by scanning the whole profile for each value k > |π a | in polynomial time we can check if there exists a set E ⊃ π a of size |E| = k such that (a, |E|) i (π(i), |π i |) for all i ∈ E. Thus, overall in polynomial time we can verify if π is indeed core stable.
The hardness-proof follows a pattern similar to the proof of Theorem 1, now making use of Example 2. We reduce from Exact Cover by 3-Sets (X3C).In an instance of X3C, we are given a pair F, Y , where F = {1, . . ., 3q} and Y = {Y 1 , . . ., Y p } is a collection of 3-element subsets of F, and ask if F can be covered by exactly q sets from Y. Again, we restrict to instances of X3C in which each element of F appears in exactly three sets of Y; recall that in such a case p = 3q holds.
Given such an instance F, Y of X3C, we construct an instance I of o-GASP as follows.Let n := 3q.Now, we set The preferences of the agents in N are, for 1 ≤ i ≤ n, displayed in Table 3.
Note that for each a ∈ {a i , b i , c i | 1 ≤ i ≤ n} there are exactly 3 agents who prefer (a, k) to a ∅ for some k ∈ N, and for each a ∈ {y i | 1 ≤ i ≤ n} exactly 9 agents prefer (a, k) to a ∅ for some choice of k.Now we show that F, Y admits an exact cover if and only if I admits a core stable assignment.
"⇒".Assume there is an exact cover in F, Y , i.e., there is a set of indices I ⊆ {1, . . ., p} such that Note that for j ∈ {i 1 , i 2 , i 3 } ∩ I exactly 9 agents are assigned to y j .Next, observe that there is no group of agents G with G ∩ {λ i , W i , Z i | 1 ≤ i ≤ n} = ∅ that wants to deviate from their activities assigned by π (see also Example 2).Assume there is a subset of agents G with G ∩ {λ i , W i , Z i } = ∅ for some i that wants to deviate.By construction, g ∈ {λ i , W i , Z i } can only beneficially deviate to some y j ∈ {y j 1 , y j 2 , y j 3 }\{y j }.Recall that exactly nine agents prefer (y j , k) to a ∅ for some choice of k, including the agents λ i , W i , Z i .Hence, g can only deviate if all of the three agents λ i , W i , Z i want to deviate, which is impossible because (y j , 9) (y j , 9) holds for at least one of these agents.Thus, π is core stable. ) "⇐".On the other hand, assume there is a core stable assignment π in instance I. Example 2 implies that for each i ∈ {1, . . ., n} agent λ i is assigned to an activity y ∈ {y i 1 , y i 2 , y i 3 }.By construction, π(α i ) = y implies that exactly nine agents are assigned to y, namely the agents λ i W i , Z i for exactly three indices i ∈ {1, . . ., n}.It is not hard to verify that this means that the collection {Y j | ∃i ∈ {1, . . ., n} : π(λ i ) = y j } is an exact cover for F.
In contrast, in the case of decreasing preferences a core stable assignment always exists and can be determined in polynomial time.This is a consequence of Theorem 2 and the fact that in the case of decreasing preferences any Nash stable assignment is also core stable (see also Fig. 2).
Corollary 4 Given an instance of o-GASP with decreasing preferences, a core stable assignment always exists and can be found in polynomial time.
In contrast to core stability we have a positive result for contractual core stability in the general setting of o-GASP: an assignment meeting that requirement is guaranteed to exist and can even be computed in polynomial time.Again, this follows from the result that a Pareto optimal assignment can be found in polynomial time (Theorem 4 in Sect.3.4).

Corollary 5
In o-GASP, a contractually core stable assignment always exists and can be found in polynomial time.

Pareto optimality
Finally, we tackle the problem of finding a Pareto optimal assignment.Given an instance of o-GASP, consider the partial order P of Pareto-improvement defined over the set of individually rational assignments as follows: Clearly, since P is a partial order over the non-empty finite set of individually rational assignments, in an instance of o-GASP a Pareto optimal assignment (i.e., a maximal element w.r.t.P ) always exists.Now, consider an agent i with top-ranked alternative (a, k).Assume it is possible to assign i and k −1 other agents to a while respecting individual rationality.Since agent i's top-ranked alternative is (a, k) it follows that there is a Pareto optimal assignment (i.e., a maximal element w.r.t.P ) π with π(i) = a and |π a | = k.Thus, for determining a specific Pareto optimal assignment π we can already fix π(i) = a and |π a | = k.Now, the basic algorithmic idea is as follows.Consider an individually rational assignment in which (1) for some agents the activities they are assigned to and (2) for some activities the number of agents assigned to the activity have already been fixed.Pareto-improve the assignment, i.e., find an assignment that respects (1) and ( 2) and is better for at least one agent while making no agent worse off.In fact, applying this idea we can find a Pareto optimal assignment in an instance I = (N , A, P) of o-GASP in polynomial time by means of procedure Pareto and its subroutines test and improve described below.

Procedure Pareto
Let r (i) denote agent i's -th ranked alternative.We assume that the profile P contains only alternatives (a, k) which are approved by at least k agents.The idea of procedure Pareto (Algorithm 2) is as follows.Start with the void assignment, i.e., with the assignment π(i) = a ∅ for all i ∈ N .
Pick an agent, say agent 1.For her top-ranked alternative (a, k), assign agent 1 to a together with k − 1 arbitrarily chosen other agents approving of (a, k).Clearly, for agent 1 there can be no assignment she prefers to the actual assignment.I.e., there is a Pareto optimal assignment π that assigns 1 to a such that |π a | = k.Hence, we add 1 to the (initially empty) set N of agents for which the finally assigned activity is determined already and also fix the number of agents assigned to a to be k in the finally determined assignment.Thus, if |{h ∈ N : (a, k) ∈ S h }| = k, then we can add all these agents in π a to N and proceed with the reduced instance in which a and π a are removed from the original instance.
However, some of the agents of π a \{1} might be better off with an alternative different from (a, k).Hence, if |{h ∈ N : (a, k) ∈ S h }| > k, then it might be possible to assign some agent of π a \{1} to an alternative she prefers to (a, k) without making any agent worse off.So, for each of these agents j, we verify, for alternatives (b, x) with (b, x) j (a, k), if there is an assignment π such that a total of x agents (including j) is assigned to b without making any agent worse off (note that in this first step, from the possible choices we must exclude (b, x) = (a, ) for any choice of since it is already fixed that exactly k agents including agent 1 must be assigned to a).In general, in procedure Pareto the set S denotes the set of agents j for which we check if such an assignment π exists.
For a given agent j, procedure test checks if there is such an assignment π , for each alternative (b, x) which j prefers to (π( j), |π j |) (the alternatives are considered in increasing order of the rank in j ).If a respective assignment exists or all alternatives are exhausted, j is added to N ; in the former case, π is replaced by π and the set S of agents is updated accordingly (now, some agents might want to "deviate" from (b, x)).
Finally, if such a Pareto-improvement is not possible anymore, we remove all agents of N and all activities to which an agent of N is assigned from the instance, and iterate Pareto with the resulting reduced instance.

Procedures test and improve
Given instance I, agent j, assignment π and agent set N , the goal of procedure test is an individually rational assignment π which assigns j to the best-ranked among the alternatives (b, x) that j prefers to (π( j), |π j |) such that for each agent of N the assignment remains unchanged, i.e., for all i ∈ N (π (i), Procedure test considers the alternatives (b, x) in increasing order of their rank in j , checks if such an assignment exists and terminates if such an assignment is found or all alternatives (b, x) which j prefers to (π( j), |π j |) are exhausted.Note that agent j cannot be assigned to (b, x) if the total number of agents assigned to b is already fixed to a number different from x (line 5 of procedure test).
Summing up, for considered alternative (b, x) assignment π must satisfy the following properties: 1. for all i ∈ N we have (π (i), In order to check whether such an assignment exists for a given alternative (b, x), test executes the subroutine improve described below.
Procedure improve works as follows.Given as input an instance I = (N , A, P), a subset N ⊂ N , dedicated agent j and alternative (b, x), and assignment π , improve checks if there is an assignment π such that Eq. ( 4) is satisfied.This is done by solving a feasible flow problem with lower and upper bounds on the edge capacities in the following directed graph G = (V, E), with V := {s, t, b} ∪ N ∪ {a | π a = ∅, a ∈ A * }.The edge set E is constructed as follows: -introduce the edges (s, j) and ( j, b) of lower and upper capacity bound 1 -for each i ∈ N \{ j}, -introduce the edges (s, i) Assume the procedure outputs an assignment π = π .By construction of graph G, conditions (1) and (2) of Eq. ( 4) are satisfied by π .In order to verify that (3) is satisfied as well, it is sufficient to see that an agent i with π(i) = a ∅ by construction cannot be assigned to a worse-ranked non-void alternative; in addition, by the fact that the lower and upper capacity of (s, i) is 1, i cannot be assigned to the void activity either.Thus, for i with π(i) = a ∅ either π (i) = b or π (i) = π(i) holds.The first case, by construction implies On the other hand, it is not hard to see that in the case that an assignment satisfying Eq. ( 4) exists, procedure improve finds one.
As a consequence, in polynomial time procedure test(I, N , j, π) checks if there is an assignment π such that Eq. ( 4) holds for some (b, x) j (π( j), |π j |); in case of existence, π is updated to coincide with an assignment π that assigns j to her bestranked such alternative.Given the fact that for all i ∈ N , the pair (π(i), |π(i)|) is already the respective alternative of the finally computed assignment, test(I, N , j, π) hence determines the activity (and corresponding group size) to which agent j is finally assigned; therewith, after executing test(I, N , j, π) agent j is added to the set N .
Procedure Pareto executes procedure test at most once for each agent, and the latter evokes improve for a given agent at most once for each alternative (b, x), hence procedure improve is executed at most mn 2 times.Thus, with Lemma 1 we can conclude the following theorem.
Theorem 4 In o-GASP, a Pareto optimal assignment can be found in polynomial time.
Since any Pareto optimal assignment is also weakly Pareto optimal, Theorem 4 implies that a weakly Pareto optimal assignment can be found in polynomial time as well (Corollary 6 below).However, in fact a weakly Pareto optimal assignment can be determined very efficiently: any individually rational assignment that-in a reduced instance containing only alternatives (a, k) approved by at least k agentsassigns some agent with top-ranked alternative (a, k) together with k − 1 other agents approving of (a, k) to a must be weakly Pareto optimal.
Corollary 6 In o-GASP, a weakly Pareto optimal assignment can be found in polynomial time.

Verification of stability and Pareto optimality
Given an instance of o-GASP and an individually rational assignment, another interesting task is to check if the assignment is stable with respect to the considered stability notions (Stability-Verification).
Clearly, we can decide in polynomial time whether a given assignment is Nash stable, individually stable or contractually individually stable.In addition, it can also be checked in polynomial time whether a given assignment π is core stable: For each alternative (a, k) with k > |π a | that is preferred to (π(i), |π i |) by some agent i, we need to check whether a total of k agents (including the agents in π a , if π a is nonempty) prefer (a, k) to the alternative assigned under π ; if and only if this is not the case for any such alternative the assignment is core stable.The worst case scenario for checking whether or not an assignment is core stable can hence be bounded by scanning the whole profile for each alternative, which can be done in polynomial time.
However, the computational complexity of deciding whether a given assignment is contractually core stable or Pareto optimal does not seem obvious.Our results show that the above decision problem is in P for contractual core stability, whereas it is coNP-complete for Pareto optimality even in the case of increasing preferences.While in the case of decreasing preferences the computational complexity status of checking for Pareto optimality is open, deciding whether or not an assignment is weakly Pareto optimal turns out to be coNP-complete in both special cases of increasing and decreasing preferences.
For checking whether a given assignment π is contractually core stable (Algorithm 4), the basic idea is as follows.For each agent i and each alternative (b, k) which i prefers to (π(i), |π i |) we check whether a total of k agents (including i) can be taken from N to form the subset E such that π b ⊂ E and, for all j ∈ E, (b, k) j (π( j), |π j |) holds while there is no j ∈ N \E with (π( j), |π j \E|) ≺ j (π( j), |π j |).So, since we include i and all agents of π b in E, that means we need to take a total of k − |π b | − 1 of the remaining agents, i.e., agents different from i from the sets π c , c ∈ A\{b}, to form E. In order to check if this is possible, for each such set π c we compute all possible numbers of agents that can be taken from π c such that no member of π c objects.Having all of these numbers, we need to decide if these add up to k − |π b | − 1 by taking exactly one number from each activity (note that 0 is a possible choice for c ∈ A\{b, π(i)}).The problem of taking exactly one number of each member of a given family of subsets of non-negative integers such that these add up to a given number corresponds to the Multiple-Choice Subset-Sum problem [see Pisinger (1995)], for which an algorithm is known which, in our case, allows for a polynomial running time.

Theorem 5
In o-GASP we can decide in polynomial time whether a given assignment is contractually core stable.
Proof Given an instance (N , A, P) of o-GASP and assignment π , in a pre-processing step we check if π is individually rational (which clearly can be done in polynomial time).Next, we argue that by means of Algorithm 4 it can be verified in polynomial time if an individually rational assignment π is contractually core stable.
Correctness As mentioned above, the algorithm checks for each agent i and each alternative (b, k) which i prefers to (π(i), |π i |) whether k agents (including i and all the agents in π b ) can be taken from N to form the subset E such that (b, k) j (π( j), |π j |) for all j ∈ E holds and there is no j ∈ N \E with (π( j), |π j \E|) ≺ j (π( j), |π j |).For each agent i and such alternative (b, k), Algorithm 4 proceeds as follows.B denotes the set of agents that prefer (b, k) to the assigned alternative under π .For each c ∈ A\{b}, it is verified whether, for each possible choice of , exactly agents can be taken from π c and included in E such that no member of π c objects to this.Clearly, the members of π c that are meant to be included in E must prefer (b, k) to the current assignment.In other words, only members of π c ∩ B can be included in E.
Clearly, for a ∅ we can include any subset of π a ∅ ∩ B in E (line 24 of Algorithm 4).For c ∈ A * \{b} (lines 17-24 and lines 11-15 respectively), agents of π c ∩ B can ).For activity a := π(i), note that we need to take into account that i is included in E (lines 11-15).
For each activity a ∈ A\{b}, we collect the numbers of agents which can be removed from π a (including the number 0 for c ∈ A\{a, b}) in order to be included in E by means of the set R a .Finally, Algorithm 4 checks if we can make up E with a total of exactly k agents including i and all agents of π b by verifying whether it is possible to take exactly one number from each of the sets R a such that these add up to k − |π b | − 1 (line 25).
Running time The bottleneck of the algorithm is deciding whether an abovementioned selection of numbers adds up to k − |π b | − 1.Since k ≤ m holds, applying, e.g., Pisinger's algorithm (Pisinger 1995) for the Multiple-Choice Subset-Sum problem requires a running time of O(m 2 ) per execution.Hence, the overall running time of our algorithm is in O(n 2 m 3 ), because in the worst case it executes Pisinger's algorithm at most once for each agent and each alternative, i.e., n 2 m times.

Theorem 6
In o-GASP it is coNP-complete to decide whether a given assignment π is Pareto optimal, even in the case of increasing preferences.
We derive coNP-hardness by a reduction from Perfect Assignment which is the following decision problem: Given an instance I of o-GASP, is there an individually rational assignment such that all agents are assigned to a non-void activity?From Darmann et al. (2017) it follows that Perfect Assignment is NP-complete even in the case of increasing preferences.Given such an instance I = (N , A, P) of o-GASP with |N | = n, construct instance I of o-GASP with increasing preferences by introducing a dummy activity d and adding (d, n) to the ranking of each agent i ∈ N such that (d, n) is the worst-ranked among all alternatives i approves of.Note that there is no agent who approves of (d, k) for any k < n.Hence, it immediately follows that π with π(i) = d for all i ∈ N is Pareto optimal in I if and only if there is no perfect assignment in I.
Observe that from the above proof an analogous coNP-completeness result for weak Pareto optimality follows in the case of increasing preferences, since, in the constructed instance I , the assignment π with π(i) = d for all i ∈ N is Pareto optimal if and only if it is weakly Pareto optimal.However, coNP-completeness of deciding whether an assignment is weakly Pareto optimal also holds in the special case of decreasing preferences, as the following theorem shows.

Theorem 7
In o-GASP it is coNP-complete to decide whether a given assignment π is weakly Pareto optimal, even in each of the special cases of increasing and decreasing preferences.
Proof Membership in coNP follows because for a given assignment π , an assignment π such that for all j ∈ N we have (π ( j), |π j |) j (π( j), |π j |) serves as certificate.Again we derive coNP-hardness by reducing from Perfect Assignment.Given an instance I = (N , A, P) of o-GASP, observe that π with π(i) = a ∅ for all i ∈ N is weakly Pareto optimal if and only if there is no perfect assignment.Since the latter problem is known to be NP-complete even in both special cases of increasing and decreasing preferences [as a consequence of Darmann et al. (2017)], the theorem follows.

Conclusion
In this paper, we have analysed the computational complexity involved in finding (and verifying) reasonable assignments of agents to activities, on the basis of their preferences over pairs made up of an activity and the size of the group of agents participating in that activity.Given that the agents' preferences are strict orders, results have been provided for the concept of (weak) Pareto optimality and for different stability notions such as Nash stability, individual stability and core stability, with focus on the two natural special cases of decreasing and increasing preferences.
In particular, while our results show that for several stability concepts we can efficiently verify whether or not an assignment is stable, checking whether or not an assignment is Pareto optimal or weakly Pareto optimal turns out to be computationally hard even in restricted instances.While a single Pareto optimal (or weakly Pareto optimal) assignment can be found efficiently, this might indicate computational hardness of finding Pareto optimal (or weakly Pareto optimal) assignments satisfying certain pre-defined criteria (e.g., criteria of fairness or equitability).However, in case each agent's preferences are decreasing, deciding whether or not a given assignment is Pareto optimal remains an interesting open question for future research.

FigFigure 1
Fig. 1 Relationships between the stability concepts in o-GASP

Fig. 2
Fig. 2 Relationships between the concepts in o-GASP with decreasing preferences ) = b because otherwise agent 4 would like to join activity b in contradiction with Nash stability.But then agent 1 would like to join b, which violates Nash stability.Therefore, π(1) = b must hold, implying π(3) = π(4) = b.Since agent 5 must be assigned to a non-void activity, π(5) = c follows (π(5) = a is impossible because this would require π(1) = π(2) = a), which in turn implies π(6) = c.But now agent 3 would like to join c which violates Nash stability.
First, we show that in the execution of Algorithm 1, for any i ∈ N , b ∈ A * and 1 ≤ k ≤ n, b is at most once i's favourite choice with currently k −1 agents assigned to b, i.e., at most once we have π(i) = a ∅ , fc(i, π) = b, and |π b | = k − 1. Assume the opposite.That means, during one loop of the algorithm i is assigned to b (let loop denote the first such loop), and in a later loop i is assigned to a ∅ again.Note that we must have(b, k) i a ∅ (2)and(b, k) j (d, |π d | + 1)(3)for all d ∈ A * \{b} after loop .Clearly, directly after execution of loop , |π b | ∈ {k − 1, k} holds, depending on whether or not there was an agent j satisfying one of the conditions in line 10.In the latter case |π b | = k holds.Thus, b with |π b | = k − 1 cannot be any agent's favourite choice in a later stage because the number of agents assigned to b is non-decreasing.Hence, we must have |π b | = k − 1 after loop .To enable that in a loop g > , b is again i's favourite choice, i must be assigned to a ∅ in a loop with < < g.This is only possible if i wishes to deviate in loop as a consequence of the increased size of the group of agents assigned to b due to an agent joining b in loop (line 9).I.e., when executing loop , in line 10 condition (1)a ∅ i (b, |π b |), or (2) (d, |π d |+1) i (b,|π b |) for some d ∈ A * \{b}, must be satisfied.Since for each activity the number of agents assigned in loop is at least as high as in loop , there are at least k − 1 agents assigned to b when entering loop .Assume we have |π b | = k − 1 at the beginning of loop .Then, (1) corresponds to a ∅ i (b, k) in contradiction with Eq. (2).Analogously, (2) corresponds to (d, |π d | + 1) i (b, k) in contradiction with Eq.
lower and upper capacity bound 1 if π(i) = a ∅ .-foreach a ∈ A * with π a = ∅, introduce• the edge (i, a) of lower and upper capacity bound1 if π(i) = a and i ∈ N • the edge (i, a) of upper capacity bound 1 if π(i) = a and i / ∈ N • the edge (i, a) of upper capacity bound 1 if (a, |π a |) i (π i , |π i |).-introduce the edge (i, b) of upper capacity bound 1 if (b, x) i (π i , |π i |).-for each a ∈ A * with π a = ∅ introduce edge (a, t) of lower and upper capacity bound |π a |.-introduce the edge (b, t) of lower and upper capacity bound x.
be included in E if and only if (1) all agents in π c \B prefer (c, |π c | − ) to (c, |π c |) (line 21), and (2) the members in π c ∩ B that are not meant to be assigned to (b, k) -that means at least (|B ∩ π c | − ) agents of B ∩ π c -also prefer (c, |π c | − ) to (c, |π c |) (line 22

Table 1
Overview of the computational complexity results provided

Table 2
Preferences of the agents in instance I used in the proof of Theorem 1

Table 3
Preferences of the agents in instance I used in the proof of Theorem 3