Testing Stability Properties in Graphical Hedonic Games

In hedonic games, players form coalitions based on individual preferences over the group of players they could belong to. Several concepts to describe the stability of coalition structures in a game have been proposed and analysed in the literature. However, prior research focuses on algorithms with time complexity that is at least linear in the input size. In the light of very large games that arise from, e.g., social networks and advertising, we initiate the study of sublinear time property testing algorithms for existence and verification problems under several notions of coalition stability in a model of hedonic games represented by graphs with bounded degree. In graph property testing, one shall decide whether a given input has a property (e.g., a game admits a stable coalition structure) or is far from it, i.e., one has to modify at least an $\epsilon$-fraction of the input (e.g., the game's preferences) to make it have the property. In particular, we consider verification of perfection, individual rationality, Nash stability, (contractual) individual stability, and core stability. While there is always a Nash-stable coalition structure (which also implies individually stable coalitions), we show that the existence of a perfect coalition structure is not tautological but can be tested. All our testers have one-sided error and time complexity that is independent of the input size.

In hedonic games, players form coalitions based on individual preferences over the group of players they could belong to. Several concepts to describe the stability of coalition structures in a game have been proposed and analysed in the literature. However, prior research focuses on algorithms with time complexity that is at least linear in the input size. In the light of very large games that arise from, e.g., social networks and advertising, we initiate the study of sublinear time property testing algorithms for existence and verification problems under several notions of coalition stability in a model of hedonic games represented by graphs with bounded degree. In graph property testing, one shall decide whether a given input has a property (e.g., a game admits a stable coalition structure) or is far from it, i.e., one has to modify at least an -fraction of the input (e.g., the game's preferences) to make it have the property. In particular, we consider verification of perfection, individual rationality, Nash stability, (contractual) individual stability, and core stability. While there is always a Nash-stable coalition structure (which also implies individually stable coalitions), we show that the existence of a perfect coalition structure is not tautological but can be tested. All our testers have one-sided error and time complexity that is independent of the input size.

Introduction
Hedonic games are a form of coalition formation games, in which players form teams in a decentralized manner based on individual preferences over coalitions, i.e., subsets of players. The solution to such a game is a coalition structure, i.e., a partition of the set of players. The main idea of hedonic games is that the players' evaluation of a coalition structure only depends on their own coalitions and not on how other players work together [DG80]. These games have been formalized by Banerjee, Konishi, and Sönmez [BKS01] and Bogomolnaia and Jackson [BJ02], independently. In order to evaluate the quality of a coalition structure, several solution concepts have been considered. These include, e.g., Nash stability, which states that no individual player wants to deviate from the coalition structure, and core stability, which requires that no group of players wants to deviate and form a coalition of their own.
Algorithmically, a key issue is to find suitable representations of hedonic games: Since the number of possible coalitions for a player is exponential in the number of players, there is a trade-off between compactness and expressivity of the preference profile. In the areas of Cooperative Games in Multiagent Systems (see [CEW11] for details) and Computational Social Choice (see [AS16] for details), a number of representations and stability concepts are analysed with respect to the computational complexity of deciding whether there exists a stable solution, verifying whether a given solution is stable, and finding a stable solution. Even for restricted representations such as additively separable games, these questions are often intractable. For instance, it is often NP-complete to decide whether a given game allows a Nash-stable coalition structure, see Peters [Pet16] for an example. The existence of core-stability is often even Σ p 2 -complete to decide; examples can be found in Woeginger [Woe13] and Ota et al. [Ota+17]. This strikes even harder when the considered game instances are very large because they arise from, e.g., social networks or the assignment of advertisements to available slots on web pages so that competing ads do not interfere (this can be configured in real advertisement services [Goo20a;Goo20b]). Here, it might already be impractical to read the whole input once because the data does not fit into memory or the access is slow or restricted.
In this article, we study sublinear algorithms for hedonic games. We aim to decide in sublinear time whether a game has a stable coalition structure or is far from this with respect to the number of required changes of preferences such that it admits a stable coalition structure, as well as whether a game is stable under a given coalition structure Γ or is far from being stable under Γ. When a coalition can be stabilized by only few compromises on the preferences, it may be acceptable to sustain the situation. When, however, too many modifications are required to obtain any stable situation, the current situation is too far off.
Graph representations provide a compact means to encode structural connections between players. A formal study of graphical hedonic games is provided by Peters [Pet16]. A popular variant is to encode a game as a network where players correspond to vertices and edges illustrate friendship relations. Players that are not friends are often referred to as enemies. Preferences are extended either by prioritising appreciation of friends or aversion to enemies [Dim+06]. However, if the game is very large, many players may not be involved in any relationship. In this scenario, it is natural to consider a more general model. For each player, the set of other players is divided into three subsets: friends, enemies and neutral players [Ota+17], which is what we call the FENencoding. Furthermore, we bound the number of friends and enemies per player by a constant. For example, if the players are humans, it is known that each player can only maintain a limited number of stable relationships to other humans [Dun92;DD98]. This number is known as Dunbar's number, and empirical estimates are smaller than 300 [Her+10]. If the players are advertisements, advertisers might expect positive or negative effects for a limited number of other advertisements when placed on the same web page (e.g., an ad for a phone and an ad for an accessory item might up-sell while two ads for comparable phone models might only cross-sell). Under restrictions such as bounded degree and bounded treewidth, some stability questions become solvable in linear time [Pet16]. Nevertheless, this still incurs the evaluation of the whole game in order to verify whether a coalition structure is stable. Given the local views of individual vertices within hedonic games, it would be preferable and much more practical to ask only a sample of players for their individual preferences and deduce global properties.
The area of property testing provides a framework to relax such decision problems in favour of sublinear complexity (see [Gol17] for an overview). A property tester is a randomized algorithm that decides, with error probability at most 1 /3, whether the input satisfies some property P or is far from satisfying P by probing only a small part of it. In the setting of graph properties, a graph G with bounded vertex degree d is -far from satisfying some property P (e.g., bipartiteness) if one has to modify at least dn edges to make G have property P. If the property tester always accepts graphs in P, it has one-sided error; otherwise, it has two-sided error. The input graph G may be probed by the algorithm through an oracle that provides access to the entries of the adjacency lists of G, and the computational complexity of the property tester is measured in terms of queries it asks.
In comparison to classic decision problems, property testing problems allow for algorithms with sublinear complexity. For example, a randomized decision algorithm for graph connectivity needs to read the whole input to achieve constant error probability, which implies a linear lower bound on the complexity. In contrast, a property tester for connectivity has only constant complexity [GR02]. This difference arises because the property tester does not need to read the whole input, and, in fact, sublinear complexity renders this impossible. Therefore, the input model plays an important role in property testing. While there is a characterization for constant query testable properties in dense graphs (graphs with Ω(|V | 2 ) edges) [Alo+09], less is known for graphs with bounded degree and general graphs.

Our Contribution
We study property testing of stability problems in FEN-hedonic games, where each player has a bounded number of symmetric relationships to friends and enemies as represented by labelled edges of an undirected graph, and preferences are extended to coalitions by any utility function linear in the number of friends and enemies in a coalition. The setting of hedonic games enhances graphs by rich semantics, which stands in contrast to purely combinatorial and geometric properties previously studied in graph property testing. We model the semantics of hedonic games as an additional layer on top of the combinatorial graph structure and analyse existence and verification problems for various stability concepts. In particular, we study common individual-based stability concepts such as perfection, individual rationality, Nash stability, and (contractual) individual stability as well as core stability.
While individually rational, Nash-stable, individually stable, and contractually individually stable coalitions always exist, there are games which do not allow a perfect coalition structure.
Theorem 1. Given an FEN-hedonic game G with bounded degree d, it can be tested whether G admits a perfect coalition structure with bounded coalition size c. The tester has one-sided error and query complexity poly( , c, d).
We provide the technical result as Theorem 16 in Section 4.2. While the existence problem as to whether a game allows a stable outcome is a property of edge-labelled graphs, the verification problem of whether a game satisfies stability according to a given coalition structure Γ requires additional modelling: We assume that next to oracle access to the adjacency lists of the underlying bounded-degree graph of a game G, we have additional access to an oracle to Γ, i.e., to the given partition of the vertex set.
Theorem 2. Given an FEN-hedonic game G with bounded degree d and a coalition structure Γ, it can be tested whether G is stable under Γ with respect to perfection, individual rationality, Nash stability, individual stability and contractual individual stability with one-sided error and query complexity poly( , d). For core stability we obtain a one-sided error tester with query complexity dependent on , c, and d, where c is the maximum coalition size.
We provide the technical result as Theorem 14 based on Theorem 13 in Section 4.1. Note that while we consider c and d to be of constant size, independent of the input size n, our statements remain valid if, for instance, d ∈ O(log n). We provide extensions of our theorems to weighted graphs (additively separable games) and directed graphs (asymmetric games) in Section 4.3.
A preliminary version [FKR19] of this work was published in the proceedings of AAMAS 2019 (International Conference on Autonomous Agents and Multiagent Systems). This is a revised version that also extends the preliminary version by a verification tester for core stability (see Theorem 14), an extension of our main theorems to weighted graphs (see Theorems 20 and 21), an extension of our main theorem on verification testing to directed graphs (see Theorem 22) and a lower bound related to our main theorem on testing the existence of a perfect coalition structure for directed graphs (see Theorem 23).

Related Work
Hedonic games were formally defined by Banerjee, Konishi, and Sönmez [BKS01] and Bogomolnaia and Jackson [BJ02]. A well-known application of a restricted variant with size-two coalitions is the stable-roommates problem [Kat02] for the allocation of student houses. Mostly, hedonic games have been analysed from a computational complexity point of view with respect to a trade-off between expressivity, succinct representation and tractability of stability decision problems. The complexity of general hedonic games has first been studied by Ballester [Bal04]. The worst-case complexity of stability problems for various representations and different stability concepts has been studied extensively since: Popular representations include additively separable hedonic games [BJ02; ABS13; Woe13], singleton encodings [CR01], hedonic coalition nets [EW09], and dichotomous preferences [Azi+16]; see also Aziz and Savani [AS16] and Chalkiadakis, Elkind, and Wooldridge [CEW11] for an overview. Peters and Elkind [PE15] analysed causes of and conditions for hardness. The existence of Nash stability and other individual stability concepts is often (if not guaranteed to exist) NP-complete to decide (see Sung and Dimitrov [SD10] for an analysis of additively separable games). For core stability, this is often even harder, namely Σ p 2 -complete [Woe13; Ota+17]. Dimitrov et al. [Dim+06] defined restricted hedonic games based on a network of friends and enemies. A more general version including neutral players was defined by Ota et al. [Ota+17]. Games with neutral players and partial individual evaluations were studied by Lang et al. [Lan+15] and Peters [Pet16]. In the latter work, in particular, the authors considered a constant bound on the number of individual preferences and studied graphical hedonic games with bounded treewidth. With this restriction, it can be decided in linear time whether, for instance, a Nash-stable coalition structure exists. A graphical model restricting to the formation of coalitions between players that are connected in the underlying graph was studied by Igarashi and Elkind [IE16]. Darmann et al. [Dar+18] studied games where players have preferences over different types of coalitions (activities) and their sizes instead of the participating players (this can also be expressed as a hedonic game). For the case that there is only one type of coalition, Lee and Shoham [LS15] and Lee and Williams [LW17] extended the setting by Darmann et al. so that each player may have a bounded number of friend-enemy relationships to other players.
The most related work to ours in the area of property testing is that for classic properties of graphs as there is, to the best of the authors' knowledge, no work on game theory so far. For example, Goldreich and Ron [GR02] showed that well-known properties of bounded-degree graphs like cycle freeness are testable with constant query complexity and two-sided error. However, for one-sided error testing of cycles freeness, Θ( √ n) queries are required [GR02] as well as sufficient as Czumaj et al. [Czu+14] show. Property testing of annotated (or labelled) graphs has been studied for geometric graphs mainly, e.g., by Ben-Zwi, Lachish, and Newman [BLN07], Czumaj and Sohler [CS08] and Hellweg, Schmidt, and Sohler [HSS10].
Learning hedonic games was studied by Sliwinski and Zick [SZ17]. While property testing focuses on testing whether a game admits a stable outcome or whether an outcome is stable with sublinear complexity, PAC learning constructs a good hypothesis and PAC stabilization uses this hypothesis to learn a stable outcome (if possible) using a superlinear number of samples (with possibly linear size). As far as we know, no sublinear algorithms have been developed for hedonic games, yet.

Preliminaries
In this article, we consider graphs with vertex degrees bounded by a constant d. If not stated otherwise, graphs are undirected and unweighted. For a graph G = (V, E) at hand, we write n = |V |. Without loss of generality, we assume that V = [n] = {1, . . . , n}.

Hedonic Games
A hedonic game (N, ) consists of a set of players N = [n] and a preference profile = ( 1 , . . . , n ), where i is player i's preference relation over N i = {C ⊆ N | i ∈ C}. A subset C ⊆ N of players is called a coalition. An output of a hedonic game is a coalition structure, i.e., a partition Γ of the player set. Let Γ(i) ∈ Γ be the coalition containing i ∈ N . We say that player i weakly prefers coalition A to coalition B, if Since the set N i of coalitions a player is contained in has an exponential size in the number of players, a central question in the study of hedonic games is to define representations that are adequately compact and at the same time as expressive as possible.
One common representation is that of a graph network, where the players in N are vertices in the graph. In the encoding as defined by Ota et al. [Ota+17], for each player The remaining players are considered as neutral N 0 We distinguish between the following cases: undirected, unweighted FEN-encoding: If not stated otherwise, we consider undirected and unweighted graphs. Hence, we have symmetric preferences, i.e., i ∈ N + j if and only if j ∈ N + i and i ∈ N − j if and only if j ∈ N − i . directed, unweighted FEN-encoding: If the graph is directed, preferences can be asymmetric, e.g., player i can consider j as a friend, but j can consider i as neutral or even an enemy.
weighted FEN-encoding: In addition edges can be weighted, i.e., each player i specifies a value w(i, j) for each other player j ∈ N i . We assume that Here edges can also be either undirected (w(i, j) = w(j, i)) or directed (possibly different values for w(i, j) and w(j, i)).
The latter two cases are studied in Section 4.3. In the unweighted case, we extend the players' relations to preferences in the following manner. A value function is specified such that each player i ∈ N assigns a fixed positive value to each friend and a fixed negative value to each enemy. Formally, for two values f, e ∈ R >0 , a corresponding utility function u i : N i → R, i ∈ N , is defined additively by For instance, friends appreciation can be represented by f = d and e = 1, and enemies aversion by f = 1 and e = d. The preference extension is obtained by Definition 3 (FEN-hedonic game). Let (N, ) be a hedonic game represented by an undirected and unweighted FEN-encoding, with preference profile extended via utility function u i . We call (N, ) FEN-hedonic game.
For directed and weighted FEN-encodings, we refer to such games as directed and weighted FEN-hedonic games, respectively.  [Pet16] such that a player i's preference of a coalition C ∈ N i over a coalition D ∈ N i only depends on i's neighbourhood Note that responsiveness is always satisfied, i.e., C ∪ {j} i C and C i C ∪ {j }, for each i ∈ N , and each C ∈ N i and j ∈ N + i , j ∈ N − i . Weighted and directed FEN-hedonic games are equivalent to additively separable hedonic games [BJ02] via w(i, j) = 0 for j ∈ N 0 i and weighted, undirected FEN-hedonic games are equivalent to symmetric additively separable hedonic games. Furthermore, we make the following assumptions. We consider graphs of bounded degree |N i | ≤ d represented by an adjacency list; in particular, it can be decided in time independent of the number n of players whether C i D, and independent of the coalition size |C| and |D|. Moreover, it is often useful to restrict the coalition size, e.g., when players are people that have to communicate or when a coalition represents all ads displayed on a single web page. Therefore, we also consider a bounded coalition size of |C| ≤ c.
By G n we denote the set of graphs with n vertices that represent such a game. The set of coalition structures partitioning n players is denoted by C n . In the following, let G = (N, F ∪ E) be a graph that represents a FEN-hedonic game and let Γ ∈ C n be a coalition structure solving this game. There are several solution concepts motivated from different perspectives on the game. Note that in comparison to the definitions in the literature we take into account the bound on the coalition size |C| ≤ c. Whenever c = n holds, the stability concepts are equivalent to their original definition. Let Fav(i) denote the set of player i's favourite coalitions of size at most c, i.e., those coalitions that i weakly prefers over all other coalitions C ∈ N i of size |C| ≤ c. On the one hand, Γ is called perfect if each player i ∈ N weakly prefers Γ(i) to every coalition, i.e., Γ(i) ∈ Fav(i). Even for unbounded coalition size, there is no perfect coalition structure in H. However, the coalition structure Γ is core-stable and Nash-stable in H (and due to Nashstability, it is also individually stable and contractually individually stable).
This property reflects an ideal situation, but is rather rarely fulfilled.
On the other hand, Γ is called Individual rationality is guaranteed by {{i} | i ∈ N }. Other stability notions are based, for example, on the lack of deviations of a single player to another (possibly empty) existing coalition. A coalition structure Γ is called Nash-stable if no player wants to move to another existing or empty coalition, i.e., for each player i ∈ N and each coalition C ∈ Γ ∪ {∅} with |C| < c, it holds that individually stable if no player can move to another preferred coalition without making a player in the new coalition worse off, i.e., for each player i ∈ N and for each coalition contractually individually stable if no player can move to another preferred coalition without making a player in the new coalition or in the old coalition worse off, i.e., for each player i ∈ N and for each coalition Note that Nash stability implies individual stability, which, in turn, implies contractual individual stability. A further popular stability concept is based on group deviation. A coalition structure Γ is called core stable if no coalition blocks Γ, i.e., for each non-empty coalition C ⊆ N with |C| ≤ c, there exists a player i ∈ C such that Γ(i) i C. Figure 1 shows two examples of FEN-hedonic games and the stability concepts defined above. For a stability concept, questions of interest are: • Verification: Given a game and a coalition structure, is it stable?
• Existence: Is a given game stable, i.e., does there exist a stable coalition structure?

Graph Property Testing
Let G = (N, F ∪ E) be a graph with vertex degrees bounded by d and let P be a graph property, i.e., a set of graphs (e.g., let P be all graphs that admit a perfect coalition structure). We say that G is -far from a property P if more than dn edges of G have to be modified (i.e., added or removed) in order to convert it into a graph that satisfies the property P, otherwise G is -close to P. A property tester has access to G by querying a function f G : Definition 4 (one-sided testers). A one-sided error -tester for a property P of boundeddegree graphs with query complexity q is a randomized algorithm A that makes q neighbourhood queries to f G for an input graph G. The algorithm A accepts G if G has the property P. If G is -far from P, then A rejects G with probability at least 2 /3.
Similarly to one-sided error decision algorithms, a one-sided error tester has to accept all graphs that have the property at hand. Therefore, it has to present a witness against the property when it rejects.
Many classic graph properties (e.g., planarity) are maintained when edges are removed from the graph; we observe the same for properties of hedonic games.
Definition 5 (edge-monotonicity). A graph property P is edge-monotone if for every In other words, every subgraph of G is also in P.

The Model of Property Testing for Stability Concepts
To test stability concepts, we slightly generalize the standard edit distance that underlies the definition of being -far as follows. Since we consider graphs G = (V, F ∪ E) that represent FEN-hedonic games, we have to account for the two types of edges: friends and enemies. Therefore, an edge modification is one insertion of an element to or one removal of an element from F ∪ E, respectively, while maintaining F ∩ E = ∅. In particular, turning a friend edge into an enemy edge is counted as two edge modifications (removing it from F and inserting it into E). The intuition of these semantics is that edge modifications measure the number of compromises that are needed to reach a stable situation. If a partition is too far from being stable, too many compromises are necessary, and the partition should be discarded. Everything in-between is not an ideal situation, but may be affordable. Now, the existence of a stable outcome in a game is modelled as a graph property as follows.
Definition 6 (stability existence property). The set of stable graphs with respect to some stability concept (e.g., Nash stability) is the set of all graphs that admit a stable coalition structure.
For some stability concepts, the existence of a stable outcome is guaranteed. Nevertheless, the question of whether a given partition Γ satisfies the stability property can still be hard to decide. For all stability concepts mentioned above, the worst case time that is needed to verify stability of Γ is at least linear in the number of players. We can, however, tackle the following problem in sublinear time: Given a graph G and a partition of vertices Γ, is Γ a stable outcome for the game represented by G, or is G -far from being a stable instance for Γ?
Definition 7 (Γ-stability verification property). Let n ∈ N, and let Γ be a partition of [n]. The set of Γ-stable graphs with respect to some stability concept (e.g., Nash stability) is the set of n-vertex graphs G such that Γ is stable for G.
Note that, unlike the existence of a stable coalition structure, a stability property is not closed under isomorphism as long as Γ is not permuted accordingly. Therefore, extending the basic model of graph property testing to reflect the semantics of hedonic games is the foundation of our main contribution, and it is the main difference between our model and the vanilla model of graph property testing.
Definition 8 (query access to Γ). Access to Γ is provided by a set oracle that supports two queries. A find query returns, given a vertex v, the key of the set that contains v. A member query returns, given a key k and an index i, the i-th element of the set represented by k, or null if no such element exists.

Property Testing Results in the FEN-Model
In this section we study property testers for stability verification problems, resulting in Theorem 2, as well as stability existence problems, resulting in Theorem 1, for various individual-based stability notions within the previously defined model of FEN-hedonic games.

Testing Verification Problems
In the following we prove Theorem 2, the testability of verification problems with query complexity dependent only on the degree bound, but independent of the input graph's size, which is restated in Theorem 14 below. Our algorithm can test the verification problem for every stability concept that can be defined using the notion of feasible player properties (see Definition 10), which is what we prove in Theorem 13. We state the feasible player properties for all of the stability concepts in Table 1 and prove the query complexity of Algorithm 1 for these properties (see Theorem 14).
We observe that due to responsiveness in all preference extensions of FEN-hedonic games, an edge modification that benefits one player, can never be a disadvantage for other players.
Observation 9. Let i, j ∈ N be two players in the FEN-hedonic game represented by a graph G = (N, F ∪ E). Furthermore, let i be i's original preference relation, and i the preference relation of i after deleting edge (i, j). Formally, the resulting game is represented by the graph G = (N, F ∪ E \ {(i, j)}) with the same preference extension. The following statements hold: 3. If (i, j) ∈ E, and C i D for two coalitions C, D ∈ N i with j ∈ C, it holds that C i D.
4. If (i, j) ∈ F , and C i D for two coalitions C, D ∈ N i with j / ∈ C, it holds that C i D.
Many stability concepts are of the form such that stability holds if and only if no player i satisfies a certain condition φ(i). If there exists a player j that satisfies this condition φ(j), we call j a witness for non-stability. Let φ denote such a player property assigning each player i either value 1 (i is a witness against the property) or value 0 (i is not a witness). In the following proofs we require certain conditions to hold for φ and show that all concepts in Table 1 share these conditions, which enables us to devise a unified testing scheme.
Definition 10 (feasible player property). Let γ be a stability concept and let φ : G n × C n → {0, 1} n be a function that is parameterized by n ∈ N. If, for every n-player game G ∈ G n , every coalition structure Γ ∈ C n and every i ∈ N , it holds that φ i (G, Γ) = 0 if and only if Γ is stable in G with respect to γ, then φ is a player property. We say that φ is feasible if for every n ∈ N, every G = (N, F ∪ E) ∈ G n and every Γ ∈ C n the following conditions are met for each i ∈ N .
(ii) The value φ i (G, Γ) can be determined with a constant number of queries to the oracles for G and Γ (i.e., dependent on , d, but independent of n).  Player properties for the stability concepts we consider are summarized in Table 1. We note that if φ is feasible, then φ is edge-monotone. Feasibility (including edgemonotonicity) and the following two lemmas act as the tie between stability concepts we consider and property testing. In particular, they expose characteristics of the stability concepts that can be exploited by a property tester.
In our constructions we relate to the players' favourite coalitions and make use of the following lemma that states that we can easily modify a player's local surroundings to turn the current coalition into a favourite coalition. In other words, only a constant number of compromises suffice to optimise one player's current situation. In particular, this turns a witness according to a feasible player property into a non-witness. Proof. If for player i, it already holds that Γ(i) ∈ Fav(i), no modification is required. Otherwise we can proceed as follows: Accessing the (at most d) members of N i requires at most d neighbourhood queries. Moreover, we can issue one find query each in order to determine whether a player j ∈ Note that this is independent of any bound c of the coalition size. The obtained coalition now only contains friends of i and i does not have any friends outside of Γ(i). Hence, for all preference extensions of FEN-hedonic games, no coalition is preferred to the current coalition Γ(i).
The following lemma extends Lemma 11 to multiple players. Essentially, it allows us to conclude that if a game is -far from being stable for a stability concept that has a feasible player property, there must be roughly n witnesses.
Lemma 12. Let G = (N, F ∪ E) ∈ G n be a FEN-hedonic game and let Γ be a coalition structure of N . Furthermore, let γ be a stability concept for which there exists a feasible player property φ. If there are at most k witnesses, k · d edge modifications are sufficient to make the game stable with respect to γ.
Proof. By Lemma 11, for each witness i, d edge modifications are enough to turn Γ(i) into a favourite coalition, thus, φ(i) = 1 is no longer satisfied. For each player j that is not a witness, φ(j) = 0 already holds which does not change due to Conditions (iii) and (iv) of Definition 10. If there are at most k witnesses, k · d edge modifications are sufficient such that no player satisfies φ(i), thus, stability with respect to γ holds.
With the help of this lemma we are now ready to prove that Algorithm 1 provides a property tester for the verification problem of each stability concept with a feasible player property.
Theorem 13. Let γ be a stability concept for which there exists a feasible player property φ. It holds that Algorithm 1 is a one-sided error property tester for Γ-stability verification with respect to γ. Proof. If γ holds, there is no witness for non-stability, i.e., for each sampled vertex φ(i) = 0 holds. Therefore, the tester decides in Line 6 that γ holds with probability 1.
If Γ is -far from being stable with respect to γ, at least dn edge modifications are required. Thus, by Lemma 12, there are at least dn /d = n witnesses. Hence, the probability that a sampled player is a witness is at least n · 1 /n = .
Then, the algorithm correctly rejects if at least one witness is sampled, i.e., the condition in Line 5 is true. The probability of this event is 1 minus the probability that for each sampled player the condition in Line 5 is false, i.e., φ i (G, Γ) = 0. The latter probability is at most Thus, the probability that the tester correctly rejects is at least 2 /3. Since φ is feasible, φ i (G, Γ) can be determined in constant query time. Hence, the tester requires constant query time dependent on the applied function φ. Table 1 has such a feasible player property φ. By Theorem 13, Algorithm 1 is a verification tester with a query complexity depending on φ. As mentioned in Section 2.2, a one-sided error tester needs to present a witness when it rejects. Therefore, the query complexity of a one-sided error tester is at least the minimum size of a witness. This is, in particular, relevant for testing stability verification of core stability, as core stability puts conditions on the preferences of all participants of a potentially blocking coalition (see the corresponding player property in Table 1). Therefore, we parametrize by the maximum coalition size for testing stability verification of core stability.  Table 1 we show that there exists a feasible player property by considering the four conditions of Definition 10. This allows us to apply Theorem 13. In each case we determine the exact query complexity of the tester.

Now it remains to show that each stability concept in
perfect: The corresponding player property is (i) Condition (i) holds by definition of perfection.
(ii) We have φ i (G, Γ) = 1 if and only if Γ(i) is missing one of i's friends or contains one of i's enemies, which can be verified in constant query time by asking whether j is in the same coalition as i for each j ∈ N i . Therefore, Condition (ii) is met with d queries per sampled player. In total, the query complexity is in O( d / ).
(iii), (iv) Conditions (iii) and (iv) are implied immediately by Observation 9, since the relation Γ(i) i C remains valid in each relevant case.
individually rational: Here, the player property is (ii) Since the decision whether {i} i Γ(i) only depends on |Γ(i) ∩ N i |, d queries are sufficient, i.e., a total query complexity in O( d / ), which satisfies Condition (ii).
Nash-stable: A witness i against Nash stability satisfies (i) Condition (i) holds, since Γ(i) ∈ Fav(i) implies Γ(i) i C; in particular, this is true if C = C ∪ {i} for a C ∈ Γ ∪ {∅}.
(ii) We consider the following cases regarding Condition (ii): (Γ(i)). Due to the linearity of the preferences, this can only be {i} (with u i ({i}) = 0) or a coalition in Γ that contains at least one friend. There are at most |N + i | ≤ d coalitions in Γ that contain a friend, namely Γ(j), j ∈ N + i . Hence, at most d comparisons of coalitions are sufficient, which can be done with at most d neighbour and d find queries by Equation (1).   (i) Hence, if i is not a witness for a Nash deviation, it cannot be a witness here, either. Therefore, Condition (i) holds.
(ii) Since C ∪ {i} i Γ(i) was already discussed for the case of Nash stability, it remains to consider the additional condition ∀j ∈ C : C ∪ {i} j C that extends the player property of Nash stability. If i wants to deviate, this is due to one of the cases (a), (b), or (d) from the case distinction of Nash stability above. In cases (a) and (b), we have to consider at most |N + i | candidate coalitions, i can deviate to. For each neutral player j ∈ N 0 i , it holds that Γ(j) ∼ j Γ(j) ∪ {i}. Thus, we only have to ask i's neighbours for permission to enter the new coalition, which are in total at most d. In fact, due to the symmetry of preferences, friends always welcome i, and enemies never do. In case (d), Γ(i) is not acceptable, and i is always welcome in {i}.
We obtain φ i (G, Γ) = 0 if and only if there are no enemies in C, which we can decide with at most d queries. Thus, we can employ the same queries as for Nash stability in order to determine φ i (G, Γ), which satisfies Condition (ii). The total query complexity of Algorithm 1 is in O( d / ).
(iii) If i wants to move to another coalition C ⊆ Γ∪{∅} but there exists a player j ∈ C with C j C ∪ {i}, then j is i's enemy due to Observation 9. Therefore, deleting edges from F cannot make C ∪ {i} a feasible deviation if it was not feasible before. If i is not a witness because there does not exist any preferred coalition to move to, the arguments for Nash stability can be applied. Thus, Condition (iii) is met.
(iv) If an edge (i, j) is deleted from E and j ∈ Γ(i), Condition (iv) can only be false if Γ(j) j Γ(j) ∪ {i}. However, i ∈ Γ(j) because Γ(j) = Γ(i), which is a contradiction. If i is not a witness because there does not exist any preferred coalition to move to, the arguments for Nash stability can be applied. Therefore, Condition (iv) is met. (i) Condition (i) holds analogously to individual stability.
(ii) Observe that for neutral players j ∈ N 0 i ∩ Γ(i) it holds that Γ(i) ∼ j Γ(i) \ {i} and for enemies j ∈ N − i ∩ Γ(i) it holds that Γ(i) \ {i} j Γ(i). Again, if i wants to deviate to a coalition, cases (a), (b) and (d) from Nash stability remain. In case (a) i has friends in Γ(i) that i contractually depends on. Here φ i (G, Γ) = 0. In cases (b) and (d) there are no friends in Γ(i), which means there is no contractual dependence. Then, i is a witness against contractual individual stability if and only if it is a witness against individual stability. Thus, in case (d) φ i (G, Γ) = 1 and in case (b) that same queries as above can be applied. Thus, we need at most O(d) queries in order to determine φ i (G, Γ). The total query complexity of Algorithm 1 is in O( d / ), which satisfies Condition (ii).
core-stable: A witness i against core-stability satisfies Observe that if there exists a coalition blocking Γ, its connected components also block Γ. Hence, we can assume that C is connected. It either holds that Γ(i) is not acceptable for i, and C = {i} or C is a neighbouring coalition 1 to i. (ii) In order to detect a connected blocking coalition C that contains i, we have to query the oracle as follows: We verify whether Γ(i) is acceptable for i by considering the intersection of i's neighbours N i with Γ(i). If it is not acceptable, C = {i} holds, and thus, φ i (G, Γ) = 1. If Γ(i) is acceptable, C can only be any of i's neighbouring coalitions that are connected and of size |C| ≤ c. There are at most possible such coalitions. For each of these coalitions C, we ask the at most c contained players j ∈ C whether they prefer C to Γ(j) by querying their at most d neighbours. This is sufficient to verify whether one of the coalitions blocks Γ and, thus, whether i is a witness. Therefore, the total query complexity of Algorithm 1 is in O( c 2 ·d c 2 +1 ·e c / ) and Condition (ii) holds.
(iii), (iv) Let φ i (G, Γ) = 0, i.e., for each neighbouring coalition C to i, there exists some j ∈ C such that Γ(j) j C. Condition (iii) holds by the following argument. Assume, an edge (i, k) is removed from F , k ∈ Γ(i). Then, it holds that: If k = j and i = j, φ i (G, Γ) = 0 remains valid. If i = j, Γ(i) i C implies that Γ(i) i C by Observation 9. If k = j and i = j, Γ(k) k C implies that Γ(k) k C by Observation 9. Similarly, Condition (iv) is obtained by Observation 9.

Testing Existence Problems
Now we prove Theorem 1. In general, there always exists an individually rational coalition structure (all coalitions are singletons). Bogomolnaia and Jackson [BJ02] show that in symmetric additively separable hedonic games there always exists a Nash-stable coalition structure. Note that in our model the argument that if a player deviates, the social welfare increases, remains valid, even for bounded coalition size. Their result and its proof extend easily to the case of bounded coalitions sizes, and a sketch of the proof is provided for the sake of referencing to parts of it later.
Lemma 15 ( [BJ02]). Each symmetric FEN-hedonic game (such as all preference extensions of FEN-hedonic games) allows a Nash-stable, and consequently individually stable and contractually individually stable coalition structure.
sketch. Let Γ be a coalition structure containing coalitions Γ(i) and C ⊆ N with |C| ≤ c−1. We assume that C∪{i} i Γ(i). Moreover, let Γ be the coalition structure obtained if i deviates to C, i.e., Γ contains Γ(i) \ {i} and C ∪ {i}. The social welfare SW(Γ) of a coalition structure Γ is the sum of all players' utilities of their current coalition. We observe that the difference of the social welfare of Γ and Γ always increases, which means that there exists a local maximum resulting in a Nash-stable coalition structure. It holds that the difference SW(Γ ) − SW(Γ) equals j∈N u j (Γ (j)) − u j (Γ(j)) Hence, there always exists a Nash-stable coalition structure, even if the coalition size is bounded. Since Nash stability implies individual and contractual individual stability, they are guaranteed to exist as well.
There does not necessarily exist a perfect coalition structure. For example, there does not exist any perfect coalition structure for G = ({1, 2, 3}, F ∪ E), where F = ((1, 2), (2, 3)), E = (3, 1). On the other hand, if F = ∅, the utility of any coalition structure is at most 0, so singleton coalitions are perfect; if E = ∅, there exists a perfect coalition structure if and only if no connected component is larger than c. For the general case |E|, |F | ≥ 0, we show that there exists a tester with one-sided error.
Theorem 16. There is a one-sided error property tester with constant query complexity for the existence of a perfect coalition structure in the FEN-hedonic game model with a constant coalition size bound c.
Proof. Let v ∈ N , and observe that C is a favourite coalition of v if and only if C It follows that there exists a perfect coalition structure Γ if and only if there does not exist any edge in E between vertices of the same connected component of This suggests the following algorithm: first, sample a set S of |S| = 1 / ln 3 vertices at random. For each v ∈ S, we run a BFS that follows only edges in F . If, at any point during its execution, the BFS has explored more than c vertices or has visited two endpoints u, w of the same edge (u, w) ∈ E, the tester rejects. 2 Otherwise, i.e., if none of these two conditions is met during the BFS for any v ∈ S, the tester accepts the graph.
By the above observation, every path in G that contains only edges from F must be in the same coalition in a perfect coalition structure. The algorithm rejects only when it finds a path P such that for every coalition structure Γ such that some coalition C ∈ Γ contains P , C also contains (u, v) ∈ E, which is a witness against the existence of a perfect coalition structure.
If G is -far from having a perfect coalition structure, then at least dn edges in F ∪ E have to be removed in order to make G have a perfect coalition structure because having a perfect coalition structure is an edge-monotone property (i.e., adding edges never decreases the graph's distance to the property, see also Lemma 12). Let R be a minimal set of edges that have to be removed. Since every vertex is incident to at most d other vertices, at least 2|R|/d > 2 dn/d > n vertices must be incident to an edge from |R|. If a vertex that is incident to an edge in R is in S, the algorithm finds a witness. The probability that none of the vertices in S is incident to an edge in R is at most As argued above, if a vertex in S is incident to an edge from R, the tester finds (u, v) and rejects.

Extensions to Weighted and Directed Encodings
Weighted, Undirected FEN-Encodings. The resulting games are equivalent to additively separable hedonic games [BJ02]. If each edge contributes equally to the edit distance (that underlies the definition of -far), this does not affect our proofs and Lemma 15 because they rely on the linearity of the utility function only. If an edge contributes proportional to its weight, we can use the following standard techniques from property testing. The first option is to require that the weights are bounded by some value W so that we can simply increase the sampling size in our algorithms by a factor of W . To see why this works, imagine an edge with weight w as w parallel edges, which essentially increases the bound on the vertex degrees to W · d. On the other hand, unbounded weights cannot be handled in the standard model by constant-query testers because a single edge that has weight 2 dn can make a graph -far, yet it is very unlikely to find this edge by sampling O(1) vertices uniformly. Therefore, another option is to allow vertex sampling proportional to the weights of incident edges or, equivalently 3 , sampling edges proportionally to their weight. We describe the modifications that are required to make our algorithms work with edge-weighted graphs and weight-proportional vertex sampling. Let G = (N, F ∪ E) be a graph with edge weights w : F → (0, ∞) and w : E → (−∞, 0), and define the weight of a vertex v as w(v) = e∈Nv |w(e)|. For the sake of simplicity, we write w : F ∪ E → (0, ∞) ∪ (−∞, 0) in the following. Definition 18 (weight-proportional distribution). Given a set S that is weighted by a function w : S → (0, ∞), the weight-proportional distribution W w (S) assigns probability mass w(x)/w(S) to x ∈ S, i.e., if X ∼ W w (S) is a random variable, then Pr[X = s] = w(x)/ y∈S w(y).
Definition 19 (weight-aware tester). A wait-aware one-sided error tester for graphs G = (N, F ∪ E) with edge weights w : F ∪ E → (0, ∞) ∪ (−∞, 0) is a one-sided error tester (see Definition 4) that has oracle access to i.i.d. samples from the distribution W w (N ).
Weighted Verification Problems. Lemma 11 and Lemma 12 hold without modifications for edge-weighted graphs. We modify Algorithm 1 as follows: in Line 3, we sample s players from N proportional to the sum of weights of their incident edges, i.e., the sum of weights of the relations to their friends and enemies. The resulting algorithm is given by Algorithm 2. Theorem 20 (Theorem 13, weighted version). Let γ be a stability concept for which there exists a feasible player property φ. It holds that Algorithm 2 is a weight-aware one-sided error property tester for Γ-stability verification with respect to γ.
Proof. The modified algorithm still accepts all stable coalitions Γ. If Γ is -far from being stable with respect to γ, every edge set R ⊆ F ∪ E whose removal stabilizes Γ has weight at least e∈F ∪E w(F ∪ E) by the weight-aware definition of -far from above. Hence, the probability that a sampled player is a witness is at least The proof continues as the proof of Theorem 13.
Weighted Existence Problems. Lemma 15 still holds for symmetric, additively separable hedonic games. The tester for the existence of a perfect coalition structure can be generalized as follows.
Theorem 21 (Theorem 16, weighted version). There is a weight-aware one-sided error tester with constant query complexity for the existence of a perfect coalition structure in the FEN-hedonic game model with a constant coalition size bound c.
Proof. Let G = (N, F ∪ E) be the input graph. Consider the following algorithm: first, sample a set S of |S| = 1 / ln 3 vertices from W w (N ). For each v ∈ S, we run a BFS that follows only edges in F . If, at any point during its execution, the BFS has explored more than c vertices or has visited two endpoints u, w of the same edge (u, w) ∈ E, the tester rejects. Otherwise, i.e., if none of these two conditions is met during the BFS for any v ∈ S, the tester accepts the graph.
As in the proof of Theorem 16, we can argue that the algorithm never rejects a graph that has a perfect coalition. Therefore, let G be -far from having a perfect coalition, let R ⊆ F ∪E be such that (N, (F ∪E)\R) is in P and w(R) is minimal among all such sets. We only need to prove that a properly adapted version of Inequality 3 holds. Observe that v∈{x,y|(x,y)∈R} |w(v)| ≥ 2 · w(F ∪ E) by the weight-aware definition of -far (see Definition 17). Therefore, the probability that none of the vertices in S is incident to an edge in R is at most Directed, Unweighted FEN-Encodings. In this case, friendship relations are no longer necessarily symmetric. For instance, this can be the case in social networks with a follower system. In property testing, there are two different models of directed graphs. In the bidirectional model, we may see all incoming and outgoing edges (followed players and followers can be queried). Assuming bounded out-degree, verification is not affected by the bidirectional model.
In the unidirectional model, we may see only one type -usually outgoing edges (only followed players can be queried). For the unidirectional model with outgoing edges, the verification problems remain testable. While being a witness against perfection, individual rationality, or Nash stability only depends on players' own preferences, the query complexity for individual stability and contractually individual stability depends on (the minimum of) the in-degree or the maximum coalition size: the case analysis changes because we are required to evaluate the preferences of the other members of the (still at most O(d)) affected coalitions.
Although there is a lossy but still sublinear transformation from constant-query testers in the bidirectional model into the unidirectional model [CPS16], the unidirectional model is often much harder to analyse and yields testers with worse query complexity. In detail, we obtain the following results.
Directed Verification Problems. Observation 9, Definition 10, and Lemma 11 are stated from a single player's perspective. Hence they remain valid assuming the standard notation that (i, j) represents an arc from i to j. Lemma 12, Algorithm 1, and Theorem 13 are unaffected by the generalisation. In fact the changes only depend on the player properties of the stability notions. Proof. Conditions (i), (iii), and (iv) remain valid for the unidirectional case. For perfection, individual rationality, and Nash stability Condition (ii) still holds with the same query complexity, since only queries for outgoing edges are made for each potential witness.
For individual stability, there are still at most O(d) possible coalitions, a sampled player i might want to deviate to. Whenever player i wants to deviate to a new coalition C, now each player j in C needs to be asked whether (j, i) is an edge in E. If, for all j ∈ C, that is not the case, i is a witness. This requires O(d(d + c)) queries, which satisfies Condition (ii). The total complexity of Algorithm 1 is in O( d(d+c) / ).
Similarly, for contractually individual stability, a player k only lets i move to a new coalition, if (k, i) is not an edge in F . If for each k ∈ Γ(i) that is the case, i is a witness.
For core stability, we already employ all necessary queries to new coalition members in the proof of the undirected case. Therefore, the query complexity remains the same.
Directed Existence Problems. Lemma 15 is not true anymore in general (note that Equation (2) does not hold in general due to asymmetry; see [BJ02] for an example). A perfect coalition structure exists if the weakly connected components induced by F do not induce any edges from E. Exploring weakly connected components causes no problem in the bidirectional model, but in the unidirectional model it can render exploration almost impossible. For example, consider a cycle of length c with alternating edge direction and all but one edge being friend edges. This graph makes it impossible to form perfect coalitions, and having dn copies of it as subgraphs makes a graph -far from admitting a perfect coalition structure. In fact, we show that testing the existence of a perfect coalition structure requires almost linear query complexity.
Theorem 23. Let > 0 and c ≥ 1 / d. There is no one-sided error -tester for the existence of a perfect coalition structure with coalition size bound c in the unidirectional model that uses o(n 1−2 d ) queries.
Proof. For all even ≥ 6, we define an alternating-cycle gadget Fig. 2). Let n ≥ ; we construct the graph G as the union of n / copies of H and n − · n / isolated vertices. Without loss of generality, to simplify the argument from now on, we assume that n is divisible by and that is even. The graph G is -far from having a perfect coalition structure if n / > dn ⇔ < 1 / d.
A one-sided error tester T needs to sample all odd vertices of an alternating-cycle gadget to certify that G does not have a perfect coalition structure. Without loss of generality, we may assume that whenever T queries a vertex v, it gets all vertices reachable from v in return (not just the i th neighbour of v it queried for). This modification 5 4 3 2 1 0 Figure 2: The alternating-cycle gadget H 6 . Observe that the odd (grey) vertices can only be found by directly hitting them as there are no incoming edges at odd vertices that can be followed.
makes the queries that T can issue only stronger but since at most 2 vertices are reachable from v, this reduces the query complexity of the tester by at most a factor 1 /3. Therefore, whenever T queries for a vertex v, the answer is either an isolated vertex {v} if v is an even vertex, or a triple {u, v, w} if v is an odd vertex. Note that due to the strengthening of queries, querying u or w after querying v does not reveal more information to T . We use Yao's principle and prove the theorem by lower-bounding the query complexity of any deterministic algorithm on the following input distribution. We generate all feasible vertex labelings of G (isomorphic copies of G ) and construct the uniform distribution D over these graphs. To simplify the analysis, we may assume that the labels are lazily assigned to an initially unlabeled version of G , i.e., when the vertex corresponding to a label is queried by or returned to T for the first time. It is known that the resulting random graph is drawn from D [GR11, Proof of Claim 5.5.2]. Consider running a tester T for perfection on a graph G sampled from D. Let s be an upper bound on the query complexity of T , and without loss of generality, assume that s ≤ n /6. Let S = (t 1 , . . . , t s ) be the sequence of all vertices from V that are queried by T . Fix an arbitrary alternating-cycle gadget H in G. Intuitively, to discover all odd vertices of H, an odd vertex must be revealed at /2 positions of S. There are s /2 ways to choose these positions. The probability to discover an odd vertex is roughly /2 /n, but since the set of unknown vertices is reduced by every query and the number of unknown odd vertices from H decreases, we take slightly more care.
Formally, for j ≥ 1, consider the j th -smallest i such that t i ∈ V (H) and t i is an odd vertex. When this query is issued, the probability that it reveals an odd vertex from H is ( /2 − (j − 1))/(n − k i ), where k i is the number of assigned labels before this query. By repetitively applying the definition of conditional probability to the event that the j th odd vertex of H is discovered conditioned on the 1 st to the (j − 1) th odd vertex being discovered, we can rearrange the probability that all odd vertices of H are revealed to obtain a product of the former probabilities. It follows that the probability that S contains all /2 odd vertices of H is at most Since, for all i ∈ [s], we have k i ≤ 3s, the subtrahend 3s accounts for the fact that each query may reveal at most 3 vertices to T . Inequality ( ) follows from the assumption s ≤ n /6. For any i ∈ [s], let E i be the event that S contains all odd vertices of the alternatingcycle gadget that t i is part of. By the union bound over (E i ) i∈[s] , S contains all odd vertices of at least one alternating-cycle gadget with probability at most s · ( 6s n ) /2−1 . We conclude that s · 6s n Assuming s ∈ o(n 1−2 d ) contradicts the assumption that T is a tester with error probability at most 1 /3.

Open Questions
A natural question that is related to finding stable partitions is the following: Given a graph G and a partition Γ, is the partition Γ far from being stable in G (instead of the graph being far from Γ-stable)? This can be generalized further: Property testing is a special case of local computation algorithms (LCA), where one shall provide oracle access to a solution, given oracle access to the input. In property testing, the solution is a single bit (accept or reject). While it is beyond the scope of sublinear algorithms to actually compute a stable partition, one may seek to develop an LCA that gives oracle access to it. Generalizing the results we obtained, one may seek to obtain sublinear algorithms for games with unbounded coalition size. Here, the main difficulty is to obtain insights into the local structure of very large, say, linear sized coalitions. Following a slightly different line of thought, one may consider other graphs models like the dense model, where (almost) all players relate to each other and one may ask how two players i, j relate, or the general graph model, where vertices have arbitrary degrees. These models are quite different from the bounded-degree model, as well as from each other. For the dense graph model, a characterization using Szemerédi regular partitions is known [Alo+09], and it seems possible that coalition formation could be expressed in terms of regular partitions. Much less is known about the general model. So far, most research is still focused on elementary graph problems like counting the number of constant-size cliques [ERS18]. It would be interesting to see whether stability properties are also constant-query testable in these two models. Another direction for further studies is property testers with two-sided error. These testers do not need to provide a witness against the property, but rather sufficient statistics that a graph is far from a property with constant probability.
As mentioned in the introduction, there exist also plenty of other stability concepts like Pareto-optimality and popularity that can operate on the same preference extension, which may be interesting to analyse in order to obtain a deeper understanding of locality mechanics in FEN-hedonic games. Here, the main difficulty is to circumvent the usually high computational complexity of the exact decision problems.
Finally, one may study other models of hedonic games, in particular with ordinal preferences (e.g., rankings over known edges [Lan+15]). This requires further modelling of the oracle access and considered distance measures.