1 Introduction

Residential segregation, that is, the occurrence of large separated and homogeneous areas inhabited by residents from the same social group, occurs frequently in cities all around the world and has thus become a major interest in sociology (see, e.g., [19, 34]). Such segregation patterns have been observed to be problematic, as they can, for example, lead to unequal access to healthcare or education [26, 40, 41]. While the reasons for the emergence of segregation patterns are likely complex and multi-causal in reality, Thomas Schelling proposed a deliberately simplistic random process [37, 38] that models individual behavior and offers an appealing explanation for why residential segregation can occur without any central planner or direct discrimination.

In Schelling’s model, one considers agents of two different types. Each agent is initially placed uniformly at random on an individual vertex of some given graph (also called topology), where an agent is called happy if at least a \(\tau\)-fraction of its neighbors is of its type for some given tolerance parameter \(\tau \in (0,1]\). Happy agents do not change location, whereas, depending on the model, unhappy agents either randomly swap vertices with other unhappy agents or randomly jump to empty vertices. Schelling [37, 38] observed that even for agents with \(\tau \sim \frac{1}{3}\), segregation patterns (i.e., large connected areas where agents have only neighbors of their type) are likely to occur. This observation highlights that the individual (local) preferences of moderately tolerant agents can lead to the emergence of global segregation patterns and contributes to an appealing and simple explanation of why segregation is a major and hard to counter problem in reality. Over the last 50 years, Schelling’s model has been thoroughly studied both from an empirical (see, e.g., [17, 22]) and a theoretical (see, e.g., [5, 6, 13, 28]) perspective in various disciplines including computer science, economics, physics, and sociology. Most works focused on explaining under which circumstances and how quickly segregation patterns occur.

In Schelling’s model it is assumed that unhappy agents move randomly. As this seems unrealistic, Schelling games, which are a game-theoretic formulation of Schelling’s model where agents move strategically in order to maximize their individual utility, have recently attracted considerable attention [1, 7, 20, 25, 29]. However, there is no unified formalization of the agents’ utilities in the different game-theoretic formulations. In this paper, we study a model of Schelling games which is as simple as possible. Specifically, we assume that all agents want to maximize the fraction of agents of their type in their occupied neighborhood and only change their location if they can increase this fraction by their move. This model differs from Schelling’s model of segregation in that agents only change their location if it is profitable for them and in that all agents want to maximize the homogeneity of their neighborhood (implicitly the latter part corresponds to setting the tolerance parameter to \(\tau =1\)). Thus, we consider a slightly more realistic, simple adaptation of Schelling’s model.

To further locate the model studied in this paper, we now discuss how it relates to some previous works on Schelling games. For instance, Chauhan et al. [20] and Echzell et al. [25] assumed that the utility of an agent a depends anti-proportionally on the maximum of 0 and the difference between the threshold parameter \(\tau\) and the fraction of agents of a’s type in the occupied neighborhood of a. As done by Agarwal et al. [1] and Bilò et al. [7], we assume that \(\tau =1\). Along a different dimension, in the works of Chauhan et al. [20] and Agarwal et al. [1], the utility of (some) agents also depends on the particular vertex they occupy. For instance, Agarwal et al. [1] assume that there exist some agents which are stubborn and have a favorite vertex in the graph which they never leave. In our model, as also done before by Bilò et al. [7], Echzell et al. [25], and Kanellopoulos et al. [29], we assume that the agents’ behavior does not depend on their specific vertex, so there are no stubborn agents.

The main focus in previous works and our work lies on the analysis of certain pure equilibria in Schelling games, where it is typically either assumed that agents can swap their vertices or jump to empty vertices; accordingly, an assignment is a swap-equilibrium (jump-equilibrium) if no two agents can increase their utility by swapping their position (if no agent can increase its utility by jumping to an empty vertex). In realistic scenarios, unstable states will only be present for a short time and the system will change until an equilibrium is reached. This motivates a study of equilibria, including analyzing their properties and, more fundamentally, understanding in which situations they exist.Footnote 1 As the existence and other specifics of equilibria crucially depend on the underlying topology, a common approach is to consider different graph classes [7, 20, 29].

1.1 Our contributions

The overall goal of this paper is to better understand the structural properties of equilibria and how they depend on the underlying topology in Schelling games. We address this goal on two fronts.

In the first, more technical part of the paper, we prove that deciding the existence of a jump- or swap-equilibrium in Schelling games where all agents want to maximize the fraction of agents of their type in their occupied neighborhood is NP-hard. Notably, our technically involved results strengthen results by Agarwal et al. [1], who proved the NP-hardness of these problems making decisive use of the existence of stubborn agents (which never leave their vertices). Our result suggests that it is challenging to obtain a full understanding of the existence and structure of equilibria in general graphs, and in particular that graphs with equilibria cannot be easily characterized. However, we show one way to circumvent this problem: As soon as each non-degree-one vertex in a graph has sufficiently many degree-one neighbors, swap-equilibria can be characterized and computed efficiently.

Having analyzed the existence of equilibria, in the second, more conceptual part, we introduce a new perspective for the analysis of equilibria in Schelling game: Stability under changes. Specifically, we introduce a notion for the robustness of an equilibrium under vertex/edge deletion. We say that an equilibrium has vertex/edge-robustness r if it remains stable under the deletion of any set of at most r vertices/edges but not under the deletion of \(r+1\) vertices/edges. Considering the original motivation of modeling residential segregation, it might for example occur that agents move away and leave the city or that certain roads or bus routes get shut down. In the context of swap-equilibria on which we focus in the second part, the earlier corresponds to deleting the vertex occupied by the leaving agent (or all edges incident to it).Footnote 2 In turn, closing roads or bus routes can be modeled by deleting the corresponding edge. An interesting task now is to find a more “robust” equilibrium that remains stable in such a changing environment, as for non-robust equilibria it could be that a small change can cause the reallocation of all agents. By studying the robustness of equilibria, we also shed further light on how equilibria depend on the underlying topology: If an equilibrium is very robust, then this means that its structure is not specific to only one distinct graph but contains “generally stable” configurations.

Table 1 Overview of robustness values of swap-equilibria for various graph classes

We study the existence of swap-equilibria with a given robustness. We restrict our attention to swap-equilibria, as for jump-equilibria, the robustness heavily depends on both the underlying topology and the specific numbers of agents of each type. Providing meaningful bounds on the robustness of a jump-equilibrium is therefore rather cumbersome. In our analysis of the robustness of swap-equilibria, we follow the approach from most previous works and investigate the influence of the structure of the topology [1, 7] (clearly robustness depends on the underlying topology). That is, we show tight upper and lower bounds on the edge- and vertex-robustness of swap-equilibria in Schelling games on topologies from various graph classes, summarized in Table 1. We prove that the edge- and vertex-robustness of swap-equilibria on a graph class can be arbitrarily far apart, as on cliques it is always sufficient to delete a single edge to make every swap-equilibrium unstable while every swap-equilibrium remains stable after the deletion of any subset of vertices. In contrast to this, all of our other lower and upper bounds are the same (and tight) for vertex- and edge-robustness and can be proven using similar arguments. We further show that the difference between the edge/vertex-robustness of the most and least robust equilibrium can be arbitrarily large: On paths there exists a swap-equilibrium that can be made unstable by deleting a single edge or vertex and a swap-equilibrium that remains stable after the deletion of any subset of edges or vertices. This suggests that on paths (and more generally on unstudied graph classes) one should be cautious when dealing with equilibria if robustness is important. In contrast to this, on cliques, cycles, and grids, from a robustness perspective it does not really matter which equilibrium is chosen.

As an example of a nontrivial graph class where every swap-equilibrium has robustness larger than zero, we define \(\alpha\)-star-constellation graphs (see Sect. 2.2 for a definition). We show that every swap-equilibrium on an \(\alpha\)-star-constellation graph has edge- and vertex-robustness of at least \(\alpha\). Moreover, independent of our robustness notion, we obtain a precise characterization of swap equilibria on \(\alpha\)-star-constellation graphs and a polynomial-time algorithm for checking whether a swap equilibrium exists on a graph from this class. Lastly, we prove that a swap-equilibrium always exists on a subclass of \(\alpha\)-star-constellation graphs and caterpillar graphs which we call \(\alpha\)-caterpillars (see Fig. 1 for an example of a 2-caterpillar).

1.2 Related work

Most of the works on Schelling games focused on one of three aspects: existence and complexity of computing equilibria [1, 7], game dynamics [7, 20, 25], and price of anarchy and stability [1, 7, 29]. The first area is closest to our paper, so we review some results here. On the negative side, Agarwal et al. [1] showed that a jump- and swap-equilibrium may fail to exist even on tree topologies and that checking their existence is NP-hard on general graphs in the presence of stubborn agents. In Sect. 3, we strengthen their result by showing that the problem remains NP-hard in the absence of stubborn agents. On a tree, the existence of a jump- and swap equilibrium can be checked in polynomial time [1]. On the positive side, Agarwal et al. [1] showed that a jump-equilibrium always exists on stars, paths, and cycles. Concerning swap-equilibria, Echzell et al. [25] showed that a swap-equilibrium always exists on regular graphs (and in particular cycles). Recently, Bilò et al. [7] proved that a swap-equilibrium is guaranteed to exist on paths and grids, and they obtained further results for the restricted case where only adjacent agents are allowed to swap.

Lastly, different from the three above mentioned directions, Bullinger et al. [16] and Deligkas et al. [23] studied the computational complexity of finding assignments in which agents are “as happy as possible”, e.g., Pareto-optimal assignments and assignments maximizing the summed utility of all agents. Further, Chan et al. [18] proposed a generalization of Schelling games where, among others, multiple agents can occupy the same vertex.

Interpreting the neighborhood of an agent as its coalition, Schelling games also share characteristics with hedonic games [12, 24], where agents are partitioned into disjoint coalitions and each agent has preferences over all possible coalitions it can be part of. Schelling games are in particular connected to (modified) fractional hedonic games [4, 8, 35], where agents’ utility for a coalition is the average of their utility for all individual coalition members, and hedonic diversity games [10, 14], where agents are of two different types and the preferences of agents over coalitions are fully determined by the fraction of agents of their type in the coalition. The main difference between hedonic games and Schelling games is that in Schelling games agents are placed on a topology so each agent has its own coalition and coalitions may overlap. Recently, Bodlaender et al. [9] proposed a model that can be somewhat considered as both a generalization of hedonic games and Schelling games: In their model, a set of agents with cardinal preferences over each other need to be placed on the vertices of a graph and the utility of an agent is its summed utility that it derives from all adjacent agents.

Analyzing the robustness of outcomes of decision processes has become a popular topic in algorithmic game theory [2, 11, 15, 30, 36, 39]. For instance, in the context of hedonic games, Igarashi et al. [27] studied stable outcomes that remain stable even after some agents have been deleted and, in the context of stable matching, Mai and Vazirani [32, 33] and Chen et al. [21] studied stable matchings that remain stable even if the agents’ preferences partly change.

2 Preliminaries

Let \({\mathbb {N}}\) be the set of positive integers and \({\mathbb {N}}_0\) the set of non-negative integers. For two integers \(i,j\in {\mathbb {N}}_0\) with \(i<j\), we denote by [ij] the set \(\{i,i+1,\dots , j-1, j\}\) and by [j] the set [1, j]. Let \(G=(V,E)\) be an undirected graph. Then, V(G) is the vertex set of G and E(G) is the edge set of G. For a subset \(S\subseteq E\) of edges, \(G-S\) denotes the graph obtained from G by deleting all edges from S. For a subset \(V'\subseteq V\) of vertices, \(G[V']\) denotes the graph G induced by \(V'\). Overloading notation, for a subset \(V'\subseteq V\), we sometimes write \(G-V'\) to denote the graph G induced by \(V{\setminus } V'\), that is, \(G-V'=G[V{\setminus } V']\). For a vertex \(v\in V(G)\), we denote by \(N^G(v)\) the set of vertices adjacent to v in G. The degree \(\deg ^G(v):=\vert N^G(v)\vert\) of v is the number of vertices adjacent to v in G. Lastly, \(\Delta (G):= \max _{v \in V(G)} \deg ^G(v)\) is the maximum degree of a vertex in G.

2.1 Schelling games

A Schelling game is defined by a set \(N = [n]\) of \(n \in \mathbb {N}\) (strategic) agents partitioned into two types \(T_{1}\) and \(T_{2}\) and an undirected graph \(G=(V, E)\) with \(\vert V\vert \ge n\), called the topology. The strategy of agent \(i \in N\) consists of picking some position \(v_i \in V\) with \(v_i \ne v_j\) for \(i, j \in N\) with \(i\ne j\). The assignment vector \({\textbf{v}}=\left( v_{1}, \ldots , v_{n}\right)\) contains the positions of all agents. A vertex \(v \in V\) is called unoccupied in \({\textbf{v}}\) if \(v \ne v_i\) for all \(i \in N\). In the following, we refer to an agent i and its position \(v_i\) interchangeably. For example, we say agent i has an edge to agent j if \(\{v_i, v_j\} \in E\). For an agent \(i \in T_l\) with \(l\in \{1,2\}\), we call all other agents \(F_{i}= T_l {\setminus }\{i\}\) of the same type friends of i. The set of i’s neighbors on topology G is \(N^G_{i}({\textbf{v}}):=\left\{ j \in N {\setminus } \{i\} \mid \left\{ v_{i}, v_{j}\right\} \in \right. E(G)\}\) (note that the neighbors \(N^G_{i}({\textbf{v}})\) of i are different from \(N^G(v_i)\), as \(N^G_{i}({\textbf{v}})\) contains the agents occupying adjacent vertices and as unoccupied vertices are disregarded). Further, \(a^G_i({\textbf{v}}):=\vert N^G_{i}({\textbf{v}}) \cap F_{i}\vert\) is the number of friends in the neighborhood of i in \({\textbf{v}}\).

Given an assignment \({\textbf{v}}\), the utility of agent i on topology G is:

$$\begin{aligned} u_i^{G}({\textbf{v}}) :={\left\{ \begin{array}{ll} 0 &{}\text {if } N^G_{i}({\textbf{v}}) = \emptyset \text {,}\\ \frac{a^G_i({\textbf{v}})}{\vert N^G_{i}({\textbf{v}})\vert }&{} \text {otherwise.} \end{array}\right. } \end{aligned}$$

If the topology is clear from the context, we omit the superscript G.

Given some assignment \({\textbf{v}}\), agent \(i \in N\), and an unoccupied vertex v, we denote by \({\textbf{v}}^{i \rightarrow v}=(v^{i \rightarrow v}_1,\dots , v^{i \rightarrow v}_n)\) the assignment obtained from \({\textbf{v}}\) where i jumps to v, that is, \(v_{i}^{i \rightarrow v}=v\) and \(v_{j}^{i \rightarrow v}=v_j\) for all \(j\in N{\setminus } \{i\}\). A jump of an agent i to vertex v is called profitable if it improves i’s utility, that is, \(u_{i}\left( {\textbf{v}}^{i \rightarrow v}\right) >u_{i}({\textbf{v}})\). Note that an agent can jump to any unoccupied vertex. For two agents \(i, j \in N\) with \(i\ne j\) and some assignment \({\textbf{v}}\), we define \({\textbf{v}}^{i \leftrightarrow j}=(v^{i \leftrightarrow j}_1,\dots , v^{i \leftrightarrow j}_n)\) as the assignment that is obtained by swapping the vertices of i and j, that is, \(v_{i}^{i \leftrightarrow j}=v_j\), \(v_{j}^{i \leftrightarrow j}=v_i\), and \(v_{k}^{i \leftrightarrow j}=v_k\) for all \(k\in N{\setminus } \{i,j\}\). Note that any two agents (independent of the vertices they occupy) can perform a swap. A swap of two agents \(i,j \in N\) is called profitable if it improves i’s and j’s utility, that is, \(u_{i}\left( {\textbf{v}}^{i \leftrightarrow j}\right) >u_{i}({\textbf{v}})\) and \(u_{j}\left( {\textbf{v}}^{i \leftrightarrow j}\right) >u_{j}({\textbf{v}})\) (see Fig. 1 for an example). Note that a swap between agents of the same type is never profitable.

An assignment \({\textbf{v}}\) is a jump/swap-equilibrium if no profitable jump/swap exists. Note that a jump-equilibrium is simply a Nash equilibrium for our Schelling game. Moreover, note that we are always interested in jump or swap equilibria, implying that we either allow agents to swap or to jump but not both. Following literature conventions, in cases where we allow agents to swap, we assume that \(n=\vert V(G)\vert\), while in cases where we allow agents to jump, we assume that \(n<\vert V(G)\vert\).

Fig. 1
figure 1

The displayed graph is a 2-star-constellation graph and a 2-caterpillar. We show a Schelling game with \(\vert T_1\vert =7\) and \(\vert T_2\vert =8\). Agents from \(T_1\) are drawn in light blue and agents from \(T_2\) in dark red. Let \({\textbf{v}}\) be the depicted assignment. It holds that \(u_i({\textbf{v}})=u_j({\textbf{v}})=\frac{1}{3}\) and \(u_i({\textbf{v}}^{i \leftrightarrow j})=u_j({\textbf{v}}^{i \leftrightarrow j})=\frac{1}{2}\). Thus, \({\textbf{v}}\) is not a swap-equilibrium, as i and j have a profitable swap (Color figure online)

2.2 Graph classes

A path of length n is a graph \(G=(V,E)\) with \(V=\{v_1, \dots ,v_n\}\) and \(E=\{ \{v_i, v_{i+1}\} \mid i \in [n-1]\}\). A cycle of length n is a graph \(G=(V,E)\) with \(V=\{v_1, \dots , v_n\}\) and \(E=\{ \{v_i, v_{i+1}\} \mid i \in [n-1]\} \cup \{\{v_n,v_1\}\}\). We call a graph \(G=(V,E)\) where every pair of vertices is connected by an edge a clique. For \(x,y\ge 2\), we define the \((x \times y)\)-grid as the graph \(G=(V,E)\) with \(V=\{ (a,b) \in \mathbb {N}\times \mathbb {N}\mid a\le x, b\le y\}\) and \(E=\{\{(a,b),(c,d)\} \mid \vert a-c\vert +\vert b-d\vert =1\}\). An x-star with \(x \in \mathbb {N}\) is a graph \(G=(V,E)\) with \(V=\{v_0, \dots , v_x\}\) and \(E=\{ \{v_0,v_i\} \mid i \in [x]\}\); the vertex \(v_0\) is called the central vertex of the star. We say that a connected graph \(G=(V,E)\) is an \(\alpha\)-star-constellation graph for some \(\alpha \in \mathbb {N}_0\) if it holds for all \(v \in V\) with \(\deg ^G(v) > 1\) that \(\vert \{ w \in N^G(v) \mid \deg ^G(w)=1\}\vert \ge \vert \{ w \in N^G(v) \mid \deg ^G(w)>1\}\vert + \alpha\). That is, the graph G consists of stars where the central vertices can be connected by edges such that every central vertex is adjacent to at least \(\alpha\) more degree-one vertices than other central vertices. Thus, an \(\alpha\)-star constellation graph consists of (connected) stars forming a constellation of stars, which gives this class its name. An \(\alpha\)-caterpillar is an \(\alpha\)-star-constellation graph where the graph restricted to non-degree-one vertices forms a path (see Fig. 1 for an example). We consider these two classes of graphs because equilibria on these graphs exhibit interesting robustness patterns. Note that an alternative view on \(\alpha\)-star-constellation graphs is that we start with some arbitrary underlying graph and then add a sufficient number of degree-one vertices to each original vertex for the above condition to be fulfilled.

3 Computing equilibria

This section is split into three parts. In the first (resp., second) part, we show that deciding the existence of a swap (resp., jump) equilibrium is NP-hard. In the third part, we give a characterization of and an algorithm for computing swap-equilibria in \(\alpha\)-star-constellation graphs, which will be studied in more detail in Sect. 4.

Before we start with the presentation of our NP-hardness reductions, we give some general overview and problem definitions that apply to both Sects. 3.1 and 3.2. Specifically, we prove the NP-hardness of the following two problems:


Swap/(Jump)-Equilibrium [S/(J)-Eq]

Input::

A connected topology G and a set N = [n] of agents with \(\vert V(G)\vert = n\,(\vert V(G)\vert > n)\) partitioned into types T1 and T2.

Question::

Is there an assignment v of agents to vertices where no two agents have a profitable swap (no agent has a profitable jump)?

We will reduce from variants of this problem with stubborn and strategic agents that were proven to be NP-hard by Agarwal et al. [1]. In their model, a strategic agent wants to maximize the fraction of agents of its type in its occupied neighborhood (like the agents in our definition) and a stubborn agent has a favorite vertex which it never leaves (in our definition, such agents do not exist). Formally, Agarwal et al. [1] proved the NP-hardness of the following problems:


Swap/(Jump)-Equilibrium with Stubborn Agents [S/(J)-Eq-Stub]

Input::

A connected topology G and a set N = [n] = \(R {\dot{\cup }} S\) of agents with \(\vert V(G)\vert = n\,(\vert V(G)\vert > n)\) partitioned into types T1 and T2 and a set \(V_s =\{s_i \in V(G) \vert i \in S\}\) of vertices, where R is the set of strategic and S the set of stubborn agents.

Question::

Is there an assignment v of agents to vertices with \(v_i = s_i \,\text{for}\, i \in S\) such that no two strategic agents have a profitable swap (no strategic agent has a profitable jump)?

Both known hardness reductions heavily rely on the existence of stubborn agents. We show that it is possible to polynomial-time reduce S/J-Eq-Stub to S/J-Eq.

3.1 NP-hardness of Swap-Equilibrium

This subsection is devoted to proving the following theorem:

Theorem 1

S-Eq is NP-complete.

To prove that S-Eq is NP-hard, we devise a polynomial-time many-one reduction from a restricted version of S-Eq-Stub:

Lemma 1

S-Eq-Stub remains NP-hard even on instances satisfying the following two conditions:

  1. 1.

    No two adjacent vertices are both occupied by stubborn agents.

  2. 2.

    For every vertex \(v \notin V_S\) not occupied by a stubborn agent, there exist two vertices \(s_i, s_j \in V_S\) adjacent to v occupied by stubborn agents \(i \in T_1\) and \(j \in T_2\).

  3. 3.

    For both types there are at least five strategic and three stubborn agents.

Proof

The first restriction follows from the fact that an edge between two stubborn agents does not have any effect on the stability of an assignment. Thus, all such edges can always be deleted. The other two restrictions follow directly from the reduction by Agarwal et al. [1], since, in their reduction, all constructed instances satisfy both properties. To verify that these properties hold, we give a short description of their construction below. As we do not modify the construction, see Agarwal et al. [1] for the respective proof of correctness and a more detailed description.

The reduction is from Clique. An instance of Clique consists of a connected graph \(H=(X,Y)\) and an integer \(\lambda\), and the question is whether there is a subset \(X'\subseteq X\) of at least \(\lambda\) vertices such that each pair of vertices from \(X'\) is adjacent in H. Without loss of generality, they assume that \(\lambda >5\). Given an instance of Clique, they construct a Schelling game with agents \(N=R \dot{\cup } S\) partitioned into types \(T_1\) and \(T_2\) on a topology G. R contains \(\lambda\) strategic agents of type \(T_1\) and \(\vert X\vert +5\) strategic agents of type \(T_2\). Note that we thus have at least five strategic agents from each type. The stubborn agents will be defined together with the topology.

The graph G consists of three subgraphs \(G_1,G_2\) and \(G_3\), which are connected by single edges. \(G_1\) is an extended copy of the given graph H with added degree-one vertices \(W_v\) for every \(v \in X\) connected to their original vertex v. The vertices in \(W_v\) are occupied by stubborn agents from both types. \(G_2\) is a complete bipartite graph, where one of the partitions is fully occupied by stubborn agents from both types. \(G_3\) is constructed by adding degree-one vertices to a given tree T. For every vertex \(v\in V(T)\), at least ten vertices are added, half of which are occupied by stubborn agents from \(T_1\) and the other half are occupied by stubborn agents from \(T_2\). Thus, we have (more than) three stubborn agents of each type. Furthermore, it is easy to see that every vertex not occupied by a stubborn agent is adjacent to at least one stubborn agent from each type. \(\square\)

3.1.1 Idea behind our reduction

Given an instance of S-Eq-Stub on a topology \(G'\) with vertices of stubborn agents \(V_{S'}\), we construct a Schelling game without stubborn agents on a topology G that simulates the given game. At the heart of our construction are two ideas:

  • We can simulate a stubborn agent by a strategic one after adding sufficiently many neighboring auxiliary vertices that are guaranteed to be occupied by friends. Thereby, the strategic agent never has an incentive to deviate and in essence becomes stubborn.

  • We introduce some asymmetries between the two types to ensure that the above guarantee holds.

Going into more details, to create G, we modify the graph \(G'\) by adding new vertices and connecting these new vertices to vertices from \(V_{S'}\). Moreover, we replace each stubborn agent by a strategic agent and add further strategic agents. In the construction, we ensure that if there exists a swap-equilibrium \({\textbf{v}}'\) in the given game, then \({\textbf{v}}'\) can be extended to a swap-equilibrium \({\textbf{v}}\) in the constructed game by replacing each stubborn agent with a strategic agent of the same type and filling empty vertices with further strategic agents. One particular challenge here is to ensure that the strategic agents that replace stubborn agents do not have a profitable swap in \({\textbf{v}}\). For this, recall that, by Lemma 1, we assume that in \(G'\), every vertex not occupied by a stubborn agent in \(\mathbf {v'}\) is adjacent to at least one stubborn agent of each type. Thus, in \({\textbf{v}}'\) each strategic agent i is always adjacent to at least one friend and has utility \(u_i^{G'}(\mathbf {v'})\ge \nicefrac {1}{\Delta (G')}\). Conversely, by swapping with agent i, an agent j of the other type can get utility at most \(u_j^{G'}(\mathbf {v'}^{i \leftrightarrow j}) \le \nicefrac {\Delta (G')-1}{\Delta (G')}\). Our idea is now to “boost” the utility \(u_j^G({\textbf{v}})\) of a strategic agent j that replaces a stubborn agent by adding enough degree-one neighbors only adjacent to \(v_j\) in G, which we fill with agents of j’s type when extending \({\textbf{v}}'\) to \({\textbf{v}}\) such that \(u_j^{G}({\textbf{v}})\ge \nicefrac {\Delta (G')-1}{\Delta (G')} \ge u_j^{G}(\mathbf {{\textbf{v}}}^{i \leftrightarrow j})\).

Moreover, we ensure that if there exists a swap-equilibrium \({\textbf{v}}\) in the constructed game, then \({\textbf{v}}\) restricted to \(V(G')\), where some (strategic) agents are replaced by the designated stubborn agents of the same type, is a swap-equilibrium in the given game. Note that the neighborhoods of all vertices in \(V(G'){\setminus } V_{S'}\) are the same in G and \(G'\) and thus every swap that is profitable in the assignment in the given game would also be profitable in \({\textbf{v}}\). So the remaining challenge here is to design G in such a way that the vertices occupied by stubborn agents of some type in the input game have to be occupied by agents of the same type in every swap-equilibrium in the constructed game. This is achieved by introducing an asymmetry between the types in the construction.

3.1.2 Construction

We are given an instance \({\mathcal {I}}'\) of S-Eq-Stub consisting of a connected topology \(G'\), a set of agents \([\vert V(G')\vert ]=N'=R' {\dot{\cup }} S'\) partitioned into types \(T_1'\) and \(T_2'\) with at least five strategic and three stubborn agents of each type, and a set \(V_{S'} =\{s_i \in V(G') \mid i \in S'\}\) of vertices occupied by stubborn agents with each vertex \(v \notin V_{S'}\) being adjacent to two vertices \(s_i, s_j \in V_{S'}\) with \(i \in T'_1\) and \(j \in T'_2\). We denote the sets of vertices occupied by stubborn agents from \(T_1'\) and \(T_2'\) as \(V_{S'_1}\) and \(V_{S'_2}\), respectively. We construct an instance \({\mathcal {I}}\) of S-Eq consisting of a topology \(G=(V,E)\) and types \(T_1\) and \(T_2\) as follows.

Fig. 2
figure 2

The constructed topology G. Modifications made to the given graph \(G'\) are colored light blue. Note that the vertices in \(V_{S'_1} \cup X_1\) and \(V_{S'_2}\) each form a clique (Color figure online)

The graph G (sketched in Fig. 2) is an extended copy of the given graph \(G'\) and contains all vertices and edges from \(G'\). We add three sets of vertices \(M_1, X_1\), and \(M_2\) as specified below. For every vertex \(v \in V_{S'_2}\), we insert \(\vert V(G')\vert ^2\) degree-one vertices only adjacent to v and add them to \(M_2\). We connect the vertices in \(V_{S'_2}\) to form a clique. Let

$$\begin{aligned} q :=\Delta (G')+\vert V(G')\vert ^2 + \vert V_{S'_2}\vert \end{aligned}$$

and note that q is an upper bound on the degree of a vertex from \(V_{S'_2}\). Further, we define

$$\begin{aligned} s:=q \cdot (\vert T'_2\vert +\vert M_2\vert + \Delta (G') ) + 1 \end{aligned}$$

and note that \(s> \vert V_{S'_1}\vert\). Let \(X_1\) be a set of \(s -\vert V_{S'_1}\vert\) vertices. Thus, \(\vert V_{S'_1} \cup X_1\vert =s\) (we use this property to introduce the mentioned asymmetry between the two types). We connect the vertices in \(V_{S'_1} \cup X_1\) to form a clique. Let

$$\begin{aligned} p :=\vert T_2'\vert +\vert M_2\vert -2 >\Delta (G')^2 \end{aligned}$$

(this choice of p is important to ensure that vertices in \(V_{S'_1}\) are occupied by agents from \(T_1\) in each swap-equilibrium of the constructed game). For every vertex \(v \in V_{S'_1} \cup X_1\), we insert p degree-one vertices only adjacent to v and add them to \(M_1\). Notably, the neighborhood of all vertices in \(V(G'){\setminus } V_{S'}\) is the same in \(G'\) and G.

The set \(N =T_1 {\dot{\cup }} T_2\) of agents is defined as follows. We have \(\vert T_1\vert =\vert T'_1\vert +\vert M_1\vert +\vert X_1\vert\) agents in \(T_1\) and \(\vert T_2\vert =\vert T'_2\vert +\vert M_2\vert\) agents in \(T_2\). By the construction of \(X_1\) above, we have that \(\vert V_{S'_1} \cup X_1\vert =q \cdot (\vert T'_2\vert +\vert M_2\vert + \Delta (G') ) + 1 = q \cdot (\vert T_2\vert + \Delta (G'))+1\). It also holds that \(p = \vert T_2'\vert +\vert M_2\vert -2 = \vert T_2\vert -2\).

3.1.3 Proof of correctness

Let \(A :=M_1 \cup V_{S'_1} \cup X_1\) and \(B :=M_2 \cup V_{S'_2}\) (the vertices from A should be occupied by agents from \(T_1\), while the vertices from B should be occupied by agents from \(T_2\)). We start with showing the (easier) forward direction of the correctness of the reduction:

Lemma 2

If the given instance \({\mathcal {I}}'\) of S-Eq-Stub admits a swap-equilibrium, then the constructed instance \({\mathcal {I}}\) of S-Eq admits a swap-equilibrium.

Proof

Assume that there exists a swap-equilibrium \({\textbf{v}}'\) in the given instance \({\mathcal {I}}'\) with stubborn agents. Note that in \({\textbf{v}}'\), the vertices in \(V_{S'_1}\) and \(V_{S'_2}\) are occupied by stubborn agents from \(T_1'\) and \(T_2'\), respectively. We now define an assignment \({\textbf{v}}\) for the Schelling game \({\mathcal {I}}\) without stubborn agents and prove that it is a swap-equilibrium: In \({\textbf{v}}\), the vertices in \(V(G) \cap V(G')\) are occupied by agents of the same type as the agents in \({\textbf{v}}'\). The vertices in \(X_1\) are occupied by agents from \(T_1\). For \(t \in \{1,2\}\), the added degree-one vertices in \(M_t\) are occupied by agents from \(T_t\). Hence, the vertices in \(A=M_1 \cup V_{S'_1} \cup X_1\) are occupied by agents from \(T_1\) and the vertices in \(B=M_2 \cup V_{S'_2}\) are occupied by agents from \(T_2\). Note that in \({\textbf{v}}\), exactly \(\vert T_1\vert\) agents from \(T_1\) and \(\vert T_2\vert\) agents from \(T_2\) are assigned as we have \(\vert T_1\vert =\vert T'_1\vert +\vert M_1\vert +\vert X_1\vert\) and \(\vert T_2\vert =\vert T'_2\vert +\vert M_2\vert\).

Next, we prove that \({\textbf{v}}\) is a swap-equilibrium on G in \({\mathcal {I}}\) by showing that no profitable swap exists. We first observe that the utility of an agent \(i\in T_1\) on a vertex \(w \in M_1 \cup X_1\) is \(u_i({\textbf{v}})=1\), since \(N^G(w)\subseteq A\) and all agents in A are from \(T_1\). The same holds analogously for all agents on a vertex in \(M_2\). Therefore, the agents on vertices in \(M_1 \cup M_2 \cup X_1\) cannot be involved in a profitable swap. Note further that the utility of any agent on a vertex \(v \in V(G') {\setminus } V_{S'}\) is the same in \({\textbf{v}}\) and \({\textbf{v}}'\), as the neighborhood of v is identical in G and \(G'\) and all vertices in the neighborhood are occupied by agents of the same type in \({\textbf{v}}\) and \({\textbf{v}}'\). Since \({\textbf{v}}'\) is a swap-equilibrium, a profitable swap must therefore involve at least one agent i with \(v_i \in V_{S'}\).

Let \(Y=V_{S'_1} \cup X_1\) if \(v_i \in V_{S'_1}\) and \(Y=V_{S'_2}\) otherwise. Denote the number of degree-one neighbors adjacent to \(v_i\) that were added to \(G'\) in the construction of G by x. By construction of G, it holds that \(x\ge \Delta (G')^2\) and that the agent i is, among others, adjacent to the vertices in \(Y {\setminus } \{v_i\}\) and the \(x\ge \Delta (G')^2\) degree-one neighbors (all these vertices are occupied by friends). As the only other neighbors of \(v_i\) need to come from \(V(G'){\setminus } V_{S'}\), it holds that \(\deg ^G(v_i) \le x + \vert Y {\setminus } \{v_i\}\vert + \Delta (G')\). Thus, the utility of agent i on \(v_i\) is:

$$\begin{aligned} u_i^{G}({\textbf{v}})\ge \frac{x + \vert Y {\setminus } \{v_i\}\vert }{x + \vert Y {\setminus } \{v_i\}\vert + \Delta (G')} > \frac{x}{x+\Delta (G')} \ge \frac{\Delta (G')^2}{\Delta (G')^2+\Delta (G')}=\frac{\Delta (G')}{\Delta (G')+1}. \end{aligned}$$

We now distinguish between swapping i with an agent j with \(v_j\in V_{S'}\) and with \(v_j\in V(G'){\setminus } V_{S'}\) (note that this exhausts all cases as we have already argued above that all agents placed on newly added vertices can never be part of a profitable swap). First, consider swapping i with an agent j of the other type with \(v_j \in V_{S'}\). On vertex \(v_j\), agent i can at most have \(\Delta (G')\) adjacent friends, as all vertices that are connected to \(v_j\) by edges added in the construction (that are, vertices in A or B) are occupied by friends of j.

It holds that \(\deg ^G(v_j)\ge \Delta (G')^2\), since \(v_j\) is adjacent to at least \(\Delta (G')^2\) degree-one neighbors. Therefore, the swap can not be profitable, as

$$\begin{aligned} u_i^{G}({\textbf{v}})\ge \frac{\Delta (G')}{\Delta (G')+1}> \frac{1}{\Delta (G')} = \frac{\Delta (G')}{\Delta (G')^2} \ge u_i^{G}({\textbf{v}}^{i \leftrightarrow j}). \end{aligned}$$

Hence, consider swapping i with an agent j of the other type on \(v_j \in V(G') {\setminus } V_{S'}\). Recall that by Lemma 1 we have assumed that for every vertex \(v \notin V_{S'}\) not occupied by a stubborn agent, there exist two adjacent vertices \(s_i, s_j \in V_{S'}\) occupied by stubborn agents \(i \in T_1\) and \(j \in T_2\). Since \(v_j \in V(G') {\setminus } V_{S'}\), the agent j is thus adjacent to at least one friend. More precisely, we have \(u_j^{G'}({\textbf{v}}')\ge \frac{1}{\Delta (G')}\). As noted above, the neighborhood of \(v_j\) is identical in G and \(G'\). We therefore have \(u_j^{G}({\textbf{v}})= u_j^{G'}({\textbf{v}}')\). Thus, by swapping with agent j, agent i can at most get the following utility \(u_i^{G}({\textbf{v}}^{i \leftrightarrow j})\le \frac{\Delta (G')-1}{\Delta (G')}\). It follows that swapping i and j cannot be profitable, as:

$$\begin{aligned} u_i^{G}({\textbf{v}})\ge \frac{\Delta (G')}{\Delta (G')+1}>\frac{\Delta (G')-1}{\Delta (G')}\ge u_i^{G}({\textbf{v}}^{i \leftrightarrow j}) \end{aligned}$$

Summarizing, no profitable swap is possible and \({\textbf{v}}\) is a swap-equilibrium for the constructed Schelling game \({\mathcal {I}}\). \(\square\)

It remains to prove the backwards direction of the reduction. For this, we start by making some definitions. Afterwards, we prove in Lemma 3, that in any swap-equilibrium \({\textbf{v}}\) in \({\mathcal {I}}\) all vertices from \(M_1 \cup V_{S'_1} \cup X_1\) are occupied by agents from \(T_1\) and in Lemma 4, that all vertices from \(M_2 \cup V_{S'_2}\) are occupied by agents from \(T_2\). Using this, we conclude the proof by proving the backwards direction of the correctness of the reduction in Lemma 5.

Recall that \(A= M_1 \cup V_{S'_1} \cup X_1\) and \(B = M_2 \cup V_{S'_2}\). Observe that the subgraph G[A] (see Fig. 3a) consists of \(q \cdot (\vert T_2\vert + \Delta (G')) +1\) stars which each have \(\vert T_2\vert -1\) vertices. The central vertices of these stars are connected such that they form a clique. As \(q = \Delta (G')+\vert V(G')\vert ^2 +\vert V_{S'_2}\vert > \vert V_{S'_2}\vert \ge 3\), note that G[A] consists of at least three stars. Note that \(V(G){\setminus } A = (V(G') {\setminus } V_{S'}) \cup B = (V(G') {\setminus } V_{S'}) \cup (M_2 \cup V_{S'_2})\). The subgraph \(G[V(G){\setminus } A]\) (shown in Fig. 3b) is connected, since every vertex in \(V(G') {\setminus } V_{S'}\) is connected to a vertex in \(V_{S'_2}\) (by our assumption concerning \({\mathcal {I}}'\) from Lemma 1) and the vertices in \(V_{S'_2}\) form a clique (by the construction of G). Additionally, all vertices in \(M_2\) are adjacent to exactly one vertex in \(V_{S'_2}\). We start by proving Lemmas 3 and 4, which state that in every swap-equilibrium, the vertices in A and B have to be occupied by agents from \(T_1\) and \(T_2\), respectively.

Fig. 3
figure 3

Schematic visualization of the induced subgraphs G[A] and \(G[V(G) {\setminus } A]\). Recall that \(A = S'_1 \cup M_1 \cup X_1\)

Lemma 3

In any swap-equilibrium \({\textbf{v}}\) in \({\mathcal {I}}\), all vertices in A are occupied by agents from \(T_1\).

Proof

For the sake of contradiction, assume that \({\textbf{v}}\) is a swap-equilibrium in \({\mathcal {I}}\) where \(x>0\) agents from \(T_2\) are placed on vertices from A. We distinguish the following three cases based on the number of agents from \(T_2\) in A and prove that \({\textbf{v}}\) cannot be stable.

Case 1: \(x<\vert T_2\vert -1\)

Since all stars in G[A] have \(\vert T_2\vert -1>x\) vertices, at least one of the stars has to contain agents from both types. Thus, there exists an agent \(i \in T_t\) for some \(t \in \{1,2\}\) on a degree-one vertex in A with \(u_i({\textbf{v}})=0\). Since \(\vert T_2\vert -x>0\) and \(\vert T_1\vert >\vert A\vert\), there have to be agents from both \(T_1\) and \(T_2\) in \(G[V(G){\setminus } A]\). As observed before, \(G[V(G){\setminus } A]\) is connected. Thus, there exist agents \(i' \in T_t\) and \(j' \in T_{t'}\) with \(t' \ne t\) in \(G[V(G){\setminus } A]\) that are adjacent and hence have \(u_{i'}({\textbf{v}})<1\) and \(u_{j'}({\textbf{v}})<1\). Then, swapping i and \(j'\) is profitable, since we have \(u_i({\textbf{v}})=0<u_i({\textbf{v}}^{i \leftrightarrow j'})\) and \(u_{j'}({\textbf{v}})<1=u_{j'}({\textbf{v}}^{i \leftrightarrow j'})\).

Case 2: \(x=\vert T_2\vert\)

Recall that all stars in G[A] have \(\vert T_2\vert -1<x\) vertices. Thus, there have to be agents from \(T_2\) on at least two stars. Since it also holds that \(x< 2\cdot (\vert T_2\vert -1)\), there are agents from both types on at least one of the stars. Let \(v_j\) be the central vertex of this star occupied by some agent j. There exists an agent \(i \in T_t\) for some \(t \in \{1,2\}\) on a degree-one vertex adjacent to \(v_j\) with \(u_{i}({\textbf{v}})=0\). The agent j is from type \(T_{t'}\) with \(t' \ne t\). As noted before, G[A] contains at least 3 stars. Since \(x< 2\cdot (\vert T_2\vert -1)\), there also have to be agents from \(T_1\) on at least two of the stars. We make a case distinction based on the types of the agents on central vertices in G[A].

First, suppose that all central vertices are occupied by agents from \(T_{t'}\). As noted above, it holds for both types that agents of this type occupy vertices from at least two stars. Hence, there exists an agent \(i' \in T_t\) on a degree-one vertex adjacent to a central vertex \(w \ne v_j\) with \(u_{i'}({\textbf{v}})=0\). Let \(j' \in T_{t'}\) be the agent on w. Then, swapping i and \(j'\) is profitable, since \(u_{j'}({\textbf{v}})<1=u_{j'}({\textbf{v}}^{i \leftrightarrow j'})\) and \(u_{i}({\textbf{v}})=0<u_{i}({\textbf{v}}^{i \leftrightarrow j'})\).

Now, consider that all central vertices different from \(v_j\) are occupied by agents from \(T_{t}\). Then, there exists an agent \(j' \in T_{t'}\) with \(u_{j'}({\textbf{v}})=0\) on a degree-one vertex adjacent to a central vertex \(w \ne v_j\) that is occupied by an agent from \(T_t\). Swapping i and \(j'\) is profitable, since \(u_{j'}({\textbf{v}})=0<1=u_{j'}({\textbf{v}}^{i \leftrightarrow j'})\) and \(u_{i}({\textbf{v}})=0<1=u_{i}({\textbf{v}}^{i \leftrightarrow j'})\).

Therefore, the central vertices different from \(v_j\) have to be occupied by agents from both types. That is, there exists an agent \(j' \in T_{t'}\) on a central vertex \(v_{j'} \ne v_j\) and an agent \(i' \in T_{t}\) on a central vertex \(v_{i'} \ne v_j\). We have \(u_{j'}({\textbf{v}})<1\), since \(v_{j'}\) is adjacent to \(v_{i'}\). Then, swapping i and \(j'\) is profitable, since \(u_{j'}({\textbf{v}})<1=u_{j'}({\textbf{v}}^{i \leftrightarrow j'})\) and \(u_{i}({\textbf{v}})=0<u_{i}({\textbf{v}}^{i \leftrightarrow j'})\).

Fig. 4
figure 4

Case 3 in the proof of Lemma 3 (there are exactly \(\vert T_2\vert -1\) agents from \(T_2\) in A) where agents from \(T_2\) occupy two or more stars

Case 3: \(x=\vert T_2\vert -1\)

If the x agents from \(T_2\) occupy vertices from two or more stars, then at least two stars contain agents from both types (illustrated in Fig. 4). That is, there exists an agent \(i \in T_{t_1}\) for some \(t_1 \in \{1,2\}\) with \(u_{i}({\textbf{v}})=0\) on a degree-one vertex adjacent to an agent \(j \in T_{t'_1}\) with \(t'_1 \ne t_1\). The agent j on the central vertex has \(u_{j}({\textbf{v}})<1\). Without loss of generality, assume that \(t_1 = 1\) and thus \(t'_1 =2\). As argued above, another star has to contain agents from both types. Thus, there exists another agent \(i' \in T_{t_2}\) for some \(t_2 \in \{1,2\}\) with \(u_{i}({\textbf{v}})=0\) on a degree-one vertex adjacent to an agent \(j' \in T_{t'_2}\) with \(t'_2 \ne t_2\). Again, the agent \(j'\) on the central vertex has \(u_{j'}({\textbf{v}})<1\). If \(t_2 = 1\), then swapping i and \(j'\) is profitable, as \(u_{i}({\textbf{v}})=0<u_{i}({\textbf{v}}^{i \leftrightarrow j'})\) and \(u_{j'}({\textbf{v}})<1=u_{j'}({\textbf{v}}^{i \leftrightarrow j'})\). Otherwise, if \(t_2 = 2\), then swapping i and \(i'\) is profitable, as \(u_{i}({\textbf{v}})=0<1=u_{i}({\textbf{v}}^{i \leftrightarrow i'})\) and \(u_{i'}({\textbf{v}})=0<1=u_{i'}({\textbf{v}}^{i \leftrightarrow i'})\). Summarizing, if the x agents from \(T_2\) occupy vertices from two or more stars, then \({\textbf{v}}\) cannot be a swap-equilibrium.

Hence, the agents from \(T_2\) have to occupy all \(\vert T_2\vert -1\) vertices of one of the stars in A. Let agent \(i \in T_2\) be the agent on the central vertex \(v_i\) of this star. Observe that \(\deg ^G(v_i)\ge (\vert T_2\vert -2)+ q \cdot (\vert T_2\vert + \Delta (G'))\), since \(v_i\) is adjacent to \(\vert T_2\vert -2\) degree-one neighbors and the \(q \cdot (\vert T_2\vert + \Delta (G'))\) vertices in \((V_{S'_1} \cup X_1) {\setminus } \{v_i\}\). It follows that agent \(i \in T_2\) has utility:

$$\begin{aligned} u_i({\textbf{v}})\le \frac{\vert T_2\vert }{(\vert T_2\vert -2)+ q \cdot (\vert T_2\vert + \Delta (G'))} < \frac{\vert T_2\vert }{\vert T_2\vert \cdot q} = \frac{1}{q}. \end{aligned}$$

Since \(x=\vert T_2\vert -1\), there is one agent \(i' \in T_2\) not placed on a vertex from A. As noted above, \(G[V(G){\setminus } A]\) is connected. Thus, agent \(i'\) is adjacent to an agent \(j \in T_1\) on \(v_j \in V(G) {\setminus } A\). Recall that \(V(G){\setminus } A = (V(G') {\setminus } V_{S'}) \cup (M_2 \cup V_{S'_2})\). If \(v_j \in V_{S'_2}\), then we have \(\deg ^G(v_j)\le \Delta (G') + \vert V(G')\vert ^2 + \vert V_{S'_2}\vert\). If \(v_j \in M_2\), then we have \(\deg ^G(v_j)=1\). If \(v_j \in V(G') {\setminus } V_{S'}\), then we have \(\deg ^G(v_j)\le \Delta (G')\). In any case, it holds that \(\deg ^G(v_j)\le \Delta (G') + \vert V(G')\vert ^2 + \vert V_{S'_2}\vert =q\) (q was defined in the construction). Since \(v_j\) is adjacent to \(v_{i'}\), agent i has at least one adjacent friend after swapping to \(v_j\), and its utility is:

$$\begin{aligned} u_i({\textbf{v}}^{i \leftrightarrow j })\ge \frac{1}{q} > u_i({\textbf{v}}). \end{aligned}$$

Thus, i wants to swap with j. Note that at least one of the at most q neighbors of j (specifically, agent \(i'\)) is not a friend of j. Observe that the neighborhood of the central vertex \(v_i\) consists of \(\vert T_2\vert -2\) degree-one neighbors, the \(q \cdot (\vert T_2\vert + \Delta (G'))\) vertices in \((V_{S_1'} \cup X_1) {\setminus } \{v_i\}\) and at most \(\Delta (G')\) neighbors in \(V(G') {\setminus } V_{S'_1}\). Thus, we have \(\deg ^G(v_i)\le q \cdot (\vert T_2\vert + \Delta (G')) + \vert T_2\vert -2 + \Delta (G') < (q+1) \cdot (\vert T_2\vert + \Delta (G'))\). Moreover, there are at least \(q \cdot (\vert T_2\vert + \Delta (G'))\) agents of type \(T_1\) adjacent to \(v_i\) (all agents in \((V_{S_1'} \cup X_1) {\setminus } \{v_i\}\)). Therefore, it holds that agent \(j \in T_1\) has utility:

$$\begin{aligned} u_j({\textbf{v}}^{i \leftrightarrow j }) \ge \frac{q \cdot (\vert T_2\vert + \Delta (G'))}{ (q+1) \cdot (\vert T_2\vert + \Delta (G'))}=\frac{q}{q+1}> \frac{q-1}{q}\ge u_j({\textbf{v}}). \end{aligned}$$

Hence, swapping i and j is profitable and \({\textbf{v}}\) cannot be a swap-equilibrium.

Since we have exhausted all possible cases, the lemma follows. \(\square\)

Next, we prove that all vertices in B have to be occupied by agents from \(T_2\).

Lemma 4

In any swap-equilibrium \({\textbf{v}}\) in \({\mathcal {I}}\), all vertices in B are occupied by agents from \(T_2\).

Proof

By Lemma 3, vertices from A are only occupied by agents from \(T_1\) in \({\textbf{v}}\). There are \(y:=\vert T_1\vert -\vert A\vert = \vert T'_1\vert - \vert V_{S'_1}\vert < \vert V(G'){\setminus } V_{S'}\vert\) agents from \(T_1\) remaining (note that the inequality holds because \(\vert T'_1\vert - \vert V_{S'_1}\vert\) is simply the number of strategic agents of the first type in the given game, whereas \(\vert V(G'){\setminus } V_{S'}\vert\) is the total number of strategic agents). These together with all agents from \(T_2\) occupy vertices in \(G[V(G){\setminus } A]\). Since it holds that \(y<\vert V(G'){\setminus } V_{S'}\vert\), there exists an agent \(j \in T_2\) with \(v_j \in V(G'){\setminus } V_{S'}\). Recall that by Lemma 1 we have assumed that in our input instance, every vertex not occupied by a stubborn agent is adjacent to at least one stubborn agent of each type. Thus, \(v_j\) is adjacent to \(v_i \in V_{S'_1}\) occupied by agent i. It holds that \(v_i \in A\), hence we have that agent i must be from \(T_1\). The agents i and j have \(u_{i}({\textbf{v}})<1\) and \(u_{j}({\textbf{v}})<1\).

Suppose there are x agents of type \(T_1\) in B in \({\textbf{v}}\), with \(\vert V(G')\vert>y\ge x>0\). We prove that in this case \({\textbf{v}}\) cannot be a swap-equilibrium. Observe that the subgraph G[B] consists of \(\vert V_{S'_2}\vert\) stars where the central vertices form a clique. Each star contains \(\vert V(G')\vert ^2+1>x\) vertices. Therefore, at least one of the stars has to contain agents from both types. That is, there exists an agent \(i' \in T_t\) for some \(t \in \{1,2\}\) on a degree-one vertex in B with \(u_{i'}({\textbf{v}})=0\). If \(t=1\), then swapping agent \(i'\) and agent j is profitable, since \(u_{i'}({\textbf{v}})=0<u_{i'}({\textbf{v}}^{i' \leftrightarrow j})\) and \(u_{j}({\textbf{v}})<1=u_{j}({\textbf{v}}^{i' \leftrightarrow j})\). Otherwise, if \(t = 2\), then swapping agent \(i'\) and agent i is profitable, since \(u_{i'}({\textbf{v}})=0<u_{i'}({\textbf{v}}^{i' \leftrightarrow i})\) and \(u_{i}({\textbf{v}})<1=u_{i}({\textbf{v}}^{i' \leftrightarrow i})\). Therefore, there exists a profitable swap and \({\textbf{v}}\) cannot be a swap-equilibrium. \(\square\)

After establishing these two lemmas, we are now able to prove the backwards direction of the correctness of the reduction:

Lemma 5

If the constructed instance \({\mathcal {I}}\) of S-Eq admits a swap-equilibrium, then the given instance \({\mathcal {I}}'\) of S-Eq-Stub admits a swap-equilibrium.

Proof

Assume there exists a swap-equilibrium \({\textbf{v}}\) for the constructed instance \({\mathcal {I}}'\) without stubborn agents. We define an assignment \(\mathbf {v'}\) and prove that it is a swap-equilibrium for the given Schelling game \({\mathcal {I}}'\) with stubborn agents on \(G'\). In \(\mathbf {v'}\), a vertex \(v \in V(G') {\setminus } V_{S'}\) is occupied by a strategic agent of the same type as the agent on v in \({\textbf{v}}\). The vertices in \(V_{S'}\) have to be occupied by the respective stubborn agents. Note that by Lemmas 3 and 4, in the swap-equilibrium \({\textbf{v}}\) in \({\mathcal {I}}\), the vertices in \(V_{S'_1} \subseteq A\) and \(V_{S'_2} \subseteq B\) have to be occupied by agents from \(T_1\) and \(T_2\), respectively. Thus, in \(\mathbf {v'}\), all vertices are occupied by agents of the same type as in \({\textbf{v}}\). Note that in \(\mathbf {v'}\) exactly \(\vert T'_1\vert\) agents from \(T'_1\) and \(\vert T'_2\vert\) agents from \(T'_2\) are assigned, as we have \(\vert T_1\vert =\vert T'_1\vert +\vert M_1\vert +\vert X_1\vert\) and \(\vert T_2\vert =\vert T'_2\vert +\vert M_2\vert\) and as proven in Lemmas 3 and 4, in \({\textbf{v}}\), all vertices from \(M_1\cup X_1\) are occupied by agents from \(T_1\) and all vertices from \(M_2\) are occupied by agents from \(T_2\).

Now, we will prove that \(\mathbf {v'}\) is a swap-equilibrium on the given \(G'\). Since stubborn agents never swap position, a profitable swap has to involve two strategic agents \(i \in T'_1\) and \(j \in T'_2\) with \(v_i,v_j \in V(G') {\setminus } V_{S'}\). However, by construction of G, the neighborhoods of \(v_i\) and \(v_j\) are identical in G and \(G'\). Additionally, it holds that in \(\mathbf {v'}\), all vertices are occupied by agents of the same type as in \({\textbf{v}}\). Since \({\textbf{v}}\) is a swap-equilibrium on G, swapping i and j cannot be profitable. It follows that \(\mathbf {v'}\) is a swap-equilibrium, which completes the proof. \(\square\)

Note that the membership of S-Eq in NP is trivial, as it is possible to verify that a given assignment is a swap equilibrium by iterating over all pairs of agents and checking whether swapping the two is profitable. Thus, from Lemmas 2 and 5, Theorem 1 follows:

Theorem 1

S-Eq is NP-complete.

3.2 NP-hardness of Jump-Equilibrium

Inspired by the reduction for S-Eq described above, we can prove that deciding the existence of a jump-equilibrium is NP-hard as well. While the constructions behind both reductions use the same underlying general ideas, the proof for J-Eq is more involved. The main challenge here is that in every assignment some vertices remain unoccupied. For instance, we do not only need to prove that only agents from \(T_1\) are placed on vertices from A (which is more challenging because we have to deal with possibly unoccupied vertices) but also that all vertices from A are occupied. This subsection is devoted to proving the following theorem:

Theorem 2

J-Eq is NP-complete.

To prove the theorem, we reduce from a restricted version of J-Eq-Stub as defined in the following lemma. To prove hardness for the restricted version, the proof of Agarwal et al. [1] for the general version of J-Eq-Stub needs to be slightly adapted.

Lemma 6

Let \(\lambda = \vert V(G)\vert -n\) be the number of unoccupied vertices in an instance of J-Eq-Stub. We call an instance of J-Eq-Stub regularized, if the following five properties hold.

  1. 1.

    For every vertex \(v \notin V_S\) not occupied by a stubborn agent, there exist two vertices \(s_i, s_j \in V_S\) adjacent to v occupied by stubborn agents \(i \in T_1\) and \(j \in T_2\).

  2. 2.

    Every vertex \(v \in V_S\) has \(\deg ^G(v)< \lambda\).

  3. 3.

    Every vertex \(v \in V_{S}\) is adjacent to a vertex \(v \notin V_{S}\).

  4. 4.

    It holds that \(\lambda >0\).

  5. 5.

    There are at least two stubborn agents of each type.

J-Eq-Stub remains NP-hard when restricted to regularized instances.

Proof

We prove this statement by giving a reduction that is heavily based on the reduction by Agarwal et al. [1], which is modified in order to ensure that the constructed instance is always regularized. Most importantly, we modify the original construction such that the first property holds. All other properties already hold or are trivial to achieve.

We reduce from Clique. An instance of Clique consists of an undirected graph \(H=(X,Y)\) and an integer s. It is a yes-instance if and only if H contains a clique of size s. Without loss of generality, we assume that \(s \ge 6\). We construct an instance of J-Eq-Stub as follows (see Fig. 5):

There are two types \(T_1\) and \(T_2\). There are s strategic agents all part of \(T_1\). All other agents are stubborn and defined along with the topology.

The topology \(G=(V,E)\) consists of three components \(G_1, G_2,\) and \(G_3\), which are constructed as described below.

  • To define the graph \(G_1=(V_1,E_1)\), let \(W_v\) be a set of s vertices for every \(v \in X\). Out of the vertices in \(W_v\), one vertex is occupied by a stubborn agent from \(T_1\) and the remaining \(s-1\) vertices are occupied by stubborn agents from \(T_2\). We set \(V_1 = X \cup \bigcup _{v \in X} W_v\) and \(E_1 = Y \cup \bigcup _{v \in X} \{ \{v,w\} \mid w \in W_v\}\). That is, \(G_1\) is an extended copy of the given H, where every \(v \in X\) is adjacent to s degree-one vertices in \(W_v\), which are occupied by stubborn agents from both types.

  • The graph \(G_2\) is a bipartite graph with parts L and R. Let L be a set of \(s-2\) vertices. For every \(v \in L\), the set R contains 4s vertices only connected to v. Out of these 4s vertices, \(2s+1\) are occupied by stubborn agents from \(T_1\) and the remaining \(2s-1\) vertices are occupied by stubborn agents from \(T_2\).

  • In \(G_3\), only three vertices xy and z are not occupied by stubborn agents. The vertices x and y are connected by an edge. The remaining vertices are occupied by stubborn agents and defined in the following. First, the vertex x is connected to one degree-one vertex occupied by a stubborn agent from \(T_1\) and two degree-one vertices occupied by stubborn agents from \(T_2\). The vertex y is connected to 41 degree-one vertices occupied by stubborn agents from \(T_1\) and 80 degree-one vertices occupied by stubborn agents from \(T_2\). Finally, z is connected to 5 degree-one vertices occupied by stubborn agents from \(T_1\) and 7 degree-one vertices occupied by stubborn agents from \(T_2\).

Lastly, we pick an arbitrary vertex occupied by a stubborn agent from each of the three components \(G_1\), \(G_2\), \(G_3\) and connect the three vertices to form a clique.

It is easy to verify that the constructed instance is regularized. The correctness of the reduction follows analogous to the proof by Agarwal et al. [1]. The only difference is the exact utility of agents on \(G_1\), however, the same inequalities still hold. \(\square\)

Fig. 5
figure 5

Illustration of the regularized instance constructed in the proof of Lemma 6

In the following, we start by describing the construction of the reduction to prove Theorem 2 before we prove its correctness. The construction is very similar to the one for Theorem 1 from Sect. 3.1. In particular, the sketch from Fig. 2 still applies here. The only major difference between the two reductions is that the number of vertices in \(X_1\) is different. As a consequence, also the number of agents from both types is different than before. For the sake of completeness and to avoid possible confusions, we provide the full description of the construction here.

3.2.1 Construction

We are given an instance \({\mathcal {I}}'\) of J-Eq-Stub consisting of a connected topology \(G'\), a set \(N'=R' {\dot{\cup }} S'\) of agents partitioned into types \(T_1'\) and \(T_2'\) and a set of vertices \(V_{S'} =\{s_i \in V(G') \mid i \in S'\}\). The agents in \(R'\) are strategic and the agents from \(S'\) are stubborn agents, with stubborn agent \(i \in S'\) occupying \(s_i \in V_{S'}\) in any assignment. We assume that the given instance is regularized and fulfills the properties from Lemma 6. In the following, we denote the sets of vertices occupied by stubborn agents from \(T_1'\) and \(T_2'\) as \(V_{S'_1}\) and \(V_{S'_2}\), respectively. From this, we construct an instance \({\mathcal {I}}\) of J-Eq consisting of a topology \(G=(V,E)\) and types \(T_1\) and \(T_2\) as follows.

The graph G (sketched in Fig. 2) is an extended copy of the given graph \(G'\) and contains all vertices and edges from \(G'\). We add three sets of vertices \(M_1, X_1\), and \(M_2\) as specified below. For every vertex \(v \in V_{S'_2}\), we insert \(\vert V(G')\vert ^2\) degree-one vertices only adjacent to v and add them to \(M_2\). We connect the vertices in \(V_{S'_2}\) to form a clique.

Next, we define q, which, as argued later, is an upper bound for the degree of a vertex in \((V(G'){\setminus } V_{S'_1}) \cup M_2\):

$$\begin{aligned} q :=\Delta (G')+\vert V(G')\vert ^2 + \vert V_{S'_2}\vert . \end{aligned}$$

Now, we define values s and z, which are important for the correctness (Lemma 9):

$$\begin{aligned} s&:=q \cdot (\vert T'_2\vert +\vert M_2\vert + \Delta (G') ) + 1,\\ z&:=s+\vert V(G')\vert +\vert M_2\vert . \end{aligned}$$

Let \(X_1\) be a set of \(z -\vert V_{S'_1}\vert\) vertices (this is different than in the construction from Theorem 1). We add the vertices \(X_1\) to G and connect the vertices in \(V_{S'_1}\cup X_1\) to form a clique. Note that it holds that \(\vert X_1 \cup V_{S'_1}\vert = z\), which we use to introduce an asymmetry between the two types.

Finally, we define the number p of added degree-one neighbors for vertices in \(V_{S'_1} \cup X_1\) (again, the choice of p is later used for proving correctness):

$$\begin{aligned} p :=\vert T_2'\vert +\vert M_2\vert -2 > \vert V(G')\vert ^2. \end{aligned}$$

For every vertex \(v \in V_{S'_1} \cup X_1\), we add p degree-one vertices only adjacent to v in G and add them to \(M_1\).

The set of agents \(N =T_1 {\dot{\cup }} T_2\) is defined as follows. We have \(\vert T_1\vert =\vert T'_1\vert +\vert M_1\vert +\vert X_1\vert\) agents in \(T_1\) and \(\vert T_2\vert =\vert T'_2\vert +\vert M_2\vert\) agents in \(T_2\). By the construction of \(X_1\), we have that:

$$\begin{aligned} s=q \cdot (\vert T'_2\vert +\vert M_2\vert + \Delta (G') ) + 1 = q \cdot (\vert T_2\vert + \Delta (G'))+1. \end{aligned}$$

It also holds that \(p = \vert T_2'\vert +\vert M_2\vert -2 = \vert T_2\vert -2\). Let \(\lambda ':= \vert V(G')\vert -\vert N'\vert\) be the number of unoccupied vertices in the given instance and \(\lambda := \vert V(G)\vert -\vert N\vert\) the number of unoccupied vertices in the constructed instance. Note that there are equally many unoccupied vertices in the constructed and the given instance, since it holds that \(\vert V(G)\vert -\vert V(G')\vert =\vert M_1\vert +\vert X_1\vert +\vert M_2\vert =\vert N\vert -\vert N'\vert\). That is, \(\lambda = \lambda ' < \vert V(G')\vert\).

3.2.2 Proof of correctness

Next, we address the correctness of the reduction. We approach the proof in four steps. First, we prove in Lemma 7 the forward direction of the correctness. Next, we make some basic observations about the constructed graph G. Then, we prove Lemmas 8 to 10, which state useful properties of all jump-equilibria in the constructed game. Finally, using these lemmas, we prove that the constructed game admits a jump-equilibrium only if the original game admits a jump-equilibrium.

We define the sets \(A,B \subseteq V\) as \(A :=M_1 \cup V_{S'_1} \cup X_1\) and \(B :=M_2 \cup V_{S'_2}\). Observe that the subgraph G[A] can be partitioned into z stars which each have \(\vert T_2\vert -1\) vertices as follows. The vertices in \(X_1 \cup V_{S'_1}\) are the central vertices and form a clique. Each central vertex is adjacent to \(\vert T_2\vert -2\) degree-one vertices in \(M_1\). Recall that \(z> \vert V(G')\vert \ge \vert V_{S'}\vert > 3\), hence we have at least 3 stars in G[A]. Note that \(V(G){\setminus } A = (V(G') {\setminus } V_{S'}) \cup B = (V(G') {\setminus } V_{S'}) \cup (M_2 \cup V_{S'_2})\). The subgraph \(G[V(G){\setminus } A]\) is connected, since every vertex in \(V(G') {\setminus } V_{S'}\) is connected to a vertex in \(V_{S'_2}\) (by our assumption that the given instance is regularized; see Lemma 6) and the vertices in \(V_{S'_2}\) form a clique (by the construction of G). Additionally, all vertices in \(M_2\) are adjacent to exactly one vertex in \(V_{S'_2}\).

We start with showing the (easier) forward direction of the correctness of the reduction:

Lemma 7

If the given instance \({\mathcal {I}}'\) of J-Eq-Stub admits a jump-equilibrium, then the constructed instance \({\mathcal {I}}\) of J-Eq admits a jump-equilibrium.

Proof

Assume that there exists a jump-equilibrium \({\textbf{v}}'\) for the given instance \({\mathcal {I}}'\) with stubborn agents. Note that in \({\textbf{v}}'\) the vertices in \(V_{S'_1}\) and \(V_{S'_2}\) are occupied by stubborn agents from \(T_1'\) and \(T_2'\), respectively. We define an assignment \({\textbf{v}}\) for the constructed Schelling game without stubborn agents as follows and afterwards prove that it is a jump-equilibrium. In \({\textbf{v}}\), the occupied vertices in \(V(G) \cap V(G')\) are occupied by agents of the same type as the agents in \({\textbf{v}}'\). If a vertex is unoccupied in \({\textbf{v}}'\), then it is also unoccupied in \({\textbf{v}}\). The vertices in \(X_1\) are occupied by agents from \(T_1\). For \(t \in \{1,2\}\), the added degree-one vertices in \(M_t\) are occupied by agents from \(T_t\). Hence, the vertices in \(A=M_1 \cup V_{S'_1} \cup X_1\) are all occupied by agents from \(T_1\) and the vertices in \(B=M_2 \cup V_{S'_2}\) are all occupied by agents from \(T_2\) (note that, in \({\textbf{v}}\), we assigned exactly \(\vert T_1\vert\) agents from \(T_1\) and \(\vert T_2\vert\) agents from \(T_2\), as \(\vert T_1\vert =\vert T'_1\vert +\vert M_1\vert +\vert X_1\vert\) and \(\vert T_2\vert =\vert T'_2\vert +\vert M_2\vert\)).

Next, we prove that \({\textbf{v}}\) is a jump-equilibrium on G by showing that no profitable jump exists. We first observe that the utility of an agent i on a vertex \(w \in M_1 \cup X_1\) is \(u_i({\textbf{v}})=1\), since \(N^G(w)\subseteq A\) and all agents in A are friends of i. The same holds analogously for any agent on a vertex in \(M_2\). Therefore, the agents on vertices in \(M_1 \cup M_2 \cup X_1\) do not want to jump to an unoccupied vertex. Furthermore, note that the only unoccupied vertices in \({\textbf{v}}\) are in \(V(G') {\setminus } V_{S'}\) and that the neighborhood of all vertices in \(V(G') {\setminus } V_{S'}\) is identical in G and \(G'\). Therefore, no agent on a vertex in \(V(G') {\setminus } V_{S'}\) can have a profitable jump in \({\textbf{v}}\), since this jump would then also be profitable in \({\textbf{v}}'\). Thus, in \({\textbf{v}}\), a profitable jump can only exist for an agent i on a vertex \(v_i \in V_{S'}\) to an unoccupied vertex \(v \in V(G') {\setminus } V_{S'}\).

Let \(Y=V_{S'_1} \cup X_1\) if \(v_i \in V_{S'_1}\) and \(Y=V_{S'_2}\) if \(v_i \in V_{S'_2}\). Denote the number of degree-one neighbors of \(v_i\) that were added to \(G'\) in the construction of G by x. By construction of G, it holds that \(x\ge \Delta (G)^2\). The agent i is, among others, adjacent to the vertices in \(Y {\setminus } \{v_i\}\) and the \(x\ge \Delta (G')^2\) degree-one neighbors, which, by construction of \({\textbf{v}}\), are all occupied by friends. It holds that \(\deg ^G(v_i) \le x + \vert Y {\setminus } \{v_i\}\vert + \Delta (G')\). Thus, the utility of agent i on \(v_i\) is at least:

$$\begin{aligned} u_i^{G}({\textbf{v}})\ge \frac{x + \vert Y {\setminus } \{v_i\}\vert }{x + \vert Y {\setminus } \{v_i\}\vert + \Delta (G')} > \frac{x}{x+\Delta (G')} \ge \frac{\Delta (G')^2}{\Delta (G')^2+\Delta (G')}=\frac{\Delta (G')}{\Delta (G')+1}. \end{aligned}$$

Now consider an unoccupied vertex \(v \in V(G') {\setminus } V_{S'}\). Recall that as we assume that the given instance is regularized (see Lemma 6), for every vertex \(v \notin V_{S'}\) not occupied by a stubborn agent, it holds that there exist two adjacent vertices \(s_i, s_j \in V_{S'}\) occupied by stubborn agents \(i \in T'_1\) and \(j \in T'_2\). Since \(v \in V(G') {\setminus } V_{S'}\), the vertex v is thus adjacent to agents from both \(T_1\) and \(T_2\) in A and B, respectively. By construction of G, the neighborhood of v is identical in G and \(G'\). We thus have that \(\deg ^{G}(v)=\deg ^{G'}(v)\le \Delta (G')\). Since at least one agent adjacent to v is not a friend of i, the jump of i to v cannot be profitable in \({\textbf{v}}\):

$$\begin{aligned} u_i^{G}({\textbf{v}}^{i \rightarrow v}) \le \frac{\Delta (G')-1}{\Delta (G')}<\frac{\Delta (G')}{\Delta (G')+1}\le u_i^{G}({\textbf{v}}). \end{aligned}$$

To sum up, no profitable jump exists and \({\textbf{v}}\) is a jump-equilibrium for the constructed Schelling game. \(\square\)

To show the correctness of the backwards direction, we start by showing the following lemma, which states that all agents on a degree-one vertex in A or B are adjacent to at least one friend and that all central vertices have to be occupied. This property of jump-equilibria is then later used in the proof of Lemmas 9 and 10, where we prove that all vertices in A are occupied by agents from \(T_1\) and all vertices from B are occupied by agents from \(T_2\).

Lemma 8

In a jump-equilibrium \({\textbf{v}}\) in \({\mathcal {I}}\), all agents on a degree-one vertex \(v \in M_1 \cup M_2\) are adjacent to a friend and all central vertices \(w \in V_{S'_1} \cup X_1 \cup V_{S'_2}\) are occupied.

Proof

Suppose for the sake of a contradiction that there exists an agent \(i \in T_t\) for some \(t \in \{1,2\}\) on a degree-one vertex v with no adjacent friend in \({\textbf{v}}\). Let W be the set of vertices of the star which contains v. Recall that every star contains at least \(\vert V(G')\vert ^2+1\ge \vert V(G')\vert +3\ge \lambda +3\) vertices. Thus, at least three vertices in W have to be occupied. Since i has no adjacent friends, the central vertex \(w\in W\) is either unoccupied or occupied by an agent of the other type. We distinguish these two cases and prove that there exists a profitable jump in both cases.

Case 1

First, assume that w is unoccupied. As mentioned above, at least three vertices in W have to be occupied by agents. Since w is unoccupied, all occupied vertices are degree-one vertices. By the pigeonhole principle, there exist two agents of the same type on degree-one vertices in W. Both agents have no adjacent friends in \({\textbf{v}}\) and can increase their utility by jumping to w. This concludes the first case and furthermore proves that no central vertex can be unoccupied.

Case 2

Second, we consider the case where w is occupied by an agent \(j \in T_{t'}\) with \(t' \ne t\). Note that both \(\vert T_1\vert >\vert W\vert\) and \(\vert T_2\vert >\vert W\vert\), thus there are agents from both types in \(G[V(G){\setminus } W]\). Next, we argue that \(G[V(G){\setminus } W]\) is connected. Let \(Y=A\) if \(W \subseteq A\) and \(Y=B\) otherwise. It is easy to see that \(G[V(G){\setminus } Y]\) is connected (as argued for \(G[V(G){\setminus } A]\) above and analogous for \(G[V(G){\setminus } B]\)). The connected subgraph \(G[Y {\setminus } W]\) consists of the remaining stars in \(Y {\setminus } W\), where the central vertices form a clique. Note that there is at least one vertex \(x \in V_{S'}\) in \(Y {\setminus } W\), since by Lemma 6, we have assumed that there are at least two stubborn agents of each type. Furthermore, by Lemma 6, we have assumed that \(x \in V_{S'}\) is adjacent to a vertex \(y \in V(G') {\setminus } V_{S'}\) in \(G[V(G){\setminus } Y]\). Thus, as \(G[V(G){\setminus } Y]\) and \(G[Y {\setminus } W]\) are each connected and connected by an edge, \(G[V(G){\setminus } W]\) is connected.

First, suppose that there is no unoccupied vertex in \(V(G){\setminus } W\), which implies that there need to be unoccupied vertices in W. Then, there are two adjacent agents \(i' \in T_t\) and \(j' \in T_{t'}\) in \(G[V(G){\setminus } W]\). It holds that \(u_{j'}({\textbf{v}})<1\). Agent \(j'\) can increase its utility to 1 by jumping to any unoccupied vertex in W.

Therefore, there has to exist at least one unoccupied vertex in \(G[V(G){\setminus } W]\). If one of the unoccupied vertices in \(G[V(G){\setminus } W]\) is adjacent to an agent in \(T_t\), then agent \(i \in T_t\) can increase its utility by jumping to this vertex. Thus, the unoccupied vertices in \(G[V(G){\setminus } W]\) can only be adjacent to agents in \(T_{t'}\) and unoccupied vertices. Since \(G[V(G){\setminus } W]\) is connected, there exists an unoccupied vertex \(w'\) that is adjacent to at least one agent in \(T_{t'}\) on a vertex in \(G[V(G){\setminus } W]\). Note that agent j on the central vertex in W has \(u_j({\textbf{v}})<1\), since \(j \in T_{t'}\) is adjacent to \(i \in T_t\). Hence, agent j can increase its utility by jumping to \(w'\), where j is only adjacent to friends. \(\square\)

Next, we prove that all vertices in A are occupied by agents from \(T_1\).

Lemma 9

In every jump-equilibrium \({\textbf{v}}\) in \({\mathcal {I}}\), every vertex in A is occupied by an agent from \(T_1\).

Proof

We prove this lemma by splitting it into Claims 1 and 2. First, we prove that there are no agents from \(T_2\) in A. Then, we prove that all vertices in A are occupied.

Claim 1

In every jump-equilibrium \({\textbf{v}}\) in \({\mathcal {I}}\), no vertex from A is occupied by an agent from \(T_2\).

Proof of Claim

Recall that by the construction, we have that \(\vert T_1\vert \ge \vert A\vert = \vert X_1 \cup V_{S'_1}\vert \cdot (\vert T_2\vert -1) =z \cdot (\vert T_2\vert -1)= (s+\vert V(G')\vert +\vert M_2\vert ) \cdot (\vert T_2\vert -1)\). Thus, even if all vertices in \(V(G) {\setminus } A=(V(G') {\setminus } V_{S'_1}) \cup M_2\) are occupied by agents from \(T_1\), there are at least \(s \cdot (\vert T_2\vert -1)\) agents from \(T_1\) in A. Since each star in A contains \(\vert T_2\vert -1\) vertices, there have to be agents from \(T_1\) on at least s stars. By Lemma 8, it holds that at least s central vertices are occupied by agents from \(T_1\).

Now suppose there are \(x>0\) agents from \(T_2\) in A. We distinguish the following three cases based on the value of x (see Fig. 6) and prove in each case that \({\textbf{v}}\) cannot be a jump-equilibrium.

Fig. 6
figure 6

Claim 1: If there are \(x>0\) agents from \(T_2\) in A, then a profitable jump exists

Case 1: \(x<\vert T_2\vert -1\)

Recall Lemma 8, which states that no agent on a degree-one vertex in A has no adjacent friend in a jump-equilibrium. Thus, there exists an agent \(i \in T_2\) on a central vertex in A. Let S be the set of vertices of the star which contains \(v_i\). Since it holds that \(x<\vert T_2\vert -1=\vert S\vert\), not all vertices in S can be occupied by agents from \(T_2\). By Lemma 8, these vertices have to be unoccupied. Summarizing, there exists an unoccupied degree-one vertex \(w\in S\) adjacent to the central vertex occupied by \(i\in T_2\) (note that an agent from \(T_2{\setminus } \{i\}\) would get utility 1 from jumping to w. However, as there exist unoccupied vertices, we cannot be sure that there exists an agent with utility smaller than 1 on a vertex from \(V(G){\setminus } N^G(w)\).

Next, we upper-bound the utility of agent i. Note that \(i \in T_2\) is adjacent to all other central vertices in A, of which at least \(s=q \cdot (\vert T_2\vert + \Delta (G') ) + 1\) are occupied by agents from \(T_1\). It therefore holds that:

$$\begin{aligned} u_i({\textbf{v}})\le \frac{\vert T_2\vert }{q \cdot (\vert T_2\vert + \Delta (G') ) + 1 +\vert T_2\vert } < \frac{1}{q}. \end{aligned}$$

Since \(x<\vert T_2\vert\) and \(\vert T_1\vert \ge \vert A\vert\), there are agents from both types in \(V(G){\setminus } A\). Furthermore, recall that \(G[V(G){\setminus } A]\) is connected. Now consider a path between two arbitrary agents from \(T_1\) and \(T_2\) in \(G[V(G){\setminus } A]\). If there are two adjacent agents \(i' \in T_1\) and \(j' \in T_2\) on this path, then it holds that \(u_{j'}({\textbf{v}})<1\) and jumping to w is profitable for \(j'\). Thus, no such two agents can exist. However then, there exists an unoccupied vertex \(w'\) on the path that is adjacent to an agent in \(T_2\). Note that \(\deg ^G(w')\le \Delta (G')+\vert V(G')\vert ^2 + \vert V_{S'_2}\vert =q\). Jumping to \(w'\) is profitable for agent i:

$$\begin{aligned} u_i({\textbf{v}}^{i \rightarrow w'}) \ge \frac{1}{q}>u_i({\textbf{v}}). \end{aligned}$$

Case 2 \(x=\vert T_2\vert\)

Since \(2 \cdot (\vert T_2\vert -1)>x>\vert T_2\vert -1\), the agents from \(T_2\) occupy vertices on at least two stars in A, but cannot occupy all vertices of these stars. With Lemma 8, there exists an unoccupied degree-one vertex w adjacent to a central vertex occupied by an agent from \(T_2\). Now consider an agent \(i \in T_2\) on another central vertex in A not adjacent to w. We have that \(u_i({\textbf{v}})<1\), since i is adjacent to agents from \(T_1\) on other central vertices. Then, agent i can increase its utility to 1 by jumping to w.

Case 3 \(x=\vert T_2\vert -1\)

Again, by Lemma 8, at least one of the central vertices in A has to be occupied by an agent \(i \in T_2\). Furthermore, if there are agents from \(T_2\) on two or more stars, then there exists an unoccupied degree-one vertex adjacent to a central vertex occupied by an agent from \(T_2\) and an agent from \(T_2\) on another central vertex with utility less than 1. Analogous to Case 2, such an assignment cannot be a jump-equilibrium. Therefore, the \(\vert T_2\vert -1\) agents from \(T_2\) occupy all vertices of one star in A. We denote the set of vertices of this star by S.

All central vertices in A and B have to be occupied by Lemma 8. Note that there is only one agent from \(T_2\) outside of A. This agent cannot occupy a degree-one vertex in B, since it would have no adjacent friends on such a vertex. If it occupies a central vertex in B, then there are agents from \(T_1\) with no adjacent friends on degree-one vertices in this star (recall that at least three vertices of each star have to be occupied). Both possibilities contradict Lemma 8. Hence, this agent occupies a vertex in \(V(G'){\setminus } V_{S'}\) and all central vertices in B are occupied by agents from \(T_1\).

Next, we argue that both A and B are fully occupied in this case. First, suppose there exists an unoccupied vertex w in A. By Lemma 8, w has to be a degree-one vertex. Furthermore, since all \(\vert T_2\vert -1\) agents from \(T_2\) in A fully occupy one star, w is adjacent to a central vertex occupied by an agent from \(T_1\). Then, an agent from \(T_1\) on a central vertex in A not adjacent to w can increase its utility to 1 by jumping to w. If there is an unoccupied degree-one vertex w in B, then this vertex is adjacent to a central vertex occupied by an agent from \(T_1\) (recall that all central vertices in B are occupied by agents from \(T_1\)). Then again, any agent from \(T_1\) on a central vertex in A has a profitable jump to w. Thus, both A and B are fully occupied and all \(\lambda\) unoccupied vertices are in \(V(G'){\setminus } V_{S'}\).

Now consider the central vertex \(v_i\in S\) of the star in A occupied by the agents from \(T_2\). Recall that as our given instance is regularized (see Lemma 6) we can assume that \(\deg ^{G'}(v)<\lambda\) for all \(v \in V_{S'}\) in our input instance. In our construction, we only add edges within A to a vertex in A. Hence, as all \(\lambda\) unoccupied vertices need to be from \(V(G'){\setminus } V_{S'}\), there exists an unoccupied vertex w in \(G'-V_{S'}\) which is not adjacent to \(v_i\). If w is adjacent to an agent in \(T_2\), jumping to w is profitable for agent i, as, with an argument analogous to Case 1, we get that:

$$\begin{aligned} u_i({\textbf{v}}^{i \rightarrow w}) \ge \frac{1}{q}>u_i({\textbf{v}}). \end{aligned}$$

Hence, w is not adjacent to any agent from \(T_2\). Recall that as we assume that our input instance is regularized (see Lemma 6), in the input instance, for every vertex \(v \notin V_{S'}\) not occupied by a stubborn agent, there exist two adjacent vertices \(s_i, s_j \in V_{S'}\) occupied by stubborn agents \(i \in T'_1\) and \(j \in T'_2\). Thus, since \(w \in V(G') {{\setminus }} V_{S'}\), the vertex w is adjacent to a central vertex in B, which is occupied by an agent from \(T_1\). Then again, any agent from \(T_1\) on a central vertex in A can increase its utility to 1 by jumping to w. This concludes Case 3. Since we have exhausted all possible cases, Claim 1 follows. \(\square\)

Next, we prove the second part of Lemma 9 by proving that all vertices in A are occupied.

Claim 2

In every jump-equilibrium \({\textbf{v}}\) in \({\mathcal {I}}\), every vertex in A is occupied.

Proof of Claim

Suppose there exists an unoccupied vertex \(v \in A\). Again, by Lemma 8, v has to be a degree-one vertex and by Lemma 8 and Claim 1v needs to be adjacent to a vertex occupied by an agent from \(T_1\). Note that \(\vert T_2\vert >\vert V(G')\vert\), therefore by Claim 1 there have to be agents from \(T_2\) in B (as there are no agents from \(T_2\) in A). By Lemma 8, this implies that a central vertex in B is occupied by an agent from \(T_2\). Since we also have that \(\vert T_1\vert \ge \vert A\vert\), there are agents from \(T_1\) outside of A. If there is an agent from \(T_1\) in B, there also exists an agent \(i \in T_1\) on a central vertex in B. We have that \(u_i({\textbf{v}})<1\), since i is adjacent to the central vertex occupied by an agent from \(T_2\). However, agent i can then increase its utility to 1 by jumping to v. Hence, all remaining agents from \(T_1\) not in A are in \(V(G') {\setminus } V_{S'}\). Since all central vertices in B have to be occupied, there are agents from \(T_2\) on all central vertices in B.

Now consider an arbitrary agent \(i \in T_1\) in \(V(G') {\setminus } V_{S'}\). Since we assume the given instance to be regularized (see Lemma 6), i is adjacent to a central vertex in B, which is occupied by an agent from \(T_2\). We thus have \(u_i({\textbf{v}})<1\). Agent i can increase its utility to 1 by jumping to v, which completes the proof. \(\square\)

With Claims 1 and 2, Lemma 9 follows. \(\square\)

Next, we prove the following analogous claim for B, where we show that all vertices in B are occupied by agents from \(T_2\).

Lemma 10

In every jump-equilibrium \({\textbf{v}}\) in \({\mathcal {I}}\), every vertex in B is occupied by an agent from \(T_2\).

Proof

Again, we prove this claim by dividing it into Claims 3 and 4.

Claim 3

In every jump-equilibrium \({\textbf{v}}\) in \({\mathcal {I}}\), no vertex from B is occupied by an agent from \(T_1\).

Proof of Claim

Since by Lemma 9A is fully occupied by agents from \(T_1\), there are \(y :=\vert T_1\vert -\vert A\vert <\vert V(G')\vert\) agents from \(T_1\) outside of A. Suppose there are agents from \(T_1\) in B. By Lemma 8, there exists a central vertex \(v \in B\) which is occupied by an agent from \(T_1\). Furthermore, since \(y<\vert V(G')\vert ^2\), there exists an unoccupied degree-one vertex adjacent to v. Note that \(\vert T_2\vert \ge \vert B\vert\). As not all vertices in B are occupied by agents from \(T_2\), there exists an agent \(j \in T_2\) on a vertex in \(V(G') {\setminus } V_{S'}\). Since the given instance is regularized (see Lemma 6), this agent is adjacent to a central vertex in A. Let \(i' \in T_1\) be the agent on this central vertex. We have \(u_{i'}({\textbf{v}})<1\), since \(i' \in T_1\) is adjacent to \(j \in T_2\). Then, jumping to v is profitable for agent \(i'\), since \(u_{i'}({\textbf{v}})<1=u_{i'}({\textbf{v}}^{i' \rightarrow v})\). \(\square\)

Claim 4

In every jump-equilibrium \({\textbf{v}}\) in \({\mathcal {I}}\), every vertex in B is occupied.

Proof of Claim

Suppose there exists an unoccupied vertex \(v \in B\). By Lemma 8, the vertex v is a degree-one vertex. Since all central vertices have to be occupied and by Claim 3, B only contains agents from \(T_2\), the vertex v is adjacent to a central vertex occupied by an agent from \(T_2\). It holds that \(\vert T_2\vert \ge \vert B\vert\). Since at least one vertex in B is unoccupied, there exists an agent \(i \in T_2\) on a vertex in \(V(G') {\setminus } V_{S'}\). We have that \(u_{i}({\textbf{v}})<1\), since i is adjacent to a central vertex in A (by our assumption that the given instance is regularized; see Lemma 6), which is occupied by an agent from \(T_1\) by Lemma 9. Agent i can increase its utility to 1 by jumping to v. \(\square\)

Lemma 10 follows from Claims 3 and 4. \(\square\)

Finally, we prove the correction of the backwards direction of the construction, i.e., that the input Schelling game with stubborn agents admits a jump-equilibrium only if the constructed Schelling game without stubborn agents admits a jump-equilibrium:

Lemma 11

If the constructed instance \({\mathcal {I}}\) of J-Eq admits a jump-equilibrium, then the given instance \({\mathcal {I}}'\) of J-Eq-Stub admits a jump-equilibrium.

Proof

Assume that there exists a jump-equilibrium \({\textbf{v}}\) in the constructed instance \({\mathcal {I}}\). We define an assignment \(\mathbf {v'}\) on \(G'\) for the given instance \({\mathcal {I}}'\) with stubborn agents as follows and afterwards prove that it is a jump-equilibrium. In \(\mathbf {v'}\), an occupied vertex \(v \in V(G') {\setminus } V_{S'}\) is occupied by a strategic agent of the same type as the agent on v in \({\textbf{v}}\). If a vertex is unoccupied in \({\textbf{v}}\), then it is also unoccupied in \({\textbf{v}}'\). The vertices in \(V_{S'}\) have to be occupied by the respective stubborn agents. Note that by Lemmas 9 and 10, in \({\textbf{v}}\), the vertices in \(V_{S'_1} \subseteq A\) and \(V_{S'_2} \subseteq B\) have to be occupied by agents from \(T_1\) and \(T_2\), respectively. Thus, in \(\mathbf {v'}\), all occupied vertices are occupied by agents of the same type as in \({\textbf{v}}\). Note that in \(\mathbf {v'}\) we have assigned exactly \(\vert T'_1\vert\) agents from \(T'_1\) and \(\vert T'_2\vert\) agents from \(T'_2\) as it holds that \(\vert T_1\vert =\vert T'_1\vert +\vert M_1\vert +\vert X_1\vert\) and \(\vert T_2\vert =\vert T'_2\vert +\vert M_2\vert\) and by Lemmas 9 and 10 we know that in \({\textbf{v}}\) all vertices from \(M_1\cup X_1\) are occupied by agents from \(T_1\) and all vertices from \(M_2\) are occupied by agents from \(T_2\).

Next, we prove that \({\textbf{v}}'\) is a jump-equilibrium in the given Schelling game. Since the agents on vertices in \(V_{S'}\) are stubborn, only agents on vertices in \(V(G') {\setminus } V_{S'}\) can have a profitable jump. However, all unoccupied vertices are in \(V(G') {\setminus } V_{S'}\) in both \({\textbf{v}}\) and \({\textbf{v}}'\) and the neighborhood of vertices from \(V(G') {\setminus } V_{S'}\) is the same in G and \(G'\). A profitable jump for an agent on a vertex in \(V(G') {\setminus } V_{S'}\) to an unoccupied vertex from \(V(G') {\setminus } V_{S'}\) in \({\textbf{v}}'\) would therefore also be a profitable jump in \({\textbf{v}}\), thereby contradicting that \({\textbf{v}}\) is a jump-equilibrium. Thus, \(\mathbf {v'}\) is a jump-equilibrium. \(\square\)

Note that the membership of J-Eq in NP is trivial, as it is possible to verify that a given assignment is a jump equilibrium by iterating over pairs of occupied vertices and unoccupied vertices and checking whether the jump of the agent from the occupied vertex to the unoccupied vertex is profitable. Thus, from Lemmas 7 and 11, Theorem 2 follows:

Theorem 2

J-Eq is NP-complete.

3.3 Swap equilibria in α-star constellation graphs

In Sect. 4.2, which focuses on the robustness of swap-equilibria, we will study \(\alpha\)-star-constellation graphs as an example for a graph class where swap-equilibria are very robust (when they exist). Recall that these are graphs for which each vertex \(v \in V\) with \(\deg ^G(v) > 1\) has \(\alpha\) more degree-one neighbors than non-degree-one neighbors, i.e., \(\vert \{ w \in N^G(v) \mid \deg ^G(w)=1\}\vert \ge \vert \{ w \in N^G(v) \mid \deg ^G(w)>1\}\vert + \alpha\). However, this graph class is also interesting in terms of computing equilibria, as it turns out that while swap-equilibria might fail to exist on these graphs there exists a characterization that gives rise to a polynomial-time algorithm. Thus, informally speaking, by extending a graph by adding a sufficient number of degree-one vertices (together with some agents to put on these vertices), we can make the problem of deciding the existence of an equilibrium tractable. Moreover, \(\alpha\)-star-constellation graphs present one of the most complex graph class for which the polynomial-time solvability of deciding the existence of an equilibrium has been shown so far.

We start by observing that swap-equilibria on \(\alpha\)-star-constellation graphs may fail to exist. Specifically, there is no swap-equilibrium in a Schelling game with \(\vert T_1\vert =5\) and \(\vert T_2\vert =7\) on the 1-star-constellation graph depicted in Fig. 7. Notably, to the best of our knowledge the graph from Fig. 7 is the first known graph without a swap-equilibrium that is not a tree.

Proposition 1

A Schelling game on an \(\alpha\)-star-constellation graph G may fail to admit a swap-equilibrium, even if G is a split graph, that is, the vertices of the graph can be partitioned into a clique and an independent set.

Fig. 7
figure 7

There is no swap-equilibrium in a Schelling game with \(\vert T_1\vert =5\) and \(\vert T_2\vert =7\) on this 1-star-constellation graph

Proof

Consider the Schelling game with \(\vert T_1\vert =5\) many agents of type \(T_1\) and \(\vert T_2\vert =7\) many agents of type \(T_2\) on the graph G from Fig. 7, which consists of three 3-stars whose central vertices form a clique. Observe that as all stars in G consist of four vertices and neither \(\vert T_1\vert =5\) nor \(\vert T_2\vert =7\) are divisible by four, in any assignment \({\textbf{v}}\), there exists a degree-one vertex occupied by an agent \(i \in T_l\) such that the adjacent central vertex is occupied by an agent \(j \in T_{l'}\) of the other type with \(l \ne l'\). Let \(v \ne v'\) be the other two central vertices. We make a case distinction based on whether the agents on the degree-one vertices adjacent to v and \(v'\) have the same type as their respective neighbor on the central vertex. If this is the case, then since we have \(\vert T_1\vert <8\) and \(\vert T_2\vert <8\), the vertices v and \(v'\) cannot be occupied by agents of the same type. Assume by symmetry, without loss of generality, that an agent \(j' \in T_{l'}\) occupies vertex v and an agent \(i' \in T_l\) occupies vertex \(v'\). Then, we have \(u_{j'}({\textbf{v}})<1\) and swapping i and \(j'\) is profitable, as it holds that \(u_{i}({\textbf{v}})=0<u_{i}({\textbf{v}}^{i \leftrightarrow j'})\) and \(u_{j'}({\textbf{v}})<1=u_{j'}({\textbf{v}}^{i \leftrightarrow j'})\).

Otherwise, there is an agent on a degree-one vertex that has a different type than the agent on the adjacent central vertex v or \(v'\). This implies that there is an agent \(j'\ne j\) from \(T_{l'}\) with \(u_{j'}({\textbf{v}})<1\). Then, similarly to the case above, swapping i and \(j'\) is profitable. \(\square\)

On the positive side, we can precisely characterize swap-equilibria in Schelling games on \(\alpha\)-star-constellation graphs.

Theorem 3

Let G be an \(\alpha\)-star-constellation graph with \(\alpha \in \mathbb {N}_0\) and let \({\textbf{v}}\) be an assignment in some Schelling game on G. The assignment \({\textbf{v}}\) is a swap-equilibrium if and only if at least one of the following two conditions holds.

  1. 1.

    Every vertex \(v \in V(G)\) with \(\deg ^G(v)=1\) is occupied by an agent from the same type as the only adjacent agent in \({\textbf{v}}\).

  2. 2.

    There exists an agent \(i \in T_l\) for some \(l \in \{1,2\}\) such that all other agents \(i' \in T_l {\setminus } \{i\}\) are only adjacent to friends in \({\textbf{v}}\).

Proof

First, we prove that any assignment that fulfills at least one of the two conditions is always a swap-equilibrium. Let \({\textbf{v}}\) be an assignment satisfying the first condition, that is, every \(v \in V\) with \(\deg ^G(v)=1\) is occupied by an agent from the same type as the agent on the only adjacent vertex in \({\textbf{v}}\). Thus, for all \(i \in N\) with \(\deg ^G(v_i)=1\), we have \(u_i({\textbf{v}})=1\). No such agent i can be involved in a profitable swap. Recall that by definition of G, we have \(\vert \{ w \in N^G(v) \mid \deg ^G(w)=1\}\vert \ge \vert \{ w \in N^G(v) \mid \deg ^G(w)>1\}\vert + \alpha\) for all \(v \in V\) with \(\deg ^G(v) > 1\). Since all agents on vertices adjacent to \(v_j\) with degree one are friends, we have \(u_j({\textbf{v}})\ge \frac{1}{2}\) for all \(j \in N\) with \(\deg ^G(v_j)>1\). Now, consider an agent \(j \in T_l\) and an agent \(j' \in T_{l'}\) of the other type \(l' \ne l\) on vertex \(v_{j'}\) with \(\deg ^G(v_{j'})>1\). If we swap j and \(j'\), we have \(u_j({\textbf{v}}^{j \leftrightarrow j'})\le \frac{1}{2}\le u_j({\textbf{v}})\). Thus, no profitable swap is possible and \({\textbf{v}}\) is a swap-equilibrium.

Now, we consider an assignment that fulfills the second condition. Let \({\textbf{v}}\) be an assignment such that there exists an agent \(i \in T_l\) for one of the types \(l \in \{1,2\}\) such that all other agents \(i' \in T_l {\setminus } \{i\}\) of type \(T_l\) are only adjacent to friends. Assume without loss of generality that \(l=1\). For all \(i' \in T_1 {\setminus } \{i\}\), we have \(u_{i'}({\textbf{v}})=1\). Similarly, for all \(j \in T_2\) with \(v_j \notin N^G(v_i)\), we also have \(u_{j}({\textbf{v}})=1\). Hence, only agent \(i \in T_1\) and an agent \(j' \in T_2\) with \(v_{j'} \in N^G(v_i)\) can have a profitable swap. However, after swapping i and \(j'\), agent \(i \in T_1\) is only adjacent to agents from \(T_2\) and has \(u_i({\textbf{v}}^{i \leftrightarrow j})=0\). Therefore, no profitable swap is possible.

Next, we will argue that any assignment \({\textbf{v}}\) for which both conditions do not hold cannot be a swap-equilibrium. Thus, in assignment \({\textbf{v}}\), there exists an agent \(i \in N\) with \(\deg ^G(v_i)=1\) such that the only adjacent agent is of the other type. Assume without loss of generality that \(i \in T_1\). Additionally, for both types there exist two agents \(x,x' \in T_1\) with \(x \ne x'\) and \(y,y' \in T_2\) with \(y \ne y'\) such that \(\{v_x,v_y\} \in E\) and \(\{v_{x'},v_{y'}\} \in E\). We have \(u_{i}({\textbf{v}})=0\). Furthermore, since \(\deg ^G(v_i)=1\), at least one of the agents \(y,y' \in T_2\) has to be positioned outside of the neighborhood of \(v_i\). Assume without loss of generality that \(v_y \notin N^G(v_i)\) and thus also \(x \ne i\). Then, swapping i and y is profitable: We have \(u_{i}({\textbf{v}})=0<u_{i}({\textbf{v}}^{i \leftrightarrow y})\), since i is adjacent to x in \({\textbf{v}}^{i \leftrightarrow y}\). It also holds that \(u_{y}({\textbf{v}})<1=u_{y}({\textbf{v}}^{i \leftrightarrow y})\), since \(y \in T_2\) is adjacent to \(x \in T_1\) in \({\textbf{v}}\) and the only neighbor of y in \({\textbf{v}}^{i \leftrightarrow y}\) has the same type as y. Hence, the assignment \({\textbf{v}}\) cannot be a swap-equilibrium. \(\square\)

The characterization of swap-equilibria from Theorem 3 also yields a polynomial-time algorithm (using dynamic programming for Subset Sum) to decide for a Schelling game on an \(\alpha\)-star-constellation graph whether it admits a swap-equilibrium.

Corollary 1

For a Schelling game on an \(\alpha\)-star-constellation graph with \(\alpha \in \mathbb {N}_0\), one can decide in polynomial time whether a swap-equilibrium exists.

Proof

Recall that one can think of an \(\alpha\)-star-constellation graph G as a collection of stars with additional edges between the central vertices of the stars. We define the star-partition S(G) of G as the partitioning of V(G) into these stars, that is, S(G) contains one set for each vertex \(v\in V(G)\) with \(\deg ^G(v)>1\) which consists of v and all vertices \(w \in N^G(v)\) with \(\deg ^G(w)=1\). We note that the star-partition is unique and can be easily computed in polynomial time. Next, observe that there exists an assignment \({\textbf{v}}\) on G that meets the first condition from Theorem 3 if and only if S(G) can be partitioned into two sets A and B such that \(\vert \bigcup _{S \in A}S\vert =\vert T_1\vert\) and \(\vert \bigcup _{S \in B}S\vert =\vert T_2\vert\). Deciding this reduces to solving an instance of subset sum with integers bounded by n, which can be solved in \(\mathcal {O}(n^{2})\) by using dynamic programming. To decide whether an assignment \({\textbf{v}}\) fulfilling the second condition exists we compute, for each vertex \(v \in V\), the connected components \(C_1, \dots , C_m\) of \(G[V(G){{\setminus }} \{v\}]\) and check whether the components can be partitioned into two subsets A and B such that \(\vert \bigcup _{C \in A} V(C)\vert =\vert T_1\vert -1\) and \(\vert \bigcup _{C \in B} V(C)\vert =\vert T_2\vert\) or \(\vert \bigcup _{C \in A} V(C)\vert =\vert T_1\vert\) and \(\vert \bigcup _{C \in B} V(C)\vert =\vert T_2\vert -1\). Again, this can be solved by using dynamic programming in \(\mathcal {O}(n^{2})\) time. \(\square\)

Interestingly, Theorem 3 can also be used to show that there is a subclass of \(\alpha\)-star-constellation graphs, namely \(\alpha\)-caterpillars, on which a swap-equilibrium always exists. Consider a Schelling game on an \(\alpha\)-caterpillar G with \(w_1,\dots , w_{\ell }\) being the non-degree-one vertices forming the central path (\(\{\{w_{i},w_{i+1}\}\mid i\in [\ell -1]\}\subseteq E(G)\)). It is easy to construct a swap-equilibrium \({\textbf{v}}\) on G by assigning for each \(i \in \{1, \dots , \ell \}\) agents from \(T_1\) to \(w_i\) and to adjacent degree-one vertices, until all agents from \(T_1\) have been assigned; in which case the remaining vertices are filled with agents from \(T_2\). As \({\textbf{v}}\) fulfills Condition 2 from Theorem 3, \({\textbf{v}}\) is a swap-equilibrium (see Proposition 5 for a more detailed discussion and proof).

4 Robustness of equilibria

Having established in Sect. 3 that deciding the existence of an equilibrium is NP-hard, we now introduce the concept of robustness of an equilibrium. We consider both the robustness of an equilibrium with respect to the deletion of edges and with respect to the deletion of vertices, where deleting a vertex also implies deleting the agent occupying the vertex from the Schelling game.

Definition 1

For a Schelling game I on a graph G, an equilibrium \({\textbf{v}}\) in I is r-edge-robust (r-vertex-robust) for some \(r \in \mathbb {N}_0\) if \({\textbf{v}}\) is an equilibrium in I on the topology \(G-S\) for all subsets of edges \(S \subseteq E(G)\) (for all subsets of vertices \(S\subseteq V(G)\)) with \(\vert S\vert \le r\). The edge-robustness (vertex-robustness) of \({\textbf{v}}\) is the largest \(r\in [0,\vert E(G)\vert ]\) (\(r\in [0,\vert V(G)\vert ]\)) for which \({\textbf{v}}\) is r-edge-robust (r-vertex-robust).

Note that given an equilibrium \({\textbf{v}}\) that becomes unstable after deleting r edges/vertices, deleting further edges/vertices can make \({\textbf{v}}\) stable again, as any assignment is stable if we delete all edges/vertices. That is why in Definition 1 we require that \({\textbf{v}}\) is stable for all S with \(\vert S\vert \le r\) and not only for all S with \(\vert S\vert =r\).

We focus on the robustness of swap-equilibria. While for jump-equilibria the introduced concepts are also meaningful, already obtaining lower and upper bounds on the robustness of a jump-equilibrium on a single fixed graph is problematic, as the robustness of a jump-equilibrium significantly depends on the number of unoccupied vertices. For instance, if the number of agents of both types is small, on most graphs the agents can be placed such that all agents are only adjacent to friends making the equilibrium quite robust.

Note that as we restrict our attention to swap-equilibria, deleting agents and vertices is equivalent, as in this context a once unoccupied vertex can never become occupied again and is also irrelevant for computing utilities. Thus, all our results on vertex-robustness also apply to the robustness with respect to the deletion of agents. However, when analyzing jump-equilibria one would have to distinguish the two and consider the robustness of a jump-equilibrium with respect to the deletion of agents (but not vertices) and the deletion of vertices (and the agents occupying them).

4.1 First observations

We start by observing that if for one type there exists only a single agent, then there never is a profitable swap. Hence, in this case, every assignment trivially is a swap-equilibrium of edge-robustness \(\vert E(G)\vert\) and vertex-robustness \(\vert V(G)\vert\). That is why, in the following, we assume that \(\min \{\vert T_1\vert ,\vert T_2\vert \}\ge 2\). Further, if we consider vertex-robustness, then in case that \(\vert T_1\vert =2\) and \(\vert T_2\vert =2\), after deleting an agent from one type the other agent from this type will always have zero utility and cannot be part of a profitable swap, implying that any swap-equilibrium has vertex-robustness \(\vert V(G)\vert\). Thus, in the following, considering vertex-robustness, we assume that \(\vert T_1\vert \ge 3\) and \(\vert T_2\vert \ge 2\).

Focusing on edge-robustness for a moment, only the deletion of edges between agents of the same type has an influence on the stability of a swap-equilibrium. This is stated more precisely in the following proposition.

Proposition 2

Let \({\textbf{v}}\) be a swap-equilibrium for a Schelling game on topology G. Let \(S \subseteq E(G)\) be a set of edges such that \({\textbf{v}}\) is not a swap-equilibrium on \(G-S\). Then,

  1. (1)

    S contains at least one edge between agents of the same type.

  2. (2)

    \({\textbf{v}}\) is also not a swap-equilibrium on \(G-S'\), where \(S'\subseteq S\) is the subset of edges from S that connect agents of the same type.

  3. (3)

    For every set \(A\subseteq \{ \{v_i,v_j\} \in E(G) \mid i,j \in T_1 \vee i,j \in T_2 \}\) of edges between agents of the same type, \({\textbf{v}}\) is also not a swap-equilibrium on \(G-(S \cup A)\).

Proof

We start by proving statement (i). Let S be a set of edges between agents of different types. Consider the game I on topology \(G-S\) and assume for the sake of contradiction that \({\textbf{v}}\) is not a swap-equilibrium, that is, there exist agents \(i \in T_1\) and \(j \in T_2\) that want to swap. We therefore have \(u_i^{G-S}({\textbf{v}})<u_i^{G-S}({\textbf{v}}^{i \leftrightarrow j })\) and \(u_j^{G-S}({\textbf{v}})<u_j^{G-S}({\textbf{v}}^{i \leftrightarrow j })\).

On the original topology G, it holds that \(u_i^{G}({\textbf{v}})\ge u_i^{G}({\textbf{v}}^{i \leftrightarrow j })\), because \({\textbf{v}}\) is a swap-equilibrium on G. Since all of the edges in S are between agents of different types, no edges to friends of i are deleted in \(G-S\) and it therefore holds that \(u_i^{G}({\textbf{v}})\le u_i^{G-S}({\textbf{v}})\). Hence, we have:

$$\begin{aligned} u_i^{G}({\textbf{v}}^{i \leftrightarrow j })\le u_i^{G}({\textbf{v}})\le u_i^{G-S}({\textbf{v}}) < u_i^{G-S}({\textbf{v}}^{i \leftrightarrow j }). \end{aligned}$$
(1)

Consider the vertex \(v_j\) that is occupied by agent \(j\in T_2\) in assignment \({\textbf{v}}\). Since all of the edges in S are between agents of different types, the only edges incident to \(v_j\) that have been deleted in \(G-S\) are edges to agents in \(T_1\). Therefore, \(u_i^{G-S}({\textbf{v}}^{i \leftrightarrow j }) \le u_i^{G}({\textbf{v}}^{i \leftrightarrow j })\). This contradicts Eq. (1) and completes the proof of the first statement.

We now turn to statement (ii). Assume for the sake of contradiction, that \({\textbf{v}}\) is a swap-equilibrium on \(G-S'\). Notice that \(X=S{\setminus } S'\) only contains edges between agents of different types. Hence, we can apply the first statement to the fact that \({\textbf{v}}\) is a swap-equilibrium on \(G-S'\) and get that \({\textbf{v}}\) is a swap-equilibrium on \(G-(S'\cup X)=G-S\), leading to a contradiction.

Lastly, we consider statement (iii). Let \(i\in T_1\) and \(j \in T_2\) be a pair of agents that has a profitable swap on \(G-S\) in \({\textbf{v}}\). We will now argue that the swap is also profitable on \(G-(S \cup A)\). Consider the vertex \(v_i\) that is occupied by agent i. Since A only contains edges between agents of the same type, we only delete edges to friends of i in the neighborhood of \(v_i\). Hence, the utility of agent i in \({\textbf{v}}\) on topology \(G-(S \cup A)\) is at most as high as the utility on \(G-S\). In the neighborhood of \(v_j\), we only delete edges to agents in \(T_2\). Therefore, the utility of i after swapping to \(v_j\) on \(G-(S \cup A)\) has to be at least as high as on \(G-S\). By symmetry, the same holds for agent j. Hence, the swap is profitable and \({\textbf{v}}\) is also not a swap-equilibrium on \(G-(S \cup A)\). \(\square\)

For vertex-robustness, one can similarly observe that only deleting a vertex occupied by an agent a adjacent to at least one vertex occupied by a friend of a can make a swap-equilibrium unstable.

Next, note that the utility of an agent only depends on its neighborhood. Thus, whether two agents i and j have a profitable swap in \(G-S\) only depends on the edges/vertices incident/adjacent to \(v_i\) and \(v_j\) in S. Combining this with the observation that no profitable swap can involve an agent on an isolated vertex, it follows that if a swap-equilibrium cannot be made unstable by deleting \(2\cdot (\Delta (G)-1)\) edges/vertices, then it cannot be made unstable by deleting an arbitrary number of edges/vertices:

Observation 1

Let \({\textbf{v}}\) be a swap-equilibrium for a Schelling game on G. If \({\textbf{v}}\) is \(2\cdot ( \Delta (G)-1)\)-edge-robust, \({\textbf{v}}\) has edge-robustness \(\vert E(G)\vert\) and if \({\textbf{v}}\) is \(2\cdot ( \Delta (G)-1)\)-vertex-robust, \({\textbf{v}}\) has vertex-robustness \(\vert V(G)\vert\).

The simple fact that the utility of an agent only depends on its neighborhood leads to a polynomial-time algorithm to determine whether a given swap-equilibrium \({\textbf{v}}\) has edge-robustness \(r \in \mathbb {N}_0\): We simply iterate over all pairs of agents i and j and check whether we can delete at most r edges between \(v_i\) and adjacent vertices occupied by friends of i and between \(v_j\) and adjacent vertices occupied by friends of j such that the swap of i and j becomes profitable (note that the stability of \({\textbf{v}}\) only depends on the number of such deleted edges in the neighborhood of each agent, not the exact subset of edges).Footnote 3

Proposition 3

Given a Schelling game with n agents, a swap-equilibrium \({\textbf{v}}\), and an integer \(r \in \mathbb {N}_0\), one can decide in \(\mathcal {O}(n^2\cdot r)\) time whether \({\textbf{v}}\) is r-edge/vertex-robust.

Proof

We describe in detail how to solve the problem for edge-robustness. For vertex-robustness, an analogous approach can be used. Recall the definition of \(a_i({\textbf{v}})\) as the number of friends adjacent to agent i in \({\textbf{v}}\) and let \(b_i({\textbf{v}}):=\vert N_{i}({\textbf{v}})\vert -a_i({\textbf{v}})\) be the number of agents of the other type in the neighborhood of i. We define \(\mathbbm {1}_{i,j}=1\) if the agents i and j are neighbors and \(\mathbbm {1}_{i,j}=0\) otherwise.

We solve the problem using Algorithm 1 for which we prove the correctness and running time in the following: First, we prove that Algorithm 1 outputs yes if \({\textbf{v}}\) is r-edge-robust and no otherwise. Assume that \({\textbf{v}}\) is r-edge-robust. It therefore holds for all \(i \in T_1\) and \(j \in T_2\) and \(S \subseteq E(G)\) with \(\vert S\vert \le r\) that swapping i and j is not profitable in \(G-S\). Hence, it holds that the swap of i and j is not profitable if we delete x edges between \(v_i\) and vertices that are occupied by friends of i and y edges between \(v_j\) and vertices that are occupied by friends of j for all \(x,y \in \mathbb {N}_0\) with \(x+y \le r\) and \(x\le a_i({\textbf{v}})\) and \(y\le a_j({\textbf{v}})\). After deleting these edges, the utilities of i and j are given by \(u'_i({\textbf{v}}) = \frac{a_i({\textbf{v}})-x}{\vert N_i({\textbf{v}})\vert -x}\) and \(u'_j({\textbf{v}}) = \frac{a_j({\textbf{v}})-y}{\vert N_j({\textbf{v}})\vert -y}\). Swapping positions results in utility \(u'_i({\textbf{v}}^{i \leftrightarrow j}) = \frac{b_j({\textbf{v}})-\mathbbm {1}_{i,j}}{\vert N_j({\textbf{v}})\vert -y}\) for i and \(u'_j({\textbf{v}}^{i \leftrightarrow j}) = \frac{b_i({\textbf{v}})-\mathbbm {1}_{i,j}}{\vert N_i({\textbf{v}})\vert -x}\) for j. Notice that we subtract \(\mathbbm {1}_{i,j}=1\) in the numerator if i and j are adjacent, since the vertex previously occupied by i or j in \({\textbf{v}}\) is occupied by the other agent of a different type in \({\textbf{v}}^{i \leftrightarrow j}\). Since, by our assumption, \({\textbf{v}}\) is r-edge-robust, it has to hold that \(u'_i({\textbf{v}}) \ge u'_i({\textbf{v}}^{i \leftrightarrow j})\) or \(u'_j({\textbf{v}}) \ge u'_j({\textbf{v}}^{i \leftrightarrow j})\). Hence, Algorithm 1 outputs yes.

Assume that \({\textbf{v}}\) is not r-edge-robust. Then, there exists a pair of agents \(i,j \in N\) and a set of edges \(S \subseteq E(G)\) with \(\vert S\vert \le r\) such that the swap involving i and j is profitable on \(G-S\). Note that, as argued before, we only have to consider deleting edges to friends in the neighborhoods of i and j. Therefore, there exist \(w,z \in \mathbb {N}_0\) with \(w+z \le r\), \(w\le a_i({\textbf{v}})\) and \(z\le a_j({\textbf{v}})\) such that swapping i and j is profitable after deleting w edges to adjacent friends of i and z edges to adjacent friends of j. As proven in Proposition 2, deleting additional edges between i and friends of i and j and friends of j cannot make \({\textbf{v}}\) stable again. Thus, it holds for all \(w',z' \in \mathbb {N}_0\) with \(w\le w'\le a_i({\textbf{v}})\) and \(z\le z' \le a_j({\textbf{v}})\) that swapping i and j is profitable after deleting \(w'\) edges to adjacent friends of i and \(z'\) edges to adjacent friends of j. Thus, in Algorithm 1 with \(x=w\) and \(y=\min \{r-x,a_j({\textbf{v}})\}\ge z\), we have \(u'_i({\textbf{v}}) < u'_i({\textbf{v}}^{i \leftrightarrow j})\) and \(u'_j({\textbf{v}}) < u'_j({\textbf{v}}^{i \leftrightarrow j})\) and therefore return no.

Next, we analyze the running time. We first iterate over all pairs of agents \(i \in T_1\) and \(j \in T_2\) that can potentially be involved in a profitable swap, the number of pairs is upper-bounded by \(n^2\). For each pair, we iterate over at most r possible values for x from \(\min \{r,a\}\) to zero. All other operations are simple arithmetic operations that can be computed in constant time (assuming we precomputed all \(\vert N_i({\textbf{v}})\vert\) and \(a_i({\textbf{v}})\) in linear time), hence our algorithm runs in \(\mathcal {O}(n^2\cdot r)\) time. \(\square\)

figure a

Note, however, that finding a swap-equilibrium whose vertex- or edge-robustness is as high as possible is NP-hard, as we have proven in Theorem 1 that already deciding whether a Schelling game admits some swap-equilibrium is NP-hard.

4.2 Robustness of equilibria on different graph classes

In this subsection, we analyze the influence of the topology on the robustness of swap-equilibria. We first analyze cliques where each swap-equilibrium has edge-robustness zero and vertex-robustness \(\vert V(G)\vert\). Subsequently, we turn to cycles, paths, and grids and find that there exists a swap-equilibrium on all these graphs with edge-robustness and vertex-robustness zero. For paths, we observe that the difference between the edge/vertex-robustness of the most and least robust equilibrium can be arbitrarily large. Finally, with \(\alpha\)-star-constellation graphs for \(\alpha \in {\mathbb {N}}_0\), we present a subclass of graphs on which all swap-equilibria have at least edge/vertex-robustness \(\alpha\).

4.2.1 Cliques

We start by observing that on a clique every assignment is a swap-equilibrium. From this it directly follows that every swap-equilibrium has vertex-robustness \(\vert V(G)\vert\), as deleting a vertex from a clique results in another clique. In contrast, each swap-equilibrium can be made unstable by deleting one edge. Thereby, the following observation also proves that the difference between the edge- and vertex-robustness of a swap-equilibrium can be arbitrarily large:

Observation 2

In a Schelling game on a clique G with \(\vert T_1\vert \ge 2\) and \(\vert T_2\vert \ge 2\), every swap-equilibrium \({\textbf{v}}\) has edge-robustness zero and vertex-robustness \(\vert V(G)\vert\).

Proof

It remains to prove that the edge-robustness is always zero. Let \(i\ne j \in T_1\), \(e:=\{v_i,v_j\}\in E(G)\), and \(l\in T_2\). As G is a clique, it holds that \(u^G_i({\textbf{v}})= \frac{\vert T_1\vert -1}{\vert T_1\vert +\vert T_2\vert -1}\) and \(u^G_l({\textbf{v}})= \frac{\vert T_2\vert -1}{\vert T_1\vert +\vert T_2\vert -1}\). Swapping i and l is profitable in \({\textbf{v}}\) on \(G-\{e\}\) for both i and l, as

$$\begin{aligned}&u^{G-\{e\}}_i({\textbf{v}}^{i \leftrightarrow l})=\frac{\vert T_1\vert -1}{\vert T_1\vert +\vert T_2\vert -1}>\frac{\vert T_1\vert -2}{\vert T_1\vert +\vert T_2\vert -2}=u^{G-\{e\}} _i({\textbf{v}}) \text { and }\\&u_l^{G-\{e\}}({\textbf{v}}^{i \leftrightarrow l})=\frac{\vert T_2\vert -1}{\vert T_1\vert +\vert T_2\vert -2}>\frac{\vert T_2\vert -1}{\vert T_1\vert +\vert T_2\vert -1}=u^{G-\{e\}} _l({\textbf{v}}). \end{aligned}$$

\(\square\)

4.2.2 Cycles

For a cycle G, we can show that in a swap-equilibrium \({\textbf{v}}\), every agent is adjacent to at least one friend. Then, picking an arbitrary agent \(i\in T_1\) that has utility \(\nicefrac {1}{2}\) in \({\textbf{v}}\) and deleting i’s neighbor from \(T_1\) or the edge between i and its neighbor from \(T_1\) makes \({\textbf{v}}\) unstable.

Proposition 4

In a Schelling game on a cycle G with \(\vert T_1\vert \ge 2\) and \(\vert T_2\vert \ge 2\), every swap-equilibrium \({\textbf{v}}\) has edge-robustness zero. For \(\vert T_1\vert \ge 3\) and \(\vert T_2\vert \ge 2\), every swap-equilibrium \({\textbf{v}}\) has vertex-robustness zero.

Proof

First, we show that, if \(\vert T_1\vert \ge 2\) and \(\vert T_2\vert \ge 2\), then each agent is adjacent to at least one friend in a swap-equilibrium \({\textbf{v}}\). For the sake of contradiction, assume without loss of generality that there exists an agent \(i\in T_1\) that has \(u_i({\textbf{v}})=0\). Let \(i'\ne i\in T_1\) be a different agent from \(T_1\) with \(u_{i'}({\textbf{v}})\le \frac{1}{2}\) (such an agent needs to exist, as we assume that \(\vert T_1\vert \ge 2\), \(\vert T_2\vert \ge 2\), and that G is a cycle). We now distinguish two cases. If \(i'\) is adjacent to an agent \(j\in T_2\) who is also adjacent to i, then swapping i and j is profitable, as \(u_i({\textbf{v}}^{i \leftrightarrow j})=\frac{1}{2}>0=u_i({\textbf{v}})\) and \(u_j({\textbf{v}}^{i \leftrightarrow j})=\frac{1}{2}>0=u_j({\textbf{v}})\). Otherwise, let \(j\in T_2\) be an agent from \(T_2\) adjacent to \(i'\). Then, swapping i and j is profitable, as \(u_i({\textbf{v}}^{i \leftrightarrow j})\ge \frac{1}{2}>0=u_i({\textbf{v}})\) and \(u_j({\textbf{v}}^{i \leftrightarrow j})=1>\frac{1}{2}\ge u_j({\textbf{v}})\).

Let \(w_1, \dots , w_l\) be a maximal subpath of vertices occupied by agents from \(T_1\) and let \(i\in T_1\) be the agent occupying \(w_1\) and \(j\in T_1\) be the agent occupying \(w_l\) in \({\textbf{v}}\). By the above argument it holds that \(l\ge 2\). Since we have at least two agents from \(T_2\), agent i on \(w_1\) and agent j on \(w_l\) need to be adjacent to agents \(i' \in T_2\) and \(j' \in T_2\), respectively, with \(i' \ne j'\).

We first consider edge-robustness. Let \(S:=\{\{w_1,w_2\}\}\). On \(G-S\), agent i and agent \(j'\) have a profitable swap, as they are not adjacent and thus it holds that \(u^{G-S}_i({\textbf{v}}^{i \leftrightarrow j'})\ge \frac{1}{2}>0=u^{G-S}_i({\textbf{v}})\) and \(u^{G-S}_{j'}({\textbf{v}}^{i \leftrightarrow j'})=1>\frac{1}{2}\ge u_{j'}({\textbf{v}})\).

We now turn to vertex-robustness. Let \(S:=\{w_2\}\). If \(l\ge 3\), then j has not been deleted and again swapping i and \(j'\) is profitable, as \(u^{G-S}_i({\textbf{v}}^{i \leftrightarrow j'})\ge \frac{1}{2}>0=u^{G-S}_i({\textbf{v}})\) and \(u^{G-S}_{j'}({\textbf{v}}^{i \leftrightarrow j'})=1>\frac{1}{2}\ge u_{j'}({\textbf{v}})\). Otherwise, if \(l=2\), as G is a cycle and \(\vert T_1\vert \ge 3\), there needs to exist an agent \(p\in T_1{\setminus } \{i,j\}\) that is adjacent to an agent \(q\in T_2\). By our observation from above that each agent in \({\textbf{v}}\) needs to be adjacent to at least one friend, it follows that \(q\ne i'\) and \(q\ne j'\). This implies that q and i have a profitable swap, as \(u^{G-S}_i({\textbf{v}}^{i \leftrightarrow q})\ge \frac{1}{2}>0=u^{G-S}_i({\textbf{v}})\) and \(u^{G-S}_q({\textbf{v}}^{i \leftrightarrow q})=1>\frac{1}{2}\ge u_q({\textbf{v}})\). \(\square\)

4.2.3 Paths

Next, we turn to paths and prove that every Schelling game on a path with sufficiently many agents from both types has an equilibrium with edge-/vertex-robustness zero and one with edge-robustness \(\vert E(G)\vert\) and vertex-robustness \(\vert V(G)\vert\). This puts paths in a surprisingly sharp contrast to cycles. The reason for this is that on a path, we can always position the agents such that there exists only one edge between agents of different types, yielding a swap-equilibrium with edge-robustness \(\vert E(G)\vert\) and vertex-robustness \(\vert V(G)\vert\). This is not possible on a cycle.

Theorem 4

For a Schelling game on a path G with \(\vert T_1\vert \ge 4\) and \(\vert T_2\vert \ge 2\), there exists a swap-equilibrium \({\textbf{v}}\) that has edge-robustness and vertex-robustness zero and a swap-equilibrium \({\textbf{v}}'\) that has edge-robustness \(\vert E(G)\vert\) and vertex-robustness \(\vert V(G)\vert\).

Fig. 8
figure 8

The swap-equilibrium with robustness zero from Theorem 4. After deleting \(\{w_1, w_2\} \in E(G)\) or \(w_1\in V(G)\), swapping i and j is profitable

Proof

Let \(V(G)=\{w_1,\ldots ,w_n\}\) and \(E(G)=\{\{w_i,w_{i+1}\}\mid i\in [n-1]\}\). In \({\textbf{v}}\), vertices \(w_1\) and \(w_2\) are occupied by agents from \(T_1\), vertices \(w_3\) to \(w_{\vert T_2\vert +2}\) are occupied by agents from \(T_2\), and the remaining \(\vert T_1\vert -2\ge 2\) vertices are occupied by agents from \(T_1\) (see Fig. 8 for a visualization). As all agents have at most one neighbor of the other type and at least one neighbor of the same type, for each pair i, j of agents of different types it holds that \(u_i({\textbf{v}}^{i \leftrightarrow j})\le \nicefrac {1}{2}\le u_i({\textbf{v}})\). Thus, \({\textbf{v}}\) is a swap-equilibrium. Further, after deleting the edge between \(w_1\) and \(w_2\) or deleting the vertex \(w_1\), swapping the agent on \(w_2\) with the agent on \(w_{\vert T_2\vert +2}\) is profitable. It follows that \({\textbf{v}}\) has edge-robustness and vertex-robustness zero.

In \({\textbf{v}}'\), the agents from \(T_1\) occupy the first \(\vert T_1\vert\) vertices and agents from \(T_2\) the remaining vertices. Let \(S \subseteq E(G)\) or \(S\subseteq V(G)\) and consider \(G - S\). As for \(j\in [\vert T_1\vert -1] \cup [\vert T_1\vert +2,n]\), in \(G-S\), the agent on \(w_j\) got deleted, has no neighbor, or is only adjacent to friends, it can never be involved in a profitable swap. Further, swapping the agent on \(w_{\vert T_1\vert }\) and the agent on \(w_{\vert T_1\vert +1}\) can also never be profitable, since after the swap none of the two is adjacent to a friend. Thus, \({\textbf{v}}'\) is a swap-equilibrium on \(G-S\). \(\square\)

If \(\max \{\vert T_1\vert ,\vert T_2\vert \}\le 3\), which is not covered by Theorem 4, then in every swap-equilibrium the path is split into two subpaths and agents from \(T_1\) occupy one subpath and agents from \(T_2\) occupy the other subpath. As argued in the proof of Theorem 4, such an assignment has edge-robustness \(\vert E(G)\vert\) and vertex-robustness \(\vert V(G)\vert\).

4.2.4 Grids

We now turn to grids, which besides paths have been most often considered in the context of Schelling’s segregation model. For both vertex- and edge-robustness, using some more involved arguments, we show that every swap-equilibrium has either robustness one or zero. Moreover, we prove that there exists an infinite class of Schelling games on grids admitting a swap-equilibrium with robustness zero and one with robustness one.

To prove that every swap-equilibrium on a grid has edge-robustness and vertex-robustness at most one, we first define the concept of frames of a grid (this notion also appears in the analysis of the price of anarchy of swap-equilibria on grids in the work of Bilò et al. [7]). Let G be an \((x\times y)\)-grid with \(V(G)=\{ (a,b) \in \mathbb {N}\times \mathbb {N}\mid a\le x, b\le y\}\). We refer to the set B(G) of vertices in the top row, bottom row, left column and right column as border vertices (formally, \(B(G)=\{ (a,b) \in V(G) \mid a \in \{1,x\} \text { or } b \in \{1,y\} \}\)). The first frame \(F_1\) of G is the set of border vertices. The second frame \(F_2\) of G is the set of border vertices of the grid that results from deleting the first frame from G. Further, for all \(i>1\), the frame \(F_i\) of G is the set of border vertices of the grid that results from deleting the frames \(F_1,\dots , F_{i-1}\) from G.

Theorem 5

  1. 1.

    In a Schelling game with \(\min (\vert T_1\vert , \vert T_2\vert ) \ge 4\) on an \((x\times y)\)-grid with \(\min (x,y)\ge 4\), the edge- and the vertex-robustness of any swap-equilibrium is at most one.

  2. 2.

    In a Schelling game with \(\vert T_1\vert =\vert T_2\vert\) on an \((x\times y)\)-grid with \(x\ge 4\) being even and \(y\ge 2\), there exists a swap-equilibrium \({\textbf{v}}\) with edge- and vertex-robustness zero and a swap-equilibrium \({\textbf{v}}'\) with edge- and vertex-robustness one.

Proof

In the following, let G be an \((x\times y)\)-grid. We start by proving the first statement.

1. Edge- and Vertex-Robustness at Most One

For the sake of contradiction, assume that there exists a swap-equilibrium \({\textbf{v}}\) which is 2-vertex-robust or 2-edge-robust. By induction over the frames of G, we show that all vertices have to be occupied by agents from one type in \({\textbf{v}}\), which contradicts that we have at least four agents from both types.

Base Case. First, consider the frame \(F_1\) and assume for the sake of contradiction that there are agents from both types on vertices from \(F_1\). Then, there exist agents \(i \in T_1\) and \(j\in T_2\) on adjacent vertices from \(F_1\). Note that i has at most three neighbors. Let \(i'\in T_1\) be an agent from \(T_1\) that is not placed on a vertex from \(N(v_i)\cup \{v_i\}\) and let \(j'\in T_2\) be an agent from \(T_2\) which is not placed on a vertex from \(N(v_i)\cup \{v_i\}\) (such vertices exist as there exist four agents per type, \(\vert N(v_i)\cup \{v_i\}\vert \le 4\), and for both types at least one of its agents is placed on a vertex from \(N(v_i)\cup \{v_i\}\)). Since G is an \((x\times y)\)-grid with \(x,y\ge 4\), there exists a path from \(v_{i'}\) to \(v_{j'}\) that does not visit a vertex from \(N(v_i)\cup \{v_i\}\). Given that the two endpoints of the path are occupied by agents of different types, on this path, there need to be agents \(i''\in T_1\) and \(j''\in T_2\) that are placed on adjacent vertices on this path and not on a vertex from \(N(v_i)\cup \{v_i\}\). Now, if we remove the at most two vertices in \(N(v_i){\setminus } \{v_j\}\) or the corresponding edges from \(v_i\) to these vertices, then i has utility zero and neither \(v_{i''}\) nor \(v_{j''}\) has been deleted. Thus, swapping i and \(j''\) is profitable, as \(u_i({\textbf{v}})=0<u_i({\textbf{v}}^{i \leftrightarrow j''})\) and \(u_{j''}({\textbf{v}})<1=u_{j''}({\textbf{v}}^{i \leftrightarrow j''})\).

Induction Step. Assume that it holds for some \(\ell \in \mathbb {N}\), that all \(F_k\) with \(k\le \ell\) are occupied only by agents from \(T_1\) (without loss of generality).

We now show that then \(F_{\ell +1}\) also needs to be only occupied by agents from \(T_1\). We do so by showing that if there are agents from the other type \(T_{2}\) in \(F_{\ell +1}\), then there exists a profitable swap after deleting at most two vertices or at most two edges. We assume that \(\vert F_{\ell +1}\vert \ge 4\). If \(\vert F_{\ell +1}\vert < 4\), then we have already reached a contradiction, since all other frames are occupied by agents from \(T_1\) only, but there are at least four agents from \(T_{2}\) that have to be positioned.

First, suppose that there are only agents from \(T_{2}\) in \(F_{\ell +1}\). Let \(i \in T_{2}\) be the agent in the bottom-left corner of \(F_{\ell +1}\). Formally, let \(i \in T_{2}\) with \(v_i = (a,b) \in F_{\ell +1}\) such that it holds for all other \((a',b') \in F_{\ell +1}\) that \(a'\ge a\) and \(b' \ge b\). Note that i is adjacent to at least two agents of type \(T_1\) in \(F_{\ell }\) and has at most two adjacent friends. Thus, after deleting at most two vertices or edges, we have that \(u_i({\textbf{v}})=0\). As \(\vert F_{\ell +1}\vert \ge 4\), there exists another agent \(i' \in T_2\) in \(F_{\ell +1}\) outside of the neighborhood of i. Agent \(i'\) is adjacent to an agent \(j\in T_1\) in \(F_{\ell }\). It holds that \(u_j({\textbf{v}})<1\). Then, swapping i and j is profitable, since \(u_j({\textbf{v}})<1=u_j({\textbf{v}}^{i \leftrightarrow j})\) and \(u_i({\textbf{v}})=0<u_i({\textbf{v}}^{i \leftrightarrow j})\). Hence, there have to be agents from \(T_1\) in \(F_{\ell +1}\).

Next, suppose for the sake of contradiction that there are agents from both types in \(F_{\ell +1}\). Then, there exists an agent \(i \in T_{2}\) in \(F_{\ell +1}\) that is adjacent to an agent from \(T_{1}\) on a vertex also in \(F_{\ell +1}\). Note that agent i is adjacent to at least two agents of the other type (the adjacent agent from \(T_1\) in \(F_{\ell +1}\) and some agent in \(F_{\ell }\)) and thus has at most two adjacent friends. Moreover, i has at most four neighbors. Let \(j\in T_{1}\) be an agent which is not adjacent to i and not placed on a corner-vertex of the grid (such an agent exists as the frame \(F_1\) of the \((x\times y)\)-grid with \(x,y\ge 4\) is fully occupied by agents from \(T_1\)). Furthermore, let \(i' \in T_{2}\) be an agent from \(T_{2}\) that is not adjacent to i (such an agent exists as \(\vert T_{2}\vert \ge 4\) and two of the five vertices in \(N(v_i)\cup \{v_i\}\) are occupied by agents from \(T_1\)). Note that \(i'\) has to be placed on a vertex in a frame \(F_j\) with \(j>\ell\) (and thus, in particular, cannot be placed on a corner-vertex of the grid). As G is an \((x\times y)\)-grid with \(x,y\ge 4\) and neither \(v_j\) nor \(v_{i'}\) is a corner-vertex, there exists a path from \(v_j\) to \(v_{i'}\) that does not go through \(N(v_i)\cup \{v_i\}\). Given that the two endpoints of the path are occupied by agents of different types, on this path, there need to be agents \(i''\in T_{2}\) and \(j''\in T_1\) that are placed on adjacent vertices on this path and not on a vertex from \(N(v_i)\cup \{v_i\}\). Now, if we remove the at most two vertices adjacent to \(v_i\) occupied by friends of agent i (or the corresponding edges), then i has utility zero and neither \(v_{i''}\) nor \(v_{j''}\) has been deleted. Thus, swapping i and \(j''\) is profitable, as \(u_i({\textbf{v}})=0<u_i({\textbf{v}}^{i \leftrightarrow j''})\) and \(u_{j''}({\textbf{v}})<1=u_{j''}({\textbf{v}}^{i \leftrightarrow j''})\). Thus, the induction step follows.

2. Equilibria With Tight Robustness

Let I be a Schelling game with \(\vert T_1\vert = \vert T_2\vert\) on a grid G with \(x\ge 4\) columns and \(y\ge 2\) rows and x being even. Note that y divides \(\vert T_1\vert\) (and \(\vert T_2\vert\)), as \(\vert T_1\vert =\vert T_2\vert\), \(\vert T_1\vert +\vert T_2\vert =x\cdot y\), and x is even.

We start by defining the assignment \({\textbf{v}}\) as follows. The first column is occupied by agents from \(T_1\), the following columns up to column \(\frac{x}{2}+1\) are occupied by the agents from \(T_2\) and the remaining agents from \(T_1\) are placed on columns \(\frac{x}{2}+2\) to x.

We now show that \({\textbf{v}}\) is a swap-equilibrium. Observe that it holds for all agents \(i \in T_2\) that \(u_i({\textbf{v}})\ge \frac{1}{2}\). An agent \(j \in T_1\) has at most one neighbor in \(T_2\). Therefore, agent i could achieve at most \(u_i({\textbf{v}}^{i \leftrightarrow j})=\frac{1}{2}\le u_i({\textbf{v}})\) by swapping with an agent \(j\in T_1\). Thus, no profitable swap exists.

As regards the robustness, note that in \({\textbf{v}}\), there exists an agent \(i \in T_1\) on the vertex at the top of the first column with only one adjacent friend \(i'\in T_1\). If we now either delete vertex \(v_{i'}\) or the edge \(\{v_i,v_{i'}\}\), then agent i and agent \(j \in T_2\) at the bottom of column \(\frac{x}{2}+1\), who has utility less than 1 in \({\textbf{v}}\), have a profitable swap. It follows that \({\textbf{v}}\) has edge- and vertex-robustness zero.

Next, we construct an assignment \({\textbf{v}}'\) with edge- and vertex-robustness one: The agents from \(T_1\) occupy the first \(\frac{x}{2}\) columns and the agents from \(T_2\) are placed on the remaining columns. We now argue that \({\textbf{v}}'\) is a swap-equilibrium: Observe that only the agents on columns \(\frac{x}{2}\) and \(\frac{x}{2}+1\) have a utility of less than 1. Therefore, only these agents can be involved in a profitable swap. Consider some agent \(i\in T_1\) from column \(\frac{x}{2}\). Since \(\frac{x}{2}\ge 2\), we have \(u_i({\textbf{v}}')=\frac{2}{3}\) if i occupies the vertex on the top or bottom of the column and \(u_i({\textbf{v}}')=\frac{3}{4}\) otherwise. If i swaps with some agent j from column \(\frac{x}{2}+1\), then \(u_i(\mathbf {v'}^{i \leftrightarrow j })\le \frac{1}{3}\) if \(v_j\) is the vertex at the top or bottom of the column and \(u_i(\mathbf {v'}^{i \leftrightarrow j })\le \frac{1}{4}\) otherwise. Hence, no profitable swap involving an agent from \(T_1\) exists and thus \({\textbf{v}}'\) is a swap-equilibrium assignment.

We now show that \({\textbf{v}}'\) has edge- and vertex-robustness 1. We have already argued above that no swap-equilibrium can be 2-edge-robust or 2-vertex-robust. To show that \({\textbf{v}}'\) is 1-edge-robust (1-vertex-robust), consider deleting an edge \(e \in E(G)\) (a vertex \(v\in V(G)\)). From Proposition 2, we know that deleting an edge between agents of different types cannot make \({\textbf{v}}'\) unstable. Therefore, we only consider edges between agents of the same type.

Still, only the agents on columns \(\frac{x}{2}\) and \(\frac{x}{2}+1\) can have utility less than 1 after the deletion of e (v) and can therefore be candidates for profitable swaps. Let \(v_i\) be incident to e (adjacent to v in G). If \(v_i\) is on the top or bottom of column \(\frac{x}{2}\) (or \(\frac{x}{2}+1\)), then \(u^{G-\{e\}}_i({\textbf{v}}')=u^{G-\{v\}}_i({\textbf{v}}')=\frac{1}{2}\). Otherwise, we have \(u^{G-\{e\}}_i({\textbf{v}}')=u^{G-\{v\}}_i({\textbf{v}}')=\frac{2}{3}\). However, by swapping with some agent j of the other type, agent i can get at most \(u^{G-\{e\}}_i(\mathbf {v'}^{i \leftrightarrow j})=\frac{1}{3}\). Therefore, the swap cannot be profitable and \({\textbf{v}}'\) is 1-edge-robust and 1-vertex-robust and hence has edge- and vertex-robustness 1. \(\square\)

4.2.5 \(\varvec{\alpha }\)-Star-constellation graphs

Lastly, motivated by the observation that on all previously considered graph classes there exist swap-equilibria with zero edge-robustness and on all considered graph classes except cliques there exist swap-equilibria with zero vertex-robustness, we investigate \(\alpha\)-star-constellation graphs, a generalization of stars and \(\alpha\)-caterpillars. Recall that an \(\alpha\)-star-constellation graph consists of stars where the central vertices can be connected by edges such that every central vertex is adjacent to at least \(\alpha\) more degree-one vertices than other central vertices.

We prove that every swap-equilibrium in a Schelling game on an \(\alpha\)-star-constellation graph is \(\alpha\)-vertex-robust and \(\alpha\)-edge-robust. Recall that we have already seen in Sect. 3.3 that swap-equilibria can be characterized and efficiently computed on these graphs.

Theorem 6

In a Schelling game on an \(\alpha\)-star-constellation graph for \(\alpha \in \mathbb {N}_0\), every swap-equilibrium \({\textbf{v}}\) is \(\alpha\)-edge and \(\alpha\)-vertex-robust.

Proof

Let \({\textbf{v}}\) be a swap-equilibrium on an \(\alpha\)-star-constellation graph G for some \(\alpha \in \mathbb {N}_0\). We make a case distinction based on whether or not there exists an agent i on a degree-one vertex adjacent to an agent j of the other type in \({\textbf{v}}\). If this is the case, then assume without loss of generality that \(i\in T_1\) and \(j\in T_2\) and observe that it needs to hold that all agents \(j'\in T_2{\setminus } \{j\}\) are only adjacent to friends, as otherwise \(j'\) and i have a profitable swap. Now consider the topology \(G-S\) for some subset \(S\subseteq E(G)\) or some subset \(S\subseteq V(G)\). Then, for all \(j'\in T_2 {\setminus } \{j\}\), agent \(j'\) cannot be involved in a profitable swap in \(G-S\), as \(j'\) got deleted, is only adjacent to friends, or placed on an isolated vertex. Moreover, there also cannot exist a profitable swap for j, as no agent from \(T_1\) is adjacent to an agent from \(T_2{\setminus } \{j\}\). Hence, \({\textbf{v}}\) is \(\vert E(G)\vert\)-edge-robust and \(\vert V(G)\vert\)-vertex-robust.

Now, assume that all agents on a degree-one vertex are only adjacent to friends in \({\textbf{v}}\) and consider the topology \(G-S\) for \(S \subseteq E(G)\) or \(S \subseteq V(G)\) with \(\vert S\vert \le \alpha\). Note that, in \(G-S\), only agents \(i \in T_1\) and \(j \in T_2\) with \(\deg ^{G}(v_i)>1\) and \(\deg ^{G}(v_j)>1\) and \(\deg ^{G-S}(v_i)\ge 1\) and \(\deg ^{G-S}(v_j)\ge 1\) can be involved in a profitable swap, since all other agents either occupy an isolated vertex or are only adjacent to friends in \(G-S\). For vertex-robustness, it additionally needs to hold that \(v_i,v_j\notin S\). Since G is an \(\alpha\)-star-constellation graph and we delete at most \(\alpha\) edges or \(\alpha\) vertices, it holds that both \(v_i\) and \(v_j\) are adjacent to at least as many degree-one vertices as non-degree-one vertices in \(G-S\). By our assumption, the agents on degree-one vertices adjacent to \(v_i\) are friends of i and the agents on degree-one vertices adjacent to \(v_j\) are friends of j. Hence, swapping i and j cannot be profitable, as \(u_k^{G-S}({\textbf{v}})\ge \nicefrac {1}{2}\) and \(u_k^{G-S}({\textbf{v}}^{i \leftrightarrow j})\le \nicefrac {1}{2}\) for \(k\in \{i,j\}\). \(\square\)

4.2.6 \(\varvec{\alpha }\)-Caterpillars

Recall that we have pointed out in Sect. 3.3 that there is a subclass of \(\alpha\)-star-constellation graphs, namely \(\alpha\)-caterpillars, on which a swap-equilibrium always exists. Let \(w_1,\dots , w_{\ell }\) be the vertices on the central path of the considered \(\alpha\)-caterpillar. Then, to construct an equilibrium \({\textbf{v}}\), we can simply assign for each \(i \in \{1, \dots , \ell \}\) agents from \(T_1\) to \(w_i\) and to adjacent degree-one vertices, until all agents from \(T_1\) have been assigned. It is easy to see that \({\textbf{v}}\) has edge-robustness \(\vert E(G)\vert\) and vertex-robustness \(\vert V(G)\vert\). Notably, this assignment somewhat resembles the swap-equilibrium with edge-robustness \(\vert E(G)\vert\) and vertex-robustness \(\vert V(G)\vert\) on a path from Theorem 4. In contrast, extending the swap-equilibrium with robustness zero on a path from Theorem 4 such that all agents on degree-one vertices are of the same type as their only neighbor, in some Schelling games on \(\alpha\)-caterpillars, it is possible to create a swap-equilibrium with edge- and vertex-robustness only \(\alpha\):

Proposition 5

For a Schelling game on an \(\alpha\)-caterpillar with \(\alpha \in \mathbb {N}_0\), there is a swap-equilibrium with edge-robustness \(\vert E(G)\vert\) and vertex-robustness \(\vert V(G)\vert\). For every \(\alpha \in \mathbb {N}_0\), there is a Schelling game on an \(\alpha\)-caterpillar with a swap-equilibrium with edge-robustness and vertex-robustness \(\alpha\).

Proof

We start with the first part of the proposition. Consider a Schelling game on an \(\alpha\)-caterpillar G with \(w_1,\dots , w_{\ell }\) being the non-degree-one vertices forming a path and \(\{\{w_i,w_{i+1}\} \mid i\in [\ell -1]\}\subseteq E(G)\). It is easy to construct a swap-equilibrium \({\textbf{v}}\) by assigning for each \(i \in \{1, \dots , \ell \}\) agents from \(T_1\) first to \(w_i\) and then to the degree-one vertices adjacent to \(w_i\), until there are no remaining unassigned agents from \(T_1\). In this case the remaining vertices are filled with agents from \(T_2\). By Theorem 3, \({\textbf{v}}\) is a swap-equilibrium (as it satisfies the second condition). Note that in \({\textbf{v}}\) there exists only one agent from \(T_1\), say \(i\in T_1\), who is adjacent to an agent from \(T_2\). Let \(S\subseteq E(G)\) be a subset of edges or a subset of vertices \(S\subseteq V(G)\) of arbitrary size. We now argue that \({\textbf{v}}\) is a swap-equilibrium on \(G-S\). First, note that i is still the only agent from \(T_1\) who is adjacent to an agent from \(T_2\) in \({\textbf{v}}\) on \(G-S\). For all \(i' \in T_1 {\setminus } \{i\}\), we have \(u^{G-S}_{i'}({\textbf{v}})=1\) or \(v_{i'}\) is an isolated vertex. Similarly, for all \(j \in T_2\) with \(v_j \notin N^{G-S}(v_i)\), we also have \(u^{G-S}_{j}({\textbf{v}})=1\) or \(v_{j}\) is an isolated vertex. Hence, only agent \(i \in T_1\) and an agent \(j' \in T_2\) with \(v_{j'} \in N^{G-S}(v_i)\) can have a profitable swap. However, after swapping i and \(j'\), agent \(i \in T_1\) is only adjacent to agents from \(T_2\) and has \(u^{G-S}_i({\textbf{v}}^{i \leftrightarrow j})=0\). Therefore, no profitable swap is possible and \({\textbf{v}}\) has edge-robustness \(\vert E(G)\vert\) and vertex-robustness \(\vert V(G)\vert\).

Let us now come to the second part of the proposition. For \(\alpha \in {\mathbb {N}}_0\) let G be an \(\alpha\)-caterpillar with \(w_1,\dots , w_{4}\) being the non-degree-one vertices forming the central path with \(\{\{w_i,w_{i+1}\}\mid i\in [3]\}\subseteq E(G)\). For \(i\in \{1,4\}\), \(w_i\) is adjacent to \(\alpha +1\) degree-one vertices, and for \(i\in \{2,3\}\), \(w_i\) is adjacent to \(\alpha +2\) degree-one vertices. We consider the Schelling game on G with \(\vert T_1\vert =2\cdot (\alpha +1)\) and \(\vert T_2\vert =2\cdot (\alpha +2)\). Let \({\textbf{v}}\) be the assignment where agents from \(T_1\) occupy the \(2\cdot (\alpha +1)\) vertices from the stars with central vertices \(w_1, w_4\) and the agents from \(T_2\) occupy the \(2\cdot (\alpha +2)\) vertices from the stars with central vertices \(w_2, w_3\). Note that \({\textbf{v}}\) fulfills the first condition from Theorem 3 and is thus a swap-equilibrium which is by Theorem 6\(\alpha\)-vertex-robust and \(\alpha\)-edge-robust. To show that \({\textbf{v}}\) has edge-robustness \(\alpha\) it remains to specify a set of \(\alpha +1\) edges whose deletion make \({\textbf{v}}\) unstable (that is, \({\textbf{v}}\) is not \(\alpha +1\)-edge-robust). Let S be the set of \(\alpha +1\) edges containing all edges between \(w_1\) and its degree-one neighbors. Then, on \(G-S\), swapping agent \(i \in T_1\) on \(w_1\) and agent \(j \in T_2\) on \(w_3\) is profitable, as \(u_i^{G-S}({\textbf{v}})=0<u_i^{G-S}({\textbf{v}}^{i \leftrightarrow j})\) and \(u_j^{G-S}({\textbf{v}})<1=u_j^{G-S}({\textbf{v}}^{i \leftrightarrow j})\). To show that \({\textbf{v}}\) has vertex-robustness \(\alpha\), let S be the set of \(w_1\)’s degree-one neighbors. Then similar as above, on \(G-S\), swapping \(i \in T_1\) on \(w_1\) and agent \(j \in T_2\) on \(w_3\) is profitable. \(\square\)

5 Conclusion

We proved that even in the simple variant of Schelling games where all agents want to maximize the fraction of agents of their type in their occupied neighborhood, deciding the existence of a swap- or jump-equilibrium is NP-complete. Moreover, we introduced a notion for the robustness of an equilibrium under vertex or edge deletions and proved that the robustness of different swap-equilibria on the same topology can vary significantly. In addition, we found that the minimum and the maximum robustness of swap-equilibria vary depending on the underlying topology.

There are multiple possible directions for future research. First, independent of properties of the given graph, in our reduction showing the NP-hardness of deciding the existence of a swap- or jump-equilibrium, we construct a graph that is not planar and has unbounded maximum degree. The same holds for graphs constructed in the reductions from Agarwal et al. [1] for showing NP-hardness in the presence of stubborn agents. Thus, the computational complexity of deciding the existence of equilibria on planar or bounded-degree graphs (properties that typically occur in the real world) in Schelling games with or without stubborn agents is open. Second, Bilò et al. [7] recently introduced the notions of local swap (jump)-equilibria where only adjacent agents are allowed to swap places (agents are only allowed to jump to adjacent vertices). To the best of our knowledge, the computational complexity of deciding the existence of a local swap- or jump-equilibrium is unknown even if we allow for stubborn agents. Third, while we showed that on most considered graphs swap-equilibria can be very non-robust, it might be interesting to search for graphs guaranteeing a higher equilibrium robustness; here, graphs with a high minimum degree and/or high connectivity seem to be candidates. Fourth, besides looking at the robustness of equilibria with respect to the deletion of edges or vertices, one may also study adding or contracting edges or vertices. Fifth, instead of analyzing the robustness of a specific equilibrium, one could also investigate the robustness of a topology regarding the existence of an equilibrium. Lastly, for an equilibrium, it would also be interesting to analyze empirically or theoretically how many reallocations of agents take place on average after a certain change has been performed until an equilibrium is reached again.