1 Introduction

Network Design is a core topic in Theoretical Computer Science and Operations Research. Many classical combinatorial optimization problems, inspired by real world applications, have been formulated and analyzed, such as the Minimum Spanning Tree problem [1], the Network Design problem [2, 3] and finding geometric spanners [4, 5]. Typically, a network having certain properties must be found by a centralized algorithm. However, in many settings, the desired network is not created by a central authority but by individually acting agents, e.g., people or institutions, controlling a local part of the network. Prominent examples are the Internet, road networks, and, most relevant for our work, social networks.

Especially in settings with little coordination, these individual agents tend to selfishly optimize their own utility without taking the impact of their actions on the efficiency of the whole network into account. To better understand the dynamics arising in these decentralized settings and the network structures resulting from them, many influential game-theoretic network formation models have been introduced in the last decades [6,7,8,9,10]. The main research questions are: do equilibrium networks, i.e., stable networks where no agent can improve by performing a local change, exist? What properties do these networks have? And how efficient are they compared to centrally computed optimal solutions?

All of the above mentioned influential game-theoretic network formation models assume that the creation of an edge is costly but the agents benefit from having small distances to other agents in the network. However, departing from this standard assumption in the field, there are real-world settings that should better be modeled via an inverted utility function: neighbors yield benefit but being close to many agents is costly as it yields an increased risk.

One example for this choice are financial networks. There, financial institutions benefit from working together but suffer from risks arising from one of them failing. For example, in inter-bank lending networks, it is beneficial for a bank to lend money to other banks. However, as seen in the last financial crisis,Footnote 1 once a bank defaults, i.e., cannot pay its debts anymore, this failure may spread through the network since other banks relied on these payments and subsequently become insolvent themselves. Given this, a bank that is only indirectly connected to a defauling bank via a longer chain of debt-contracts has more time to prepare for credit defaults, e.g., by lending money from other banks or by insuring against such failures via credit default swaps.

Another example, that is the main motivation of our work, came up with the COVID-19 pandemic and is described by the now commonly used term social distancing. It refers to reducing social contacts in order to contain the spread of a contagious virus in the population. While often mandated by the government, social distancing was performed by many people voluntarily. One of the main reasons is quite simple: while reducing social contacts is a restriction of the quality of life, it also reduces the probability of getting infected. Moreover, once a contagious virus starts spreading in the population, it is beneficial to be far away from the source of infection in order to gain time for taking counter-measures like buying masks or developing vaccines. Hence, the network of social interactions between people was sparsified by individual strategic decisions.

Besides these examples, the inverted utility function model can also be applied to computer viruses spreading in communication networks, e.g., via emails or via the local network, as often observed in the last decade. Also here, a large distance to the outbreak helps for setting-up counter-measures like patching the affected software/systems or by re-configuring firewalls.

In this work we introduce a novel game-theoretic network formation model in which selfish agents strategically form a social network under the influence of social distancing. Agents benefit from direct connections to other agents, modeling the positive effects of social contacts on their social life. However, at the same time they want to maximize their distances to all other agents in the network in order to reduce their risk of getting infected via an increased reaction time in case a contagious disease starts spreading in the network. Here we assume that a random network node becomes infected and that it is beneficial to be far away from the source of infection in order to gain valuable time for setting up counter-measures.

The agents in our model act according to an inverted utility function, compared to the famous models by Jackson and Wolinsky [6] and Fabrikant et al. [8]. Thus, to the best of our knowledge, this is one of the rare cases of a game-theoretic model where both minimizing and maximizing the utility function has a natural interpretation. Another similar well-known example is the contrast between the Network Design Game with fair cost sharing by Anshelevich et al. [9] and the Selfish Routing model by Roughgarden and Tardos [11]. In both models the agents select paths in a given network but in the former sharing an edge is beneficial for the involved agents whereas in the latter edge sharing is detrimental. This difference yields vastly different behavior in terms of the quality of the equilibria. However, this is not obvious, as can also be seen by comparing classical minimization and maximization variants of optimization problems, e.g., Minimum Spanning Tree versus Maximum Spanning Tree or Shortest Path versus Longest Path. Sometimes, as with spanning trees, the inverse problems are almost identical, whereas sometimes, as with the path problems, the inverse problems may have completely opposite behavior. We set out to explore this comparison for the natural inverse counter-part to the well-known Network Creation Game by Fabrikant et al. [8]. Along the way, we will uncover a connection to the Maximum Routing-Cost Spanning Tree problem that is inverse to the well-studied Minimum Routing-Cost Spanning Tree problem [12].Footnote 2

1.1 Model and Notation

Before we start with the model definition, we introduce some notation regarding networks. A network is a tuple \(G{:}{=}(V,E)\) where V is the set of nodes and E is the set of edges. An edge is represented by a set containing both incident nodes. If we do not give the tuple defining G explicitly, we denote the set of nodes of G as \(V_G\) and the set edges of G as \(E_G\). We only consider unweighted undirected networks. For addition and removal of a single edge e, we write \(G+e{:}{=}(V,E\cup \{e\})\) and \(G-e{:}{=}(V,E\setminus \{e\})\). A network \(G'\) with \(V_{G'}\subseteq V\) and \(E_{G'}\subseteq E\) is called a subnetwork of G and denoted as \(G'\le G\). If \(G'\) is connected and \(V_{G'}=V\), \(G'\) is a spanning subnetwork of G. Let \(n\in \mathbb {N}\) denote the number of nodes. The set of all connected networks containing exactly n nodes will be referred to as \(\mathcal {G}_n\).

For two nodes \(v,x\in V\), we define \(d_G(v,x)\) as the distance between v and x in network G, that is, the number of edges on a shortest path from v to x in G. For convenience, we extend the definition of \(d_G\) to sets of nodes: Let \(v\in V\) be a node and \(M,N\subseteq V\) be sets of nodes. Then \(d_G(v,M){:}{=}\sum _{x\in M}d_G(v,x)\) and \(d_G(M,N){:}{=}\sum _{x\in M, y\in N}d_G(x,y)\). We call the special case \(d_G(v,V)\) the distances from/for v and \(d_G(V,V)\) the total/summed distances or routing costs of G. The degree of v in the network G is the number of edges that are incident to v and is denoted as \(\deg _G(v)\). We call a tree which is a spanning subnetwork of G a spanning tree of G. A spanning tree of G with routing costs at least as high as the routing costs of any other spanning tree of G will be called a Maximum Routing-Cost Spanning Tree (MRCST). A spanning tree of G with routing costs that cannot be increased by swapping one edge is a Swap-Maximal Routing-Cost Spanning Tree (SMRCST).

Now, we can define the game-theoretic model. Let \(H=(V,E)\) be a connected network. We call H the host network and its nodes agents. A state of the game \(G\le H\) is a spanning subnetwork of H. We only consider connected networks as host networks and states.

Each agent \(v\in V\) selfishly tries to maximize its utility in state G given by

$$\begin{aligned} u_v(G){:}{=}\alpha \deg _G(v)+d_G(v,V) \end{aligned}$$

where \(\alpha \in \mathbb {R}_{>0}\) is a global parameter. We will call \(\alpha \deg _G(v)\) the edge utility and \(d_G(v,V)\) the distance utility of v. Note that \(\alpha \) is a parameter of the game, i.e., equal for all agents, that allows to adjust the agents’ trade-offs between edge utility and distance utility. Here \(\alpha \) is the benefit of a single edge, i.e., the benefit for each direct neighbor in the network.

For measuring the efficiency of the network G, we use the social welfare defined as

$$\begin{aligned} {{\,\textrm{SW}\,}}(G){:}{=}\sum _{v\in V_G}u_v(G)=2\alpha |E_G|+d_G(V,V). \end{aligned}$$

This quantifies the well-being of the society of all agents. We call a network maximizing the social welfare for the host network H a social optimum and denote it as \({{\,\textrm{OPT}\,}}_H\).

Agents are allowed to form connections bilaterally. More specifically, each agent can unilaterally remove any incident edge if it does not disconnect the network, and two agents together can form an edge between them if it is contained in the host network. If removing an edge strictly increases the utility of one of its incident nodes or adding an edge strictly increases the utility of both incident nodes, we call this an improving move. A network without improving moves is referred to as pairwise stable [6] or stable for short.Footnote 3 If there are no improving edge additions or removals we call the network stable against edge addition and stable against edge removal, respectively.

For a host network H, we define \(\mathcal {S}(H)\) as the set of all pairwise stable states. For measuring the efficiency lost by letting agents form the network selfishly, we use the Price of Anarchy (PoA) [14] and Price of Stability (PoS) [9] defined as

$$\begin{aligned} {{\,\text {PoA}\,}}_n{:}{=}\max _{H\in \mathcal {G}_n}\max _{G\in \mathcal {S}(H)}\frac{{{\,\text {SW}\,}}({{\,\text {OPT}\,}}_H)}{{{\,\text {SW}\,}}(G)} \quad \text {and} \quad {{\,\text {PoS}\,}}_n{:}{=}\max _{H\in \mathcal {G}_n}\min _{G\in \mathcal {S}(H)}\frac{{{\,\text {SW}\,}}({{\,\text {OPT}\,}}_H)}{{{\,\text {SW}\,}}(G)}.\end{aligned}$$

We will call this model Social Distancing Network Creation Game (SDNCG). In Sect. 2 we will restrict the host networks to complete networks \(K_n\). We will call this restricted variant complete Social Distancing Network Creation Game (K-SDNCG).

1.2 Related Work

Variants of game-theoretic network formation models have been studied extensively for decades and we refer to Jackson [15] for an overview.

Closest to our work is the literature on the Network Creation Game (NCG) by Fabrikant et al. [8]. This influential model can be seen as the unilateral inverted variant of the K-SDNCG. There, an agent can buy any incident edge without the consent of the other endpoint for the price of \(\alpha > 0\). Each agent aims at minimizing its cost, which is defined as the sum of \(\alpha \) times the number of bought edges and the sum of hop-distances to all agents. The authors of [8] show that Nash equilibria always exist, i.e., complete networks are stable for \(\alpha \le 2\) and stars are stable for \(\alpha \ge 2\). However, besides these generic examples finding Nash equilibria is challenging since the NCG and many of its variants do not belong to the class of potential games [16, 17]. Besides finding equilibria, also computing a best possible strategy is challenging, since this problem was shown to be NP-hard in [8]. However, such strategies can be efficiently approximated with greedy strategy changes [18]. Regarding the quality of equilibrium states the authors of [8] show that the PoA is in \(\mathcal {O}(\sqrt{\alpha })\), that the PoA for tree Nash equilibria is constant, and that the PoS is at most \(\frac{4}{3}\). Later, a series of papers [19,20,21,22,23,24,25] improved the PoA bounds, with the best general upper bound of \(2^{\mathcal {O}\sqrt{\log n}}\) by Demaine et al. [20]. The latter also proved that the PoA is constant for \(\alpha \in \mathcal {O}(n^{1-\varepsilon })\) for any fixed \(\varepsilon > \frac{1}{\log n}\). For large \(\alpha \), it was shown by Bilò and Lenzner [24] that for \(\alpha > 4n-13\) all Nash equilibria must be trees and this bound was recently improved by Dippel and Vetta [26] to \(\alpha > 3n-3\). This implies a constant PoA for \(\alpha > 3n-3\). Finally, Álvarez and Messegué [25] established a constant PoA for \(\alpha > n(1+\varepsilon )\), for any \(\varepsilon > 0\).

The NCG was generalized by Demaine et al. [27] by introducing a host network that specifies which edges can be bought. They show that the PoA deteriorates by providing a lower bound of \(\Omega (\min \{\alpha /n, n^2/\alpha \})\) and an upper bound of \(\mathcal {O}(\sqrt{\alpha })\), for \(\alpha < n\), and \(\mathcal {O(}\min \{\sqrt{n},n^2/\alpha \})\), for \(\alpha \ge n\). Interestingly, no results on the existence of equilibria are known. Recently, a further generalization that allows weighted host networks was proposed by Bilò et al. [28]. This variant has a tight PoA of \((\alpha +2)/2\) for metric weights. Later a tight bound of \(\Theta (\alpha )\) was shown for arbitrary weights [29]. Also a bilateral variant of the NCG was studied by Corbo and Parkes [13]. There, similar to our model, edges can only be established by bilateral consent of the involved nodes and both nodes have to pay \(\alpha \). The authors of [13] prove existence of pairwise stable networks, i.e., complete networks are stable for \(\alpha \le 1\) and stars are stable for \(\alpha \ge 1\), they give a tight PoA bound of \(\Theta (\min \{\sqrt{\alpha },n/\sqrt{\alpha }\})\), and they show that the PoS is 1. To the best of our knowledge, the bilateral variant with a given host network has not yet been studied. Recently, also a bilateral variant modeling the formation of social networks was introduced [30].

The idea of a game-theoretic model of network formation in a context of spreading risk is not new. Goyal et al. [31] study a setting where a node is attacked and this attack spreads to all vulnerable neighbors. Agents strategically create edges and immunize themselves to maximize their connected component post attack. For this model, also the efficient computation of best strategies [32] and a variant with probabilistic spread [33] was studied. Moreover, there has been much research in the context of financial contagion, where agents benefit from collaborating, but also suffer from the risk of cascading failure arising with the collaboration [34,35,36,37]. In particular, Blume et al. [38] developed an elegant model where nodes form a network and then some randomly chosen nodes fail and this failure then spreads with some probability via the edges. The utility is a linear combination of the node degree and the risk of failing in the second phase. The virtue of this model is that utilities are based on a random process that realistically models the spread of a contagious infection. However, the major downside of this model is that the computation of the random process is #P-complete. Thus, this model does not yield a realistic prediction of real-world behavior.

While analyzing our model for general host networks, we consider Maximum Routing-Cost Spanning Trees. Routing costs have been studied much in mathematics, mostly under the name of the Wiener index [39]. Trees were of special interest and there has been much research on the Wiener index of trees with different properties. But although spanning trees minimizing the Wiener index were studied extensively, the concept of spanning trees maximizing the Wiener index received little attention [40, 41]. However, it was shown that finding or even approximating a tree maximizing the Wiener index is NP-hard [42, 43].

1.3 Our Contribution

We introduce the Social Distancing Network Creation Game (SDNCG), a game-theoretic model in which selfish agents try to maximize their utility by strategically connecting to other agents and thereby creating a network. Each agent values direct connections to other agents but at the same time wants to maximize the distances to all other agents in order to lower their exposure and increase their reaction time to risks appearing in the network. In contrast to the similar model by Blume et al. [38], our model, while not modeling a perfectly realistic spread of the infection, has the advantage of an efficiently computable utility function. By using the distance to the other agents as part of the utility, it also accounts for reaction time: If an infection breaks out far away, an agent has more time to prepare or react to it. Another virtue of our model is that it is the inverse to the well-known Network Creation Game [8] and its bilateral variant [13]. Hence, we can study and compare the game-theoretic properties of the inverted models. To the best of our knowledge, this is one of the rare cases where both the minimization and the maximization of a utility function have a natural interpretation.

Our results and the comparison with the inverted models are summarized in Table 1.

Table 1 An overview of our results (yellow) and a comparison with the results for the inverted models (white)

We analyze two variants of the SDNCG. For the K-SDNCG, where we assume a complete host network, we characterize optimal and several stable networks and show that the PoS is 1. We provide an improving response cycle, which implies that equilibrium existence for the (K-)SDNCG cannot be derived from potential function arguments. Finally, derive several bounds for the PoA which are tight for \(\alpha \ge \frac{n}{2}\), asymptotically tight for \(\alpha \le \sqrt{n}\), and asymptotically tight up to a \(\log \)-factor for \(\alpha \le \frac{n}{6}-3\).

For the SDNCG on arbitrary host networks we utilize Maximum Routing-Cost Spanning Trees for characterizing optimal networks for \(\alpha \le 1\). As our main result, we show that their locally optimal variant, the Swap-Maximal Routing-Cost Spanning Trees, and hence also Maximum Routing-Cost Spanning Trees, are pairwise stable for \(\alpha \le \frac{n}{3}\). We prove that computing the MRCST is NP-hard, while the SMRCST can be constructed efficiently. Thus, for the significant range of \(1\le \alpha \le \frac{n}{3}\), we not only have guaranteed equilibrium existence on any host graph, but we can compute stable states efficiently. This is in stark contrast to what is known for the inverse model studied by Demaine et al. [27]. Additionally, we approximate optimal networks and we derive several (tight) bounds on the PoA and the PoS.

Compared with the NCG [8] and the bilateral NCG [13], we find that the results for the K-SDNCG regarding optimal and stable networks are analogous but reversed, with the spanning path taking over the role of the spanning star. Moreover, our PoA results for both the K-SDNCG and the SDNCG show that our maximization variant has a significantly worse PoA that is linear or almost linear in n, compared to the PoA upper bounds of \(o(n^\varepsilon )\) and \(\mathcal {O}(\sqrt{\alpha },n/\sqrt{\alpha })\) for the NCG and the bilateral NCG, respectively. As main take away from our paper, this implies that under social distancing the agents’ selfish behavior has significantly more impact on the quality of the equilibria. This calls for strong coordination mechanisms governing the network formation to avoid detrimental stable states.

2 Complete Host Networks

We analyze the properties of the K-SDNCG, i.e., the SDNCG on complete host networks. First, we characterize optimal networks and give some examples for stable networks, dependent on the relation between n and \(\alpha \). After that, we show several bounds on the PoA and PoS.

2.1 Stable and Optimal Networks

Intuitively, for small \(\alpha \) the distance utility dominates the social welfare. Hence, the path should be the optimum since it maximizes the total distances. For large \(\alpha \), the edge utility dominates, which leads to the clique being optimal since it maximizes the number of edges. Now we show that this intuition is indeed true. Moreover, the optimal construction is unique.

Theorem 1

For \(\alpha <\frac{n}{3}\), the unique social optimum is the path. For \(\alpha >\frac{n}{3}\), the unique optimum is the clique. For \(\alpha =\frac{n}{3}\), the clique and the path are the only social optima.

Proof

Šoltés and L’ubomír [44] showed that for a fixed number of nodes and edges, the network maximizing the summed distances is unique and contains a clique and a path with at least two edges between one endpoint of the path and the clique. We call this a PathClique. (Note that the clique can be empty, resulting in just a path) For a visualization, we refer to Fig. 1.

Note, that the social optimum has to be such a network, since for every other network, there is a PathClique with the same number of edges but larger summed distances and therefore a larger social welfare.

Let G be a PathClique with n nodes having a clique containing k nodes. Then the corresponding path contains \(n-k\) nodes. First, we show that, unless G is a path or a clique, we get a socially better network by adding or removing edges.

Let G be neither a clique nor a path and let v be the endpoint of the path that is connected to the clique. Observe that removing an edge between v and the clique results in a PathClique. (This is still true if there are only two edges connecting v to the clique: Removing one of these edges makes the remaining neighbor of v in the clique the new endpoint of the path and reduces the size of the clique by 1.) Therefore, this is the socially best way of removing an edge from G. Similarly, the best way of adding an edge to G is adding it between v and the clique unless v is already fully connected to the clique in which case it is best to add an edge between the neighbor of v on the path and the clique. We now make a case distinction.

If v is fully connected to the clique, adding an edge decreases distances by \(2(n-k-1)\) and deleting an edge increases distances by \(2(n-k)\). This means, that G can only be optimal if \(\alpha \le 2(n-k-1)\) and \(\alpha \ge 2(n-k)\), which is a contradiction.

If v is not fully connected to the clique, adding an edge decreases distances by \(2(n-k)\) and deleting an edge increases distances by \(2(n-k)\). Thus, \(\alpha =2(n-k)\) is necessary for G to be socially optimal. But when \(\alpha =2(n-k)\), adding and deleting edges between v and the clique does not change the social welfare. Let \(G'\) be the network obtained by fully connecting v to the clique. Then \({{\,\textrm{SW}\,}}(G)={{\,\textrm{SW}\,}}(G')\). Additionally, \(G'\) cannot be an optimum since it fulfills the conditions of the first case. Therefore, G cannot be socially optimal, too.

So, the social optimum network must be the path \(P_n\) or the clique \(K_n\). We have

$$\begin{aligned} {{\,\textrm{SW}\,}}(P_n)&=2\alpha (n-1)+2\sum _{i=1}^{n-1}i(n-i)=2\alpha (n-1)+\frac{1}{3}(n-1)n(n+1),\\ {{\,\textrm{SW}\,}}(K_n)&=2\alpha \left( {\begin{array}{c}n\\ 2\end{array}}\right) +2\left( {\begin{array}{c}n\\ 2\end{array}}\right) =n(n-1)(\alpha +1). \end{aligned}$$

For \(\alpha =\frac{n}{3}\), we see that

$$\begin{aligned} {{\,\textrm{SW}\,}}(P_n)&=\frac{2}{3}n(n-1)+\frac{1}{3}(n-1)n(n+1)=n(n-1)\left( \frac{n}{3}+1\right) ={{\,\textrm{SW}\,}}(K_n), \end{aligned}$$

for \(\alpha <\frac{n}{3}\) we have \({{\,\textrm{SW}\,}}(P_n)>{{\,\textrm{SW}\,}}(K_n)\), and \(\alpha >\frac{n}{3}\) yields \({{\,\textrm{SW}\,}}(K_n)>{{\,\textrm{SW}\,}}(P_n)\).

\(\square \)

Fig. 1
figure 1

This figure shows a PathClique. It consists of a path (left) and a clique (right), which are connected by at least two edges between one endpoint of the path and some nodes of the clique

Next, we have a look at the existence of pairwise stable networks. Similar to the social optimum, for small \(\alpha \), agents prefer large distances over many incident edges and therefore should remove as many edges as possible, leading to only trees being stable. Interestingly, the restrictions of pairwise stability lead to all trees being stable for small \(\alpha \), even if the distances are very small (like in a star). This is shown by the next theorem.

Theorem 2

(Stable Networks)

  1. 1.

    For \(\alpha \le 1\), every tree is pairwise stable. For \(\alpha <1\), any pairwise stable network is a tree.

  2. 2.

    For \(\alpha \ge 1\), the clique is pairwise stable.

  3. 3.

    For \(\alpha \le \frac{n-1}{2}\), the path is pairwise stable.

  4. 4.

    For \(\alpha >\frac{n}{2}\), the clique is the only pairwise stable network.

Proof of (1)

Let G be a tree. Since removing an edge from G would lead to G being disconnected, we only have to consider adding an edge. This would shorten the distances for both endpoints by at least 1. Since \(\alpha \le 1\), this is not an improvement for the agents.

Let G be a network. If G contains a cycle, we can remove an edge without disconnecting the network. By doing this, the distances for both endpoints increase by at least 1. Since \(\alpha <1\), this is an improvement for both agents. \(\square \)

Proof of (2)

Let G be a clique. Since adding an edge is not possible, we only look at removing an edge. This would result in a distance increase of 1 for both endpoints. Since \(\alpha \ge 1\), this is not an improvement for either of the two incident agents.

Proof of (3)

Let G be the path consisting of n nodes \(v_1,\dots ,v_n\), in that order. Since G is a tree, no edge can be removed without disconnecting the network. Therefore, the only possible move is adding an edge. Let \(1\le i<j\le n\) be such that \(v_i\) and \(v_j\) are not adjacent (i.e., \(j-i\ge 2\)). If \(j\le \frac{n}{2}\), adding the edge \(e{:}{=}\{v_i,v_j\}\) shortens distances from \(v_i\) to at least \(\frac{n}{2}\) nodes. The same holds for \(i\ge \frac{n}{2}\) regarding node \(v_j\). It is easy to see that the distance decrease is minimal when \(j-i=2\). Intuitively, edge e has to be as central as possible. According to this, choosing \(i=\left\lfloor \frac{n}{2}\right\rfloor \) and \(j=i+2\) yields

$$\begin{aligned} d_G(v_i,V)-d_{G+e}(v_i,V)&=n-j+1=n-i-1\ge \frac{n-2}{2}\text { and }\\ d_G(v_j,V)-d_{G+e}(v_j,V)&=i\ge \frac{n-1}{2}. \end{aligned}$$

Thus, if \(\alpha \le \frac{n-1}{2}\), adding edge e is not an improving move and G is pairwise stable. \(\square \)

Proof of (4)

Let V be a set of n agents and \(G=(V,E)\) be a stable network. Let \(v\in V\) be a node having minimum total distances, i.e., for all \(v'\in V\), we have \(d_G(v,V)\le d_G(v',V)\). Let \(N_G[v]\) denote the closed neighborhood of v.

Now suppose, the network induced by \(N_G[v]\) is not a clique. Then there are two neighbors xy of v with \(\{x,y\}\notin E\). We observe that for each node \(z\in V\), the distances \(d_G(v,z)\) and \(d_G(x,z)\) can only differ by 1, since v and x are neighbors. By choice of v, there are at least as many nodes that are closer to v than nodes that are closer to x. Therefore, there are at most \(\frac{n}{2}\) many nodes that are closer to x. Adding an edge between x and y can, for node y, only shorten distances to nodes which are closer to x than to v. Thus, this edge shortens the distances from y by at most \(\frac{n}{2}\). The same holds for node x. Therefore, for \(\alpha >\frac{n}{2}\), this edge would improve the utility of agents x and y and, thus, G would not be stable. This contradicts our assumption. Thus, \(N_G[v]\) must induce a clique.

Now let x be a neighbor of v. Since x is connected to all neighbors of v, we have \(d_G(x,V)\le d_G(v,V)\), i.e., also x minimizes pairwise distances. Hence, \(N_G[x]\) also induces a clique, leading to \(N_G[v]=N_G[x]\). By induction, since G is connected, it must be a clique.

Theorem 2 implies that socially optimal networks are also stable. In fact, they are stable for a wide range of \(\alpha \)-values. The clique is stable for \(\alpha \ge 1\), meeting the bound below which only trees are stable. Similarly, the path is stable for \(\alpha \le \frac{n-1}{2}\), almost meeting the lower bound for only the clique being stable. Additionally, we observe that we only need two networks (path and clique) to provide pairwise stable networks for all possible values of \(\alpha \).

For further constructions, we need the following definition. Let G be a network. We call \(G'\) a clique network of G, if it can be obtained by replacing each node of G by a clique of size at least 2 and for each edge of G connect the two corresponding cliques fully bipartite. By using only constant-size cliques, some properties of G (density, length of shortest paths) are preserved while the network is more stable against edge removal.

Theorem 3

Let G be a clique network. For \(\alpha \ge 1\), G is stable against edge removal.

Proof

Removing any edge from G only effects the distances between its endpoints. These distances increase by 1. \(\square \)

Finally, we show that stable states may not be found by simply letting agents iteratively play improving moves, i.e., via a sequential process of improving strategy changes. Figure 2 provides an example of a cyclic sequence of improving moves. This also implies that both the K-SDNCG and the SDNCG do not belong to the class of potential games [45], i.e., the existence of equilibria cannot be proven via potential function arguments.

Theorem 4

The Social Distancing Network Creation Game is not a potential game.

Proof

This is shown by the existence of improving cycles. See Fig. 2 for an example. \(\square \)

Fig. 2
figure 2

This figure shows a cyclic sequence of improving moves performed by \(n=5\) agents for \(\alpha =2.5\). In each step, the nodes responsible for the next change are highlighted in orange. Note that the last step is isomorphic to the first step (Color figure online)

2.2 Price of Anarchy and Price of Stability

In this section, we give a series of bounds for the Price of Anarchy and the Price of Stability.

Theorem 5

(Price of Anarchy)

  1. 1.

    The Price of Anarchy is in \(\mathcal {O}(n)\).

  2. 2.

    For \(\alpha \le 1\), the Price of Anarchy is in \(\Theta (n)\).

  3. 3.

    For \(1<\alpha \le \sqrt{n}\), the Price of Anarchy is in \(\Theta (n)\).

  4. 4.

    For \(\sqrt{n}\le \alpha \le \frac{n}{6}-3\), the Price of Anarchy is in \(\Omega \left( \frac{n}{\log n}\right) \).

  5. 5.

    For \(\frac{n}{6}-3<\alpha \le \left\lfloor \frac{n}{2}\right\rfloor -2\), the Price of Anarchy is in \(\Omega \left( \sqrt{n}\right) \).

  6. 6.

    For \(\alpha \ge \frac{n}{2}\), the Price of Anarchy is 1.

Proof of (1) Let \(\alpha \in \mathbb {R}_{>0}\). Every connected network has at least \(n-1\in \Omega (n)\) and at most \(\left( {\begin{array}{c}n\\ 2\end{array}}\right) \in {\mathcal {O}}(n^2)\) edges. Furthermore, the summed distances are at least \(n(n-1)\in \Omega (n^2)\), since every node has at least distance 1 to every other node, and at most \(n^3\), since every node has at most distance n to every other node. With this, we get the trivial bound of

$$\begin{aligned} {{\,\textrm{PoA}\,}}_n\in \mathcal {O}\left( \frac{\alpha n^2+n^3}{\alpha n+n^2}\right) =\mathcal {O}(n). \end{aligned}$$

\(\square \)

Proof of (2) For \(\alpha \le 1\), the social optimum is the path as shown in Theorem 1. It has social welfare of

$$\begin{aligned} \alpha (n-1)+\frac{1}{3}(n-1)n(n+1). \end{aligned}$$

Because of Theorem 2 and the star being a tree, it is pairwise stable for \(\alpha \le 1\). It has social welfare of

$$\begin{aligned} \alpha (n-1)+2(n-1)+2(n-1)(n-2)=\alpha (n-1)+2(n-1)^2. \end{aligned}$$

Together with (1), this yields

$$\begin{aligned} {{\,\textrm{PoA}\,}}\ge \frac{\alpha (n-1)+\frac{1}{3}(n-1)n(n+1)}{\alpha (n-1)+2(n-1)^2}=\frac{\alpha +\frac{1}{3}n(n+1)}{\alpha +2(n-1)}\in \Theta (n). \end{aligned}$$

\(\square \)

Proof of (3)

We construct a star-like network with cliques as leaves in the following way. Let \(c{:}{=}\lceil \alpha \rceil +2\). Additionally, let \(K_1,\dots ,K_d\) be \(d{:}{=}\left\lfloor \frac{n-2}{c}\right\rfloor \) cliques containing \(c-2\) nodes and \(v_1,v_1',v_2,v_2',\dots ,v_d,v_d'\) be 2d nodes. Let furthermore M be a clique of size \(n-cd\). We now define our network G as

$$\begin{aligned} V_G&{:}{=}\bigcup _{i=1}^d V_{K_i} \cup \bigcup _{i=1}^d \{v_i,v_i'\}\cup V_M\\ E_G&{:}{=}\bigcup _{i=1}^d E_{K_i}\cup E_M \cup \bigcup _{i=1}^d\{\{v_i,v_i'\}\}\\&\cup \bigcup _{i=1}^d\bigcup _{v\in K_i}\{\{v,v_i\},\{v,v_i'\}\}\cup \bigcup _{i=1}^d\bigcup _{v\in M}\{\{v,v_i\},\{v,v_i'\}\}. \end{aligned}$$

We essentially connect the outer cliques \(K_1,\dots ,K_d\) to the center clique M via d 2-cliques and each connection is fully bipartite (see Fig. 3). Since \(n=|V_G|\), G is a network of the desired size.

We now show that G is pairwise stable. We see that G is a clique network. Because of Theorem 3 and \(\alpha >1\), G is stable against edge removal. On the other hand, adding an edge shortens distances to at least \(|K_i|=c-2\ge \alpha \) nodes which means a distance decrease of at least \(\alpha \) for the two incident nodes. This also does not increase their utility. Therefore, G is pairwise stable.

For the center clique M, we see that \(|V_M|=n-cd=n-c\left\lfloor \frac{n-2}{c}\right\rfloor \) and therefore \(2\le |V_M|< n-(n-2-c)=c+2\). With this and \(1<\alpha \le \sqrt{n}\), we obtain

$$\begin{aligned} |E_G|&=d\left( {\begin{array}{c}c-2\\ 2\end{array}}\right) +\left( {\begin{array}{c}|V_M|\\ 2\end{array}}\right) +2d+d(c-2)2+d|V_M|2\\&=\left\lfloor \frac{n-2}{\lceil \alpha \rceil +2}\right\rfloor \left( \frac{\lceil \alpha \rceil (\lceil \alpha \rceil -1)}{2}+2+2\lceil \alpha \rceil +2|V_M|\right) +\frac{|V_M|(|V_M|-1)}{2}\\&\in \Theta (\alpha n) \end{aligned}$$

and \(d_G(V_G,V_G)\in \Theta (n^2)\).

For \(\alpha <\sqrt{n}\), the socially optimal network is the path. With the previous calculations, we can now bound the Price of Anarchy as

$$\begin{aligned} {{\,\textrm{PoA}\,}}\ge \frac{2\alpha (n-1)+\Theta (n^3)}{2\alpha \Theta (\alpha n)+\Theta (n^2)}=\frac{\Theta (n^3)}{\Theta (n^2)}\in \Omega (n). \end{aligned}$$

From (1), we have \({{\,\textrm{PoA}\,}}\in \mathcal {O}(n)\) and therefore \({{\,\textrm{PoA}\,}}\in \Theta (n)\).

Fig. 3
figure 3

The figure shows a star-like clique network, where the center is formed by a clique M and each ray consists of two nodes \(v_i,v_i'\) and a clique \(K_i\)

Proof of (4) Let \(d=\lfloor \log n\rfloor -1\). Then, the d-dimensional hypercube is represented by \(G_H\) with \(V_{G_H}=\{0,1\}^d\) and \(E_{G_H}=\{\{v,x\}\mid v,x\in V\wedge d_H(v,x)=1\}\) where \(d_H(v,x)\) denotes the Hamming Distance between v and x. Let G be a clique network for \(G_H\) with \(|V_G|=n\) such that the sizes of the cliques replacing the nodes of \(G_H\) differ by at most 1. Observe, that each clique is of size 2 or 3 if \(2\cdot 2^d\le n<3\cdot 2^d\) and of size 3 or 4 if \(3\cdot 2^d\le n<4\cdot 2^d\). By Theorem 3 and since \(\alpha \ge 1\), we know that G is stable against edge removal. We now show that adding an edge shortens the total distances for the incident nodes by at least \(\frac{n}{6}-3\).

Let \(v,x\in V_G\) such that \(e{:}{=}\{v,x\}\notin E_G\) and let \(v',x'\in V_{G_H}\) be the nodes corresponding to the cliques that contain v and x, respectively. Therefore, \(e'{:}{=}\{v',x'\}\notin E_{G_H}\), which implies \(d_H(v',x')\ge 2\). By symmetry of the hypercube, we can assume w.l.o.g. that

$$\begin{aligned} v'=\underbrace{00\dots 0}_{d_H(v,x)}\underbrace{0\dots 00}_{d-d_H(v,x)} \quad \text {and}\quad x'=\underbrace{11\dots 1}_{d_H(v,x)}\underbrace{0\dots 00}_{d-d_H(v,x)}. \end{aligned}$$

Adding \(e'\) to \(G_H\) decreases the distances from \(v'\) to another node \(y'\in V_{G_H}\) if and only if \(d_H(v',y')\ge d_H(x,y)+2\). The difference in distance can only come from the first \(d_H(v',x')\) bits of the label since the remaining bits are equal for \(v'\) and \(x'\). Let \(\ell \) be the number of the first \(d_H(v',x')\) bits of \(y'\) equal to 1. Then, \(d_H(v',x')-\ell \) is the number of the first \(d_H(v',x')\) bits of \(y'\) equal to 0. We obtain \(d_H(v',y')-d_H(x',y')=\ell -(d_H(v',x')-\ell )=2\ell -d_H(v',x')\). Thus, adding \(e'\) to \(G_H\) shortens the distance from \(v'\) to \(y'\) by \(2\ell -d_H(v',x')-1\).

The number of nodes where exactly \(\ell \) of the first \(d_H(v',x')\) bits are equal to 1 is \(\left( {\begin{array}{c}d_H(v',x')\\ \ell \end{array}}\right) \cdot 2^{d-d_H(v',x')}\). Therefore, we get a distance decrease for \(v'\) of

$$\begin{aligned}&d_{G_H}(v',V_{G_H})-d_{G_H+e'}(v',V_{G_H})\\&=\sum _{\ell =\left\lceil \frac{d_H(v',x')}{2}\right\rceil +1}^{d_H(v',x')} \left( {\begin{array}{c}d_H(v',x')\\ l\end{array}}\right) \cdot 2^{d-d_H(v',x')}\cdot (2\ell -d_H(v',x')-1)\\&=2^{d-d_H(v',x')}\sum _{\ell =0}^{\left\lfloor \frac{d_H(v',x')}{2}\right\rfloor -1} \left( {\begin{array}{c}d_H(v',x')\\ \ell \end{array}}\right) \cdot (d_H(v',x')-2\ell -1)\\&\ge 2^{d-d_H(v',x')}\sum _{\ell =0}^{\left\lfloor \frac{d_H(v',x')}{2}\right\rfloor -1} \left( {\begin{array}{c}d_H(v',x')\\ \ell \end{array}}\right) \\&\ge 2^{d-d_H(v',x')}\frac{1}{2}\left( \sum _{\ell =0}^{d_H(v',x')}\left( {\begin{array}{c}d_H(v',x')\\ \ell \end{array}}\right) -\left( {\begin{array}{c}d_H(v',x')\\ \left\lfloor \frac{d_H(v',x')}{2}\right\rfloor \end{array}}\right) \right) \\&=2^{d-d_H(v',x')}\frac{1}{2}\left( 2^{d_H(v',x')}-\left( {\begin{array}{c}d_H(v',x')\\ \left\lfloor \frac{d_H(v',x')}{2}\right\rfloor \end{array}}\right) \right) \\&\ge 2^{d-d_H(v',x')}\frac{1}{2}2^{d_H(v',x')-1}\\&=\frac{2^d}{4}. \end{aligned}$$

Observe that the distances from v to all nodes in other cliques in G are exactly the same as the distances from \(v'\) to all other nodes in \(G_H\). The same holds for \(G+e\) and \(G_H+e'\), with the exception of the distances from v to the (at most 3) nodes in the same clique as x. We distinguish two cases:

If \(2\cdot 2^d\le n<3\cdot 2^d\), each clique consists of 2 or 3 nodes. Therefore, we have a distance decrease of at least

$$\begin{aligned} d_G(v,V_{G})-d_{G+e}(v,V_{G})&\ge 2 (d_{G_H}(v',V_{G_H})-d_{G_H+e'}(v',V_{G_H})) -3\\&\ge \frac{2^d}{2}-3\\&\ge \frac{n}{6}-3. \end{aligned}$$

If \(3\cdot 2^d\le n<4\cdot 2^d\), each clique consists of 3 or 4 nodes. This means, we have a distance decrease of at least

$$\begin{aligned} d_G(v,V_{G})-d_{G+e}(v,V_{G})&\ge 3 (d_{G_H}(v',V_{G_H})-d_{G_H+e'}(v',V_{G_H})) -3\\&\ge 3\frac{2^d}{4}-3\\&\ge \frac{n}{6}-3. \end{aligned}$$

Thus, edge additions are not beneficial for the incident agents if \(\alpha \le \frac{n}{6}-3\) and we conclude that the constructed network is stable for \(1\le \alpha \le \frac{n}{6}-3\). We also see that the number of edges m is in \(\Theta (n\log n)\) and the distance \(d(V_G,V_G)\) is in \(\Theta (n^2\log n)\). Since the social optimum for \(1\le \alpha \le \frac{n}{6}-3\) is the path \(P_n\), we get for the Price of Anarchy:

$$\begin{aligned} {{\,\textrm{PoA}\,}}_n\ge \frac{SW(P_n)}{SW(G)}=\frac{\alpha (n-1)+\Theta (n^3)}{\alpha \Theta (n\log n)+\Theta (n^2\log n)}\in \Omega \left( \frac{n}{\log n}\right) . \end{aligned}$$

\(\square \)

Proof of (5) We construct a path of cliques in the following way. Let \(2\le d\le \frac{n-6}{2}\) be some even number and \(c=\left\lfloor \frac{n-6}{d}\right\rfloor \). Furthermore, let \(K_1,\dots ,K_d\) be d cliques consisting of c or \(c+1\) nodes, such that \(\sum _{i=1}^d |V_{K_i}|=n-6\) and \(\sum _{i=1}^{\frac{d}{2}}|V_{K_i}|=\left\lceil \frac{n-6}{2}\right\rceil \) and \(\sum _{i=\frac{d}{2}+1}^{d}|V_{K_i}|=\left\lfloor \frac{n-6}{2}\right\rfloor \), and \(v_1,v_1',v_2,v_2',v_3,v_3'\) be 6 more nodes. We now define the network G as

$$\begin{aligned} V_G&{:}{=}\bigcup _{i=1}^d V_{K_i} \cup \{v_1,v_1',v_2,v_2',v_3,v_3'\},\\ E_G&{:}{=}\bigcup _{i=1}^d E_{K_i}\cup \bigcup _{i=1}^{\frac{d}{2}-1}\{\{v,x\}\mid v\in K_i\wedge x\in K_{i+1}\}\cup \bigcup _{v\in K_\frac{d}{2}}\{\{v,v_1\},\{v,v_1'\}\}\\&\cup \bigcup _{i=\frac{d}{2}+1}^{d-1}\{\{v,x\}\mid v\in K_i\wedge x\in K_{i+1}\}\cup \bigcup _{v\in K_{\frac{d}{2}+1}}\{\{v,v_3\},\{v,v_3'\}\}\\ \quad&\cup \{\{v_1,v_1'\},\{v_2,v_2'\},\{v_3,v_3'\}\}\cup \{\{v,x\}\mid v\in \{v_2,v_2'\}\wedge x\in \{v_1,v_1',v_3,v_3'\}\}. \end{aligned}$$

Figure 4 shows a sketch of G.

Fig. 4
figure 4

The figure shows clique network for a path consisting of d cliques \(K_1,\dots ,K_d\) highlighted in yellow with 6 additional nodes in the middle. Note, that edges inside the cliques are not shown in this figure

We observe that G is stable against edge removal because of Theorem 3, since \(\alpha >\frac{n}{6}-3\ge 1\) and G being a clique network for the path. We now show that adding an edge is also not an improving move.

We quickly see that, for a node v, adding an edge into the 2-neighborhood always shortens distances the least. We therefore only have to consider these edges. We observe that adding an edge between \(v_1\) and \(v_3\) (or because of symmetry, \(v_1'\) or \(v_3'\)) decreases distances from \(v_1\) to \(v_3\) and all nodes in \(K_{\frac{d}{2}+1},\dots ,K_d\) and decreases distances from \(v_3\) to \(v_1\) and all nodes in \(K_1,\dots ,K_\frac{d}{2}\) by exactly 1. This means, we get

$$\begin{aligned} d_G(v_1,V)-d_{G+\{v_1,v_3\}}(v_1,V)&=1+\sum _{i=\frac{d}{2}+1}^d |V_{K_i}|=\left\lfloor \frac{n}{2}\right\rfloor -2\quad \text {and}\\ d_G(v_3,V)-d_{G+\{v_1,v_3\}}(v_3,V)&=1+\sum _{i=1}^{\frac{d}{2}} |V_{K_i}|=\left\lceil \frac{n}{2}\right\rceil -2. \end{aligned}$$

Every other edge we could add decreases distances to all the cliques of one side of the path, resulting in larger distance decreases. This means that adding an edge is not an improving move for \(\alpha \le \left\lfloor \frac{n}{2}\right\rfloor -2\). Therefore, G is pairwise stable for the desired values of \(\alpha \).

We now evaluate the number of edges. We have \(|E_{K_i}|\in \Theta (c^2)\). The number of edges between two neighboring cliques is also in \(\Theta (c^2)\). This means that the total number of edges is \(|E_G|\in \Theta (dc^2)\). We also see that the diameter of G is d and therefore \(d_G(V,V)\in \mathcal {O}(dn^2)\). If we choose \(d=2\left\lfloor \frac{\sqrt{n}}{2}\right\rfloor \), we have \(d\in \Theta (\sqrt{n})\) and \(c\in \Theta (\sqrt{n})\). Since \(\alpha \in \Theta (n)\), we get for the Price of Anarchy

$$\begin{aligned} {{\,\textrm{PoA}\,}}_n\ge \frac{\alpha (n-1)+\Theta (n^3)}{\alpha \Theta (dc^2)+\mathcal {O}(dn^2)}\in \Omega \left( \frac{n^3}{n^\frac{5}{2}+n^\frac{5}{2}}\right) =\Omega \left( \sqrt{n}\right) . \end{aligned}$$

\(\square \)

Proof of (6)

This follows directly from the clique being socially optimal (see Theorem 1) and the only pairwise stable network (see Theorem 2). \(\square \)

We have established that the Price of Anarchy is relatively high for \(\alpha \le \frac{n}{2}\). It even meets the trivial upper bound of \(\mathcal {O}(n)\) for a large range of \(\alpha \). In contrast to the high \({{\,\textrm{PoA}\,}}\) values, we observe that the Price of Stability is independent of \(\alpha \) and best possible.

Theorem 6

The Price of Stability is 1.

Proof

This follows directly from the path being stable and socially optimal for \(\alpha \le \frac{n}{3}\) and the clique being stable and socially optimal for \(\alpha \ge \frac{n}{3}\) (see Theorem 1 and Theorem 2). \(\square \)

From an efficiency point-of-view, the huge gap between the PoA and the PoS suggests that having an outside force assigning an initial strategy to all players is beneficial. That way, stability and optimal social welfare can be guaranteed. Without such coordination, the players could end up in socially bad equilibria or in a cyclic sequence of improving moves.

3 General Host Networks

We now analyze the SDNCG on arbitrary connected but not necessarily complete host networks. First, we analyze socially optimal networks and then we investigate the existence of pairwise stable networks. We prove our main result that establishes equilibrium existence on any connected host network for a wide parameter range of \(\alpha \). Finally, we derive bounds on the Price of Anarchy and the Price of Stability. Additionally, we show that computing the social optimum and the Maximum Routing-Cost Spanning Tree is NP-hard while computing a Swap-Maximal Routing-Cost Spanning Tree can be done in polynomial time.

3.1 Stable and Optimal Networks

While for the K-SDNCG, we only have two possible social optima (dependent on \(\alpha \)), this gets more complicated for general host networks. Of course, if they exist on general host networks, then the optima for the K-SDNCG are still the most efficient networks. Intuitively, if the host network does not contain a Hamilton path, then the social optimum should be a tree if \(\alpha \) is small enough. Since all trees have the same number of edges, the social welfare of a tree is only influenced by the total distances. Remember that the spanning tree maximizing the total distances is by definition the Maximum Routing-Cost Spanning Tree (MRCST). We now show, that this intuition is indeed correct.

Theorem 7

(Social Optimum) Let H be a connected host network containing n nodes.

  1. 1.

    If H contains a Hamilton path, then this path is the social optimum for \(\alpha \le \frac{n}{3}\). The Hamilton path is the unique social optimum if \(\alpha <\frac{n}{3}\).

  2. 2.

    For \(\alpha \le 1\), the MRCST of H is socially optimal.

  3. 3.

    For \(\alpha >\frac{1}{24}(n-2)n(n+2)\), H itself is the unique social optimum.

Proof of (1)

This follows directly from Theorem 1. \(\square \)

Proof of (2)

Let \(T_{opt}\) be the MRCST of H and G some state of H, that is, a spanning subnetwork of H. Furthermore, let T be a spanning tree of G. Then \({{\,\textrm{SW}\,}}(G)\le {{\,\textrm{SW}\,}}(T)\), since we can construct G by adding edges to T and for every edge added, the social welfare goes up by \(\alpha \le 1\) and down by at least 1, because of distances decreasing. Since \(T_{opt}\) maximizes the total distances, we have \({{\,\textrm{SW}\,}}(T)\le {{\,\textrm{SW}\,}}(T_{opt})\) and therefore \({{\,\textrm{SW}\,}}(G)\le {{\,\textrm{SW}\,}}(T_{opt})\).

Proof of (3)

We show that any edge added to any network shortens the total distances by at most \(\frac{1}{24}(n-1)n(n+1)\). It is easy to see that adding an edge between the two endpoints of a Hamilton path maximizes the distance decrease. This means, if \(\alpha \) is larger than that, it is always socially better to add more edges to the network, resulting in H itself to be optimal.

We already know the social welfare of a Hamilton path \(P_n\) from Sect. 2. After adding an edge between the two endpoints of \(P_n\), we get a cycle \(C_n\). In this cycle, we see that for each node there are exactly two nodes for every possible distance \(1\le d<\frac{n}{2}\) and an additional node at distance \(\frac{n}{2}\), if n is even. This yields

$$\begin{aligned} {{\,\textrm{SW}\,}}(P_n)&=2\alpha (n-1)+\frac{1}{3}(n-1)n(n+1),\\ {{\,\textrm{SW}\,}}(C_n)&=2\alpha n+n\sum _{i=1}^{\frac{n-1}{2}}2i=2\alpha n+\frac{1}{4}(n-1)n(n+1){} & {} \text {for }n\text { odd},\\ {{\,\textrm{SW}\,}}(C_n)&=2\alpha n+n\left( \sum _{i=1}^{\frac{n}{2}-1}2i+\frac{n}{2}\right) =2\alpha n+\frac{1}{4}(n-2)n^2+\frac{n^2}{2}{} & {} \text {for }n\text { even}. \end{aligned}$$

We then have \({{\,\textrm{SW}\,}}(C_n)>{{\,\textrm{SW}\,}}(P_n)\) if and only if

$$\begin{aligned} \alpha&>\frac{1}{24}(n-1)n(n+1){} & {} \text {for }n\text { odd,}\\ \alpha&>\frac{1}{24}(n-2)n(n+2)>\frac{1}{24}(n-1)n(n+1){} & {} \text {for }n\text { even.} \end{aligned}$$

This shows the claim. \(\square \)

Contrasting statement (3) from Theorem 7, we observe that for \(\alpha <\frac{1}{24}(n-2)n(n+2)\), the host network is not necessarily the social optimum. Consider the host network \(H{:}{=}C_n\) for even n, i.e., an even cycle with n nodes. In the proof of (3), we see that \({{\,\textrm{SW}\,}}(P_n)>{{\,\textrm{SW}\,}}(C_n)\), implying that \(C_n\) cannot be the social optimum. In fact, in this example, \(P_n\) is the optimum since there are only two possible states (up to isomorphism): \(P_n\) and \(C_n\) itself. This is in stark contrast to the K-SDNCG, where the host network is optimal for \(\alpha \ge \frac{n}{3}\).

Since finding a MRCST is NP-hard [42], finding the social optimum for a given host network must also be NP-hard.

Theorem 8

(Computational Hardness) Computing the social optimum for a connected host network H is NP-hard.

Proof

This follows directly from the MRCST being hard to compute [42] and the unique social optimum for \(\alpha <1\) (see Theorem 7). \(\square \)

Next, we discuss stable networks. In contrast to the K-SDCNG, it is not obvious that pairwise stable networks are guaranteed to exist for any connected host network. However, we can directly transfer the result that spanning trees are stable for small \(\alpha \). For large \(\alpha \), similar to the clique being the unique stable network for \(\alpha >\frac{n}{2}\) for complete host networks, as shown in Theorem 2, we show that the whole host network is pairwise stable. However, in contrast to the K-SDNCG, this is true only for much larger values of \(\alpha \).

Theorem 9

(Stable Networks) Let H be a connected host network containing n nodes.

  1. 1.

    For \(\alpha \le 1\), every spanning tree of H is pairwise stable. For \(\alpha <1\), spanning trees are the only pairwise stable networks.

  2. 2.

    For \(\alpha >\frac{1}{4}(n-1)^2\), H is the only pairwise stable network.

Proof of (1)

The proof is exactly the same as for (1) of Theorem 2. \(\square \)

Proof of (2)

Consider a network G on a host network \(H=(V,E_H)\). The largest distance decrease a node \(v\in V\) can suffer when forming an edge \(e\in E_H\) is when G is a path and v one of its endpoints connecting to the other endpoint \(x\in V\). This move decreases the distances by

$$\begin{aligned} \Delta d{:}{=}{}&d_{G}(v,V)-d_{G+e}(v,V)=d_G(x,V)-d_{G+e}(x,V)\\ ={}&\sum _{i=1}^{\frac{n-1}{2}}(n-2i)=\frac{1}{4}(n-1)^2{} & {} \text {for } n \text { odd,}\\ \Delta d={}&\sum _{i=1}^{\frac{n}{2}-1}(n-2i)=\frac{1}{4}(n-2)n<\frac{1}{4}(n-1)^2{} & {} \text {for }n\text { even.} \end{aligned}$$

Thus, since \(\alpha >\frac{1}{4}(n-1)^2\), forming edges is always beneficial for the incident nodes. Similarly, edge removal always decreases the utility of the incident nodes. Therefore, the host network H is the only pairwise stable network. \(\square \)

Contrasting statement (2) of Theorem 9, using \(H{:}{=}C_n\) for odd n and \(\alpha <\frac{1}{4}(n-1)^2\) shows that the host network is not necessarily pairwise stable. This example also shows that the optimum is not necessarily stable: For \(\alpha \ge \frac{1}{4}(n-1)^2\) and \(H{:}{=}C_n\) as the host network, \(C_n\) is the only pairwise stable network but it is not the optimum for \(\alpha <\frac{1}{24}(n-2)n(n+2)\). This is another significant difference to the K-SDNCG.

Now that we characterized stable networks for extreme \(\alpha \)-values, the question remains whether stable states also exist for in-between values. For the K-SDNCG, the path is stable up to \(\alpha <\frac{n-1}{2}\). This is, of course, still true for non-complete host networks if they contain a Hamilton path. Since a Hamilton path (if it exists) is the MRCST, it is natural to suspect that the MRCST properties at least partially ensure stability for some \(\alpha \ge 1\). However, even if true, the MRCST is still NP-hard to compute. Hence, in quest of an efficiently computable stable network, we introduce a less strict variant of MRCSTs which is only locally optimal: Swap-Maximal Routing-Cost Spanning Trees. Remember, a SMRCST is a spanning tree whose summed distances cannot be increased by removing one edge and adding another edge.

As our main result, we now show that SMRCSTs (and therefore MRCSTs, too) are indeed stable beyond \(\alpha \le 1\). Note, that for the inverse model of the NCG on an arbitrary host network [27], so far no equilibrium existence statement is known.

Theorem 10

Let H be a connected host network containing n nodes. Then for \(\alpha \le \frac{n}{3}\), any Swap-Maximal Routing-Cost Spanning Tree is pairwise stable.

Proof

Let G with \(V_G=V_H\) and \(E_G\subseteq E_H\) be a SMRCST. Since G is a tree, we only have to consider edge additions. We show that adding any edge decreases the summed distances for at least one of the edges endpoints by at least \(\frac{n}{3}\). This is sufficient to show the claim.

Let \(e_1\in E_H\setminus E_G\) be an edge not part of the SMRCST. Adding \(e_1\) would form a cycle of length \(d\in \mathbb {N}\) consisting of nodes \(v_1,\dots , v_d\in V\) with \(v_1\) and \(v_d\) being the nodes incident to \(e_1\). Let \(E_C\) be the set of all edges on this cycle. Removing all edges in \(E_C\) from G would create d trees rooted in \(v_1,\dots ,v_d\) respectively. Let furthermore \(x_1,\dots ,x_d\) be the number of nodes in each of the d trees. See Fig. 5 for an illustration.

Since G is a tree, there is exactly one path between each pair of nodes (which is also the shortest). For each edge \(e\in E_G\), we define \(d_G(e)\) as the number of paths between two nodes in G which include e. We then can express the total distances as

$$\begin{aligned} d_G(V,V)=2\sum _{e\in E_G}d_G(e). \end{aligned}$$

Note, that each path between two nodes contributes twice to the total distances (one for each node), which leads to the factor of 2.

Let \(x{:}{=}(x_1,\dots ,x_d)\). We now define for each edge \(e\in E_C\) on the cycle

$$\begin{aligned} c_e(x){:}{=}\sum _{e'\in E_C}d_{G+e_1-e}(e')=\sum _{i=1}^{d-1}\sum _{j=i+1}^d x_i x_j d_{G+e_1-e}(v_i,v_j). \end{aligned}$$

This is the contribution of all the edges on the cycle to the total distances if we add \(e_1\) to it and instead remove e from it. Note that \(c_{e_1}\) is the value for the original network since \(G+e_1-e_1=G\). We see that \(c_e\) does not depent on the structure of the subtrees rooted in the \(v_i\) but only on the number of nodes in each subtree. Since the number of paths going over an edge that is not on the cycle does not change when we add \(e_1\) and remove e, we have

$$\begin{aligned}&d_G(V,V)-d_{G+e-e_1}(V,V)\\&=2\sum _{e'\in E}(d_G(e')-d_{G+e-e_1}(e'))\\&=2\sum _{e'\in E_C}(d_G(e')-d_{G+e-e_1}(e'))+2\sum _{e'\in E_G\setminus E_C}(d_G(e')-d_{G+e-e_1}(e'))\\&=2c_{e_1}(x)-2c_e(x). \end{aligned}$$

We know that G is a SMRCST of H. This means that \(d_G(V,V)\ge d_{G'}(V,V)\) for any other spanning tree \(G'\) which can be obtained from G by a swap of one edge. We therefore also have

$$\begin{aligned} \forall e\in E_C:c_{e_1}(x)\ge c_e(x). \end{aligned}$$
(1)

Now, we use the previous observations to formulate and solve a minimization problem which yields the desired bound. We start with some definitions.

We call \(x=(x_1,\dots ,x_d)\in \mathbb {N}^d\) with \(x_i\ge 1\) and \(\sum _{i=1}^d x_i=n\) a node distribution. For each edge \(e\in E_C\), we call \(c_e(x)\) (defined above) the cost of e. And lastly, we define the distance decrease \(\Delta d\) as

$$\begin{aligned} \Delta d(x){:}{=}\max \left\{ \sum _{i=1}^{\left\lfloor \frac{d-1}{2}\right\rfloor }(d-2i)x_i,\sum _{i=1}^{\left\lfloor \frac{d-1}{2}\right\rfloor }(d-2i)x_{d-i+1}\right\} . \end{aligned}$$
(2)

The goal then is: Find a node distribution x that fulfills 1 and minimizes \(\Delta d(x)\). Observe that this indeed yields a lower bound for the distance decrease when adding e to G. If we show that this is at least \(\frac{n}{3}\), we proved the statement.

Let \(x=(x_1,\dots ,x_d)\in \mathbb {N}^d\) be a node distribution minimizing \(\Delta d(x)\). We first show the claim for \(d=3\) and \(d=4\).

For \(d=3\), we have \(x_2\le x_1\) and \(x_2\le x_3\) from 1 and \(\Delta d(x)=\max \{x_1,x_3\}\). Since \(x_1+x_2+x_3=n\), this yields \(\Delta d(x)\ge \frac{n}{3}\).

For \(d=4\), we have \(c_{e_1}(x)-c_{\{x_1,x_2\}}(x)=2x_1x_4-2x_1x_2\), and therefore \(c_{e_1}\ge c_{\{x_1,x_2\}}\) if and only if \(x_4\ge x_2\). Similarly, we get \(x_1\ge x_3\) from \(\{x_3,x_4\}\). Together with \(x_1+x_2+x_3+x_4=n\), we see that \(\max \{x_1,x_4\}\ge \frac{n}{4}\). We conclude that \(\Delta d(x)=2\max \{x_1,x_4\}\ge \frac{n}{2}>\frac{n}{3}\).

For \(d>4\), we make a case distinction between d being odd and d being even and simplify the problem by doing several relaxation steps. For \(d\le 4\), it is easy to show that \(\Delta d(x)\ge \frac{n}{3}\). For further steps, we allow \(x\in \mathbb {R}_{\ge 1}^d\). Note, that this only allows for smaller minima and therefore still yields a lower bound for the original problem.

The high level idea of the following steps is that we can redistribute weights of the node distribution x without changing \(\Delta (x)\) or violating 1 and thereby reducing the number of variables contained in x by setting most \(x_i\) to 1. We now make a case distinction.

Case d odd: Let \(m=\frac{d+1}{2}\) and \(e_2{:}{=}\{v_{m-1},v_m\}\) and \(e_3{:}{=}\{v_m,v_{m+1}\}\). Thus, \(v_m\) is the node equidistant from \(v_1\) and \(v_d\) in C and \(e_2\) and \(e_3\) are the edges on C incident to \(v_m\). (see Fig. 5 (middle)) We will only consider the two constraints

$$\begin{aligned} c_{e_1}(x)\ge c_{e_2}(x)\quad \text {and}\quad c_{e_1}(x)\ge c_{e_3}(x), \end{aligned}$$
(3)

where

$$\begin{aligned} c_{e_1}(x)&=\sum _{i=1}^{d-1}\sum _{j=i+1}^d (j-i) x_i x_j,\\ c_{e_2}(x)&=\sum _{i=1}^{m-2}\sum _{j=i+1}^{m-1}(j-i)x_i x_j + \sum _{i=m}^{d-1}\sum _{j=i+1}^d (j-i)x_i x_j + \sum _{i=1}^{m-1}\sum _{j=m}^d (i+d-j)x_i x_j,\\ c_{e_3}(x)&=\sum _{i=1}^{m-1}\sum _{j=i+1}^{m}(j-i)x_i x_j + {\sum _{i=m+1}^{d-1}}\sum _{j=i+1}^d (j-i)x_i x_j + \sum _{i=1}^{m}\sum _{j=m+1}^d (i+d-j)x_i x_j. \end{aligned}$$

This still yields a lower bound for the original problem since the constraints from 3 are a subset of the constraints from 1.

We observe that the claim is trivially true for \(\frac{n}{3}\le \frac{d+3}{2}\) since \(\Delta d(x)\ge \frac{d+3}{2}\) (tight for \(n=5\), \(d=5\), \(x=(1,1,1,1,1)\)). This means, we can assume

$$\begin{aligned} n>\frac{3(d+3)}{2}, \quad \text {or rather}\quad n>3(m+1). \end{aligned}$$
(4)

In the following, we perform a series of relaxations. For that, we define the node distributions \(x^{(1)},x^{(2)},x^{(3)}\) such that for all \(1\le i\le d\)

$$\begin{aligned} x^{(1)}_i&{:}{=}{\left\{ \begin{array}{ll} x_1 + \sum _{p=2}^{m-2}\frac{m-1-p}{m-2}(x_p-1)&{}\text {if }i=1,\\ x_{m-1}+\sum _{p=2}^{m-2}\frac{p-1}{m-2}(x_p-1)&{}\text {if }i={m-1},\\ x_m&{}\text {if }i=m,\\ x_{m+1}+\sum _{p=m+2}^{d-1}\frac{d-p}{m-2}(x_p-1)&{}\text {if }i=m+1,\\ x_d + \sum _{p=m+2}^{d-1}\frac{p-m-1}{m-2}(x_p-1)&{}\text {if }i=d,\\ 1&{}\text {else,} \end{array}\right. }\\&\qquad \text {(Without loss of generality, we assume } x^{(1)}_1\ge x^{(1)}_d\\&\qquad \text {and } (2m-3)x^{(1)}_1+x^{(1)}_{m-1}=(2m-3)x^{(1)}_d+x^{(1)}_{m+1}.)\\ x^{(2)}_i&{:}{=}{\left\{ \begin{array}{ll} x^{(1)}_1&{}\text {if }i=1\text { or } i=d,\\ x^{(1)}_{m-1}&{}\text {if }i=m-1\text { or } i=m+1,\\ x^{(1)}_m+(2m-4)\left( x^{(1)}_1-x^{(1)}_d\right) &{}\text {if }i=m,\\ 1&{}\text {else,} \end{array}\right. }\\ x^{(3)}_i&{:}{=}{\left\{ \begin{array}{ll} x^{(2)}_{m}+2\frac{2m-4}{2m-3}\left( x^{(2)}_{m-1}-1\right) &{}\text {if } i=m,\\ x^{(2)}_1+\frac{1}{2m-3}\left( x^{(2)}_{m-1}-1\right) &{}\text {if } i=1 \text { or } i=d,\\ 1&{}\text {else}. \end{array}\right. }. \end{aligned}$$

It is easy to see that \(\Delta d(x)=\Delta d\left( x^{(1)}\right) =\Delta d\left( x^{(2)}\right) =\Delta d\left( x^{(3)}\right) \). We show that \(c_{e_1}\left( x^{(i)}\right) \ge c_{e_2}\left( x^{(i)}\right) \) and \(c_{e_1}\left( x^{(i)}\right) \ge c_{e_3}\left( x^{(i)}\right) \) for \(1\le i\le 3\). This means, \(x^{(3)}\) is also a solution of the minimization problem.

First, we show this for \(x^{(1)}\). Let \(1<p<m-1\). Consider \(x^*\), a modification of x where the weight of \(x_p\) is distributed among \(x_1\) and \(x_{m-1}\) as follows:

$$\begin{aligned} \forall 1\le i\le d:x^*_i = {\left\{ \begin{array}{ll} x_1 + \frac{m-1-p}{m-2}(x_p-1)&{}\text {if }i=1,\\ 1&{}\text {if }i=p,\\ x_{m-1}+\frac{p-1}{m-2}(x_p-1)&{}\text {if }i={m-1},\\ x_i&{}\text {else.} \end{array}\right. } \end{aligned}$$

To show that \(x^*\) also fulfills (3), we show that \(c_{e_2}(x)-c_{e_1}(x)=c_{e_2}(x^*)-c_{e_1}(x^*)\) and \(c_{e_3}(x)-c_{e_1}(x)=c_{e_3}(x^*)-c_{e_1}(x^*)\). We have

$$\begin{aligned} c_{e_2}(x)-c_{e_1}(x)=\sum _{i=1}^{m-1}\sum _{j=m}^d (i+d-j-(j-i))x_i x_j=\sum _{i=1}^{m-1}\sum _{j=m}^d (2i+d-2j)x_i x_j \end{aligned}$$

and

$$\begin{aligned}&c_{e_2}(x^*)-c_{e_1}(x^*)\\ ={}&\sum _{i=1}^{m-1}\sum _{j=m}^d (2i+d-2j)x^*_i x^*_j\\ ={}&\sum _{i=1}^{m-1}\sum _{j=m}^d (2i+d-2j)x_i x_j+\frac{m-1-p}{m-2}(x_p-1)\sum _{j=m}^d(2+d-2j)x_j\\&-(x_p-1)\sum _{j=m}^d(2p+d-2j)x_j+\frac{p-1}{m-2}(x_p-1)\sum _{j=m}^d(2(m-1)+d-2j)x_j\\ =&\sum _{i=1}^{m-1}\sum _{j=m}^d (2i+d-2j)x_i x_j+\frac{m-1-p}{m-2}(x_p-1)(d-m+1)2\\&-(x_p-1)(d-m+1)2p+\frac{p-1}{m-2}(x_p-1)(d-m+1)2(m-1)\\ ={}&\sum _{i=1}^{m-1}\sum _{j=m}^d (2i+d-2j)x_i x_j\\&+(x_p-1)(d-m+1)(-2p+\frac{2}{m-2}((m-1-p) + (p-1)(m-1)))\\ ={}&\sum _{i=1}^{m-1}\sum _{j=m}^d (2i+d-2j)x_i x_j+(x_p-1)(d-m+1)\left( -2p+\frac{2}{m-2}(m-2)p\right) \\ ={}&c_{e_2}(x)-c_{e_1}(x). \end{aligned}$$

The calculations for \(c_{e_3}(x)-c_{e_1}(x)=c_{e_3}(x^*)-c_{e_1}(x^*)\) are exactly the same with the only difference being the sum indices (first sum goes to m and second sum starts at \(m+1\)).

Because of symmetry, for \(m+1<p<d\), we can similarly distribute weights from \(x_p\) to \(x_{m+1}\) and \(x_d\). Using this for all \(1<p<m-1\) and \(m+1<p<d\) iteratively, we get exactly \(x^{(1)}\), which therefore still fulfills (3).

Next, we show that \(x^{(2)}\) fulfills (3), too. We have

$$\begin{aligned}{} & {} c_{e_1}(x^{(1)})\\ ={}{} & {} (m-2)x^{(1)}_1x^{(1)}_{m-1}+(m-1)x^{(1)}_1x^{(1)}_m+mx^{(1)}_1x^{(1)}_{m+1}+(2m-2)x^{(1)}_1x^{(1)}_d\\ {}{} & {} +x^{(1)}_{m-1}x^{(1)}_m+2x^{(1)}_{m-1}x^{(1)}_{m+1}+mx^{(1)}_{m-1}x^{(1)}_d+x^{(1)}_mx^{(1)}_{m+1}+(m-1)x^{(1)}_mx^{(1)}_d\\{} & {} +(m-2)x^{(1)}_{m+1}x^{(1)}_d+x^{(1)}_1(m-3)(2m-2)+x^{(1)}_d(m-3)(2m-2)\\{} & {} +x^{(1)}_{m-1}(m-3)m+x^{(1)}_{m+1}(m-3)m+x^{(1)}_m(m-3)m\\{} & {} +\frac{1}{3}(m-4)(m-3)(m-2)+(m-3)(m-3)m,\\{} & {} c_{e_2}(x^{(1)})\\ ={}{} & {} (m-2)x^{(1)}_1x^{(1)}_{m-1}+mx^{(1)}_1x^{(1)}_m+(m-1)x^{(1)}_1x^{(1)}_{m+1}+x^{(1)}_1x^{(1)}_d\\{} & {} +(2m-2)x^{(1)}_{m-1}x^{(1)}_m+(2m-3)x^{(1)}_{m-1}x^{(1)}_{m+1}+(m-1)x^{(1)}_{m-1}x^{(1)}_d\\{} & {} +x^{(1)}_mx^{(1)}_{m+1}+(m-1)x^{(1)}_mx^{(1)}_d+(m-2)x^{(1)}_{m+1}x^{(1)}_d\\{} & {} +x^{(1)}_1(m-3)(m-1)+x^{(1)}_d(m-3)(m-1)+x^{(1)}_{m-1}(m-3)(2m-3)\\{} & {} +x^{(1)}_{m+1}(m-3)(2m-3)+x^{(1)}_m(m-3)(2m-1)\\{} & {} +\frac{1}{3}(m-4)(m-3)(m-2)+(m-3)(m-3)(m-1)\text { and}\\{} & {} c_{e_3}(x^{(1)})\\ ={}{} & {} (m-2)x^{(1)}_1x^{(1)}_{m-1}+(m-1)x^{(1)}_1x^{(1)}_m+(m-1)x^{(1)}_1x^{(1)}_{m+1}+x^{(1)}_1x^{(1)}_d\\{} & {} +x^{(1)}_{m-1}x^{(1)}_m+(2m-3)x^{(1)}_{m-1}x^{(1)}_{m+1}+(m-1)x^{(1)}_{m-1}x^{(1)}_d\\{} & {} +(2m-2)x^{(1)}_mx^{(1)}_{m+1}+mx^{(1)}_mx^{(1)}_d+(m-2)x^{(1)}_{m+1}x^{(1)}_d\\{} & {} +x^{(1)}_1(m-3)(m-1)+x^{(1)}_d(m-3)(m-1)+x^{(1)}_{m-1}(m-3)(2m-3)\\{} & {} +x^{(1)}_{m+1}(m-3)(2m-3)+x^{(1)}_m(m-3)(2m-1)\\{} & {} +\frac{1}{3}(m-4)(m-3)(m-2)+(m-3)(m-3)(m-1). \end{aligned}$$

We can further assume that \((2m-3)x^{(1)}_1+x^{(1)}_{m-1}=(2m-3)x^{(1)}_d+x^{(1)}_{m+1}\). This is because if (without loss of generality) \((2m-3)x^{(1)}_1+x^{(1)}_{m-1}<(2m-3)x^{(1)}_d+x^{(1)}_{m+1}\) holds, we can move value from \(x^{(1)}_{m-1}\) to \(x^{(1)}_1\) without changing \(\Delta d(x^{(1)})\). This increases \(c_{e_1}(x^{(1)})\) more than \(c_{e_2}(x^{(1)})\) and \(c_{e_3}(x^{(1)})\).

Let (without loss of generality) \(x^{(1)}_1\ge x^{(1)}_d\) and \(y{:}{=}x^{(1)}_1-x^{(1)}_d\). Then we have \(x^{(1)}_d=x^{(1)}_1-y\) and \(x^{(1)}_{m+1}=x^{(1)}_{m-1}+(2m-3)y\). We see, that

$$\begin{aligned} \forall 1\le i\le d:x^{(2)}_i={\left\{ \begin{array}{ll} x^{(1)}_{m}+(2m-4)y&{}\text {if } i=m,\\ x^{(1)}_{m-1}&{}\text {if } i=m-1\text { or }i=m+1,\\ x^{(1)}_1&{}\text {if } i=1\text { or } i=d,\\ 1&{}\text {else}. \end{array}\right. } \end{aligned}$$

We show \(c_{e_1}(x^{(2)})\ge c_{e_3}(x^{(2)})\), by showing that \(c_{e_1}(x^{(1)})-c_{e_3}(x^{(1)})-c_{e_1}(x^{(2)})+c_{e_3}(x^{(2)})>0\).

We have

$$\begin{aligned}&\Delta x^{(1)}\\ {:}{=}{}&c_{e_1}(x^{(1)})-c_{e_3}(x^{(1)})\\ ={}&x^{(1)}_1x^{(1)}_{m+1}+(2m-3)x^{(1)}_1x^{(1)}_d-(2m-5)x^{(1)}_{m-1}x^{(1)}_{m+1}+x^{(1)}_{m-1}x^{(1)}_d\\&-(2m-3)x^{(1)}_mx^{(1)}_{m+1}-x^{(1)}_mx^{(1)}_d+x^{(1)}_1(m-3)(m-1)+x^{(1)}_d(m-3)(m-1)\\&-x^{(1)}_{m-1}(m-3)(m-3)-x^{(1)}_{m+1}(m-3)(m-3)-x^{(1)}_m(m-3)(m-1)\\&+(m-3)(m-3)\\ ={}&x^{(1)}_1x^{(1)}_{m-1}+x^{(1)}_1(2m-3)y+(2m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4)y(m-3)(m-1)\\ ={}&x^{(1)}_{m-1}y((2m-5)(2m-3)+1-(2m-3)(2m-4))\\&+x^{(1)}_my((2m-3)(2m-3)-1)-(2m-4)x^{(1)}_1y\\&+y(m-3)(m-1+(2m-3)(m-3)-(2m-4)(m-1))\\ ={}&-2x^{(1)}_{m-1}y(m-2)+4x^{(1)}_my(m-2)(m-1)-2x^{(1)}_1y(m-2)\\&-2y(m-3)(m-2)\\ ={}&2y(m-2)(-x^{(1)}_{m-1}+2x^{(1)}_m(m-1)-x^{(1)}_1-m+3)\\ ={}&2y(m-2)(x^{(1)}_m-x^{(1)}_1-x^{(1)}_{m-1}+2x^{(1)}_m(m-1.5)-m+3)\\ \ge {}&0. \end{aligned}$$

The last step follows from \(x^{(1)}_m\ge x^{(1)}_1+x^{(1)}_{m-1}\ge 1\), \(m\ge 3\) and \(y\ge 0\).

Since \(x^{(1)}\) fulfills (3), we see that \(c_{e_1}(x^{(2)})\ge c_{e_3}(x^{(2)})\) holds, too. With \(x^{(2)}\) being symmetric, \(c_{e_1}(x^{(2)})\ge c_{e_2}(x^{(2)})\) holds as well. This shows that \(x^{(2)}\) also fulfills (3).

Now, we show that \(x^{(3)}\) fulfills (3), too. Let \(y{:}{=}\frac{x^{(2)}_{m-1}-1}{2m-3}\). We see that

$$\begin{aligned} \forall 1\le i\le d:x^{(3)}_i={\left\{ \begin{array}{ll} x^{(2)}_{m}+2(2m-4)y&{}\text {if } i=m,\\ x^{(2)}_1+y&{}\text {if } i=1 \text { or } i=d,\\ 1&{}\text {else}. \end{array}\right. } \end{aligned}$$

We see that

$$\begin{aligned}&\Delta x^{(2)}\\ ={}&2x^{(2)}_1 + 2(2m-3)yx^{(2)}_1 + (2m-3)x^{(2)}_1x^{(2)}_1-(2m-5)(1+(2m-3)y)^2\\&-(2m-3)x^{(2)}_m-(2m-3)x^{(2)}_m(2m-3)y-x^{(2)}_1x^{(2)}_m+2x^{(2)}_1(m-3)(m-1)\\&-2(m-3)(m-3)-2(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={}&y(m-2)(-4x^{(2)}_1+4(m-1)x^{(2)}_m-4(m-2))\\&+4y^2(2m-5)(m-1)(m-2)\\ \ge {}&0. \end{aligned}$$

The last step follows from \(x^{(2)}_m\ge x^{(2)}_1\), \(m\ge 3\) and \(y\ge 0\).

Since \(x^{(2)}\) fulfills (3), \(x^{(3)}\) does, too. Because of \(x^{(3)}\) being a node distribution with only two variables (\(x^{(3)}_1=x^{(3)}_d\) and \(x^{(3)}_m\)), we can simplify \(\Delta x^{(3)}\) and \(\Delta d\) to

$$\begin{aligned} \Delta x^{(3)} ={}&c_{e_1}(x^{(3)})-c_{e_2}(x^{(3)})\\ ={}&2x^{(3)}_1+(2m-3)x^{(3)}_1x^{(3)}_1-(2m-5)-(2m-3)x^{(3)}_m-x^{(3)}_1x^{(3)}_m\\&+2x^{(3)}_1(m-3)(m-1)-2(m-3)(m-3)-x^{(3)}_m(m-3)(m-1)\\&+(m-3)(m-3)\\ ={}&(2m-3)x^{(3)}_1x^{(3)}_1+2x^{(3)}_1(m-2)^2-x^{(3)}_1x^{(3)}_m-m(m-2)x^{(3)}_m-(m-2)^2 \end{aligned}$$

and

$$\begin{aligned} \Delta d(x^{(3)})={}&(m-2)^2+(2m-3)x^{(3)}_1. \end{aligned}$$

We now prove the lower bound.

We see that \(\Delta d(x^{(3)})\) is only dependent on \(x^{(3)}_1\) which means we have to minimize \(x^{(3)}_1\). Since \(x^{(3)}\) sums to n, we have \(n=2x^{(3)}_1+x^{(3)}_m+2m-4\), and therefore \(x^{(3)}_m=n-2x^{(3)}_1-2m+4\).

Substituting this into \(\Delta x^{(3)}\) yields

$$\begin{aligned} \Delta x^{(3)} ={}&(2m-3)x^{(3)}_1x^{(3)}_1+2x^{(3)}_1(m-2)^2-x^{(3)}_1(n-2x^{(3)}_1-2m+4)\\&-m(m-2)(n-2x^{(3)}_1-2m+4)-(m-2)^2\\ ={}&x^{(3)}_1x^{(3)}_1(2m-1) + x^{(3)}_1(2(m-2)(2m-1)-n)+(2m-1)(m-2)^2\\ {}&-nm(m-2). \end{aligned}$$

Observe that \(x^{(3)}\) fulfills (3) if and only if \(\Delta x^{(3)}\ge 0\). Solving the quadratic equation, we see that this is only the case for

$$\begin{aligned} x^{(3)}_1\ge {}&-(m-2)+\frac{n}{2(2m-1)}\\&+\sqrt{\left( \frac{n}{2(2m-1)}-(m-2)\right) ^2+nm(m-2)-(2m-1)(m-2)^2}. \end{aligned}$$

With (4), we see that the term under the root is larger than

$$\begin{aligned}&0^2+3(m+1)m(m-2)-(2m-1)(m-2)^2\\ \ge {}&(m+1)m(m-2)\\ \ge {}&(m-2)^2. \end{aligned}$$

This yields

$$\begin{aligned} x^{(3)}_1\ge -(m-2)+\frac{n}{2(2m-1)}+\sqrt{(m-2)^2}=\frac{n}{2(2m-1)}, \end{aligned}$$

and therefore

$$\begin{aligned} \Delta d(x^{(3)})\ge (m-2)^2+\frac{2m-3}{2m-1}\cdot \frac{n}{2}\ge \frac{n}{3}. \end{aligned}$$

Case d even: Let \(m=\frac{d}{2}\) and \(e_2{:}{=}\{v_{m-1},v_m\}\) and \(e_3{:}{=}\{v_{m+1},v_{m+2}\}\). (see Fig. 5 (right)) Again, we will only consider the two constraints

$$\begin{aligned} c_{e_1}(x)\ge c_{e_2}(x)\quad \text {and}\quad c_{e_1}(x)\ge c_{e_3}(x), \end{aligned}$$
(5)

where

$$\begin{aligned} c_{e_1}&=\sum _{i=1}^{d-1}\sum _{j=i+1}^d (j-i) x_i x_j,\\ c_{e_2}&=\sum _{i=1}^{m-2}\sum _{j=i+1}^{m-1}(j-i)x_ix_j + \sum _{i=m}^{d-1}\sum _{j=i+1}^d (j-i)x_ix_j + \sum _{i=1}^{m-1}\sum _{j=m}^d (i+d-j)x_ix_j,\\ c_{e_3}&=\sum _{i=1}^m\sum _{j=i+1}^{m+1} (j-i)x_ix_j + \sum _{i=m+2}^{d-1}\sum _{j=i+1}^d (j-i)x_ix_j + \sum _{i=1}^{m+1}\sum _{j=m+2}^d (i+d-j)x_ix_j, \end{aligned}$$

We observe that the claim is trivially true for \(\frac{n}{3}\le \frac{d+6}{2}\), since \(\Delta d(x)\ge \frac{d+6}{2}\) (tight for \(n=6,d=6,x=(1,1,1,1,1,1)\)). This means we can assume

$$\begin{aligned} n>\frac{3(d+6)}{2}, \quad \text {or rather}\quad n>3(m+3). \end{aligned}$$
(6)

Similar to the odd case, we perform a series of relaxations. For that, we define the node distributions \(x^{(1)},x^{(2)},x^{(3)},x^{(4)}\) such that for all \(1\le i\le d\)

$$\begin{aligned} x^{(1)}_i&{:}{=}{\left\{ \begin{array}{ll} x_1 + \sum _{p=2}^{m-2}\frac{m-1-p}{m-2}(x_p-1)&{}\text {if }i=1,\\ x_{m-1}+\sum _{p=2}^{m-2}\frac{p-1}{m-2}(x_p-1)&{}\text {if }i={m-1},\\ x_m&{}\text {if }i=m,\\ x_{m+1}&{}\text {if }i=m+1,\\ x_{m+2}+\sum _{p=m+3}^{d-1}\frac{d-p}{m-2}(x_p-1)&{}\text {if }i=m+1,\\ x_d + \sum _{p=m+3}^{d-1}\frac{p-m-2}{m-2}(x_p-1)&{}\text {if }i=d,\\ 1&{}\text {else,} \end{array}\right. }\\&\qquad \text {(Without loss of generality, we assume } x^{(1)}_1\ge x^{(1)}_d\\&\qquad \text {and } (m-1)x^{(1)}_1+x^{(1)}_{m-1}=(m-1)x^{(1)}_d+x^{(1)}_{m+2}.)\\ x^{(2)}_i&{:}{=}{\left\{ \begin{array}{ll} x^{(1)}_1&{}\text {if }i=1\text { or }i=d,\\ x^{(1)}_{m-1}&{}\text {if }i=m-1\text { or }i=m+2,\\ x^{(1)}_m&{}\text {if }i=m\\ x^{(1)}_{m+1}+(m-2)\left( x^{(1)}_1-x^{(1)}_d\right) &{}\text {if }i=m+1,\\ 1&{}\text {else}, \end{array}\right. }\\ x^{(3)}_i&{:}{=}{\left\{ \begin{array}{ll} x^{(2)}_1&{}\text {if }i=1\text { or }i=d,\\ x^{(2)}_{m-1}&{}\text {if }i=m-1\text { or }i=m+2,\\ \frac{x^{(2)}_m+x^{(2)}_{m+1}}{2}&{}\text {if }i=m\text { or }i=m+1,\\ 1&{}\text {else}, \end{array}\right. }\\ x^{(4)}_i&{:}{=}{\left\{ \begin{array}{ll} x^{(3)}_1+\frac{1}{m-1}\left( x^{(3)}_{m-1}-1\right) &{}\text {if }i=1\text { or }i=d,\\ x^{(3)}_m+\frac{m-2}{m-1}\left( x^{(3)}_{m-1}-1\right) &{}\text {if }i=m\text { or }i=m+1,\\ 1&{}\text {else}. \end{array}\right. } \end{aligned}$$

Again, it is easy to see that \(\Delta d(x)=\Delta d\left( x^{(1)}\right) =\dots =\Delta d\left( x^{(4)}\right) \). We show \(c_{e_1}\left( x^{(i)}\right) \ge c_{e_2}\left( x^{(i)}\right) \) and \(c_{e_1}\left( x^{(i)}\right) \ge c_{e_3}\left( x^{(i)}\right) \), for \(1\le i\le 4\). Therefore, \(x^{(4)}\) is a solution of the minimization problem.

First, we observe that \(c_{e_2}(x)-c_{e_1}(x)=c_{e_2}(x^{(1)})-c_{e_1}(x^{(1)})\) and \(c_{e_3}(x)-c_{e_1}(x)=c_{e_3}(x^{(1)})-c_{e_1}(x^{(1)})\) follow the same way as in the odd case (with slight adjustments to the sum indices). This means that \(x^{(1)}\) fulfills (5).

Next, we show that \(x^{(2)}\) fulfills (5), too. We have

$$\begin{aligned}&c_{e_1}(x^{(1)})\\ ={}&(m-2)x^{(1)}_1x^{(1)}_{m-1}+(m-1)x^{(1)}_1x^{(1)}_m+mx^{(1)}_1x^{(1)}_{m+1}+(m+1)x^{(1)}_1x^{(1)}_{m+2}\\&+(2m-1)x^{(1)}_1x^{(1)}_d+x^{(1)}_{m-1}x^{(1)}_m+2x^{(1)}_{m-1}x^{(1)}_{m+1}+3x^{(1)}_{m-1}x^{(1)}_{m+2}\\&+(m+1)x^{(1)}_{m-1}x^{(1)}_d+x^{(1)}_mx^{(1)}_{m+1}+2x^{(1)}_mx^{(1)}_{m+2}+mx^{(1)}_mx^{(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\&+x^{(1)}_1x^{(1)}_d+x^{(1)}_{m-1}x^{(1)}_m+2x^{(1)}_{m-1}x^{(1)}_{m+1}+(2m-3)x^{(1)}_{m-1}x^{(1)}_{m+2}\\&+(m-1)x^{(1)}_{m-1}x^{(1)}_d+x^{(1)}_mx^{(1)}_{m+1}+(2m-2)x^{(1)}_mx^{(1)}_{m+2}+mx^{(1)}_mx^{(1)}_d\\&+(2m-1)x^{(1)}_{m+1}x^{(1)}_{m+2}+(m+1)x^{(1)}_{m+1}x^{(1)}_d+(m-2)x^{(1)}_{m+2}x^{(1)}_d\\&+(m-3)(m-1)x^{(1)}_1+(m-3)(2m-3)x^{(1)}_{m-1}+(m-3)(2m-1)x^{(1)}_m\\&+(m-3)(2m+1)x^{(1)}_{m+1}+(m-3)(2m-3)x^{(1)}_{m+2}+(m-3)(m-1)x^{(1)}_d\\&+\frac{1}{3}(m-4)(m-3)(m-2)+(m-3)(m-3)(m-1). \end{aligned}$$

Similar to the odd case, we can further assume that \((m-1)x^{(1)}_1+x^{(1)}_{m-1}=(m-1)x^{(1)}_d+x^{(1)}_{m+2}\). If this is not the case and (without loss of generality) \((m-1)x^{(1)}_1+x^{(1)}_{m-1}>(m-1)x^{(1)}_d+x^{(1)}_{m+2}\), we could move weight from \(x^{(1)}_{m+2}\) to \(x^{(1)}_d\) without changing \(\Delta d(x^{(1)})\). This would increase \(c_{e_1}(x^{(1)})\) more than \(c_{e_2}(x^{(1)})\) and \(c_{e_3}(x^{(1)})\).

Let (without loss of generality) \(x^{(1)}_1\ge x^{(1)}_d\) and \(y{:}{=}x^{(1)}_1-x^{(1)}_d\). Therefore, we have \(x^{(1)}_d=x^{(1)}_1-y\) and \(x^{(1)}_{m+2}=x^{(1)}_{m-1}+(m-1)y\). We see that

$$\begin{aligned} \forall 1\le i\le d:x^{(2)}_i={\left\{ \begin{array}{ll} x^{(1)}_m&{}\text {if } i=m,\\ x^{(1)}_{m+1}+(m-2)y&{}\text {if } i=m+1,\\ x^{(1)}_{m-1}&{}\text {if } i=m-1 \text { or } i=m+2,\\ x^{(1)}_1&{}\text {if } i=1 \text { or } i=d,\\ 1&{}\text {else}. \end{array}\right. } \end{aligned}$$

We now show that

$$\begin{aligned} \Delta _2 x^{(2)}&{:}{=}c_{e_1}(x^{(2)})-c_{e_2}(x^{(2)}) \ge c_{e_1}(x^{(1)})-c_{e_2}(x^{(1)})=\Delta _2(x^{(1)}) \end{aligned}$$

and

$$\begin{aligned}\Delta _3 x^{(2)}&{:}{=}c_{e_1}(x^{(2)})-c_{e_3}(x^{(2)}) \ge c_{e_1}(x^{(1)})-c_{e_3}(x^{(1)})=\Delta _3(x^{(1)}). \end{aligned}$$

We have

$$\begin{aligned} \Delta _2 x^{(1)} ={}&c_{e_1}(x^{(1)})-c_{e_2}(x^{(1)})\\ ={}&-2x^{(1)}_1x^{(1)}_m+2x^{(1)}_1x^{(1)}_{m+2}+(2m-2)x^{(1)}_1x^{(1)}_d-(2m-2)x^{(1)}_{m-1}x^{(1)}_m\\&-(2m-4)x^{(1)}_{m-1}x^{(1)}_{m+1}-(2m-6)x^{(1)}_{m-1}x^{(1)}_{m+2}+2x^{(1)}_{m-1}x^{(1)}_d\\&+(m-3)mx^{(1)}_1-(m-3)(m-4)x^{(1)}_{m-1}-(m-3)mx^{(1)}_m\\&-(m-3)(m-2)x^{(1)}_{m+1}-(m-3)(m-4)x^{(1)}_{m+2}+(m-3)mx^{(1)}_d\\&+2(m-3)(m-3)\\ ={}&-2x^{(1)}_1x^{(1)}_m+2x^{(1)}_1x^{(1)}_{m-1}+2(m-1)x^{(1)}_1y+(2m-2)x^{(1)}_1x^{(1)}_1\\&-(2m-2)x^{(1)}_1y-(2m-2)x^{(1)}_{m-1}x^{(1)}_m-(2m-4)x^{(1)}_{m-1}x^{(1)}_{m+1}\\&-(2m-6)x^{(1)}_{m-1}x^{(1)}_{m-1}-(2m-6)x^{(1)}_{m-1}(m-1)y+2x^{(1)}_{m-1}x^{(1)}_1-2x^{(1)}_{m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{(1)}_{m-1}\\&-2x^{(1)}_{m+1}x^{(1)}_1-2(m-2)yx^{(1)}_1+(m-3)mx^{(1)}_1-(m-3)(m-4)x^{(1)}_{m-1}\\&-(m-3)(m-2)x^{(1)}_m-(m-3)mx^{(1)}_{m+1}-(m-3)m(m-2)y\\&-(m-3)(m-4)x^{(1)}_{m-1}+(m-3)mx^{(1)}_1+2(m-3)(m-3), \end{aligned}$$

and therefore

$$\begin{aligned} \Delta _3 x^{(2)}-\Delta _3 x^{(1)}={}&(2m-6)x^{(1)}_{m-1}(m-1)y+2x^{(1)}_{m-1}y+(2m-4)x^{(1)}_m(m-1)y\\&-(2m-2)(m-2)yx^{(1)}_{m-1}+(2m-2)x^{(1)}_{m+1}(m-1)y\\&-2(m-2)yx^{(1)}_1-2x^{(1)}_{m+1}y-(m-3)m(m-2)y\\&+(m-3)(m-4)(m-1)y+(m-3)my\\ ={}&-x^{(1)}_1y(2m-4)\\&+x^{(1)}_{m-1}y((2m-6)(m-1)+2-(2m-2)(m-2))\\&+x^{(1)}_my(2m-4)(m-1)\\ {}&+x^{(1)}_{m+1}y((2m-2)(m-1)-2)\\&+(m-3)y(-(m-2)m+(m-4)(m-1)+m)\\ ={}&2(m-2)y(-x^{(1)}_1-x^{(1)}_{m-1}+(m-1)x^{(1)}_m+mx^{(1)}_{m+1}-(m-3))\\ \ge {}&0. \end{aligned}$$

The inequality in the last step comes from \(m\ge 3\), \(y\ge 0\), \(x^{(1)}_1+x^{(1)}_{m-1}\le \frac{n}{3}\) and \(x^{(1)}_m+x^{(1)}_{m+1}\ge \frac{n}{3}\).

Since \(x^{(1)}\) fulfills (5) and we have \(\Delta _2 x^{(2)} - \Delta _2 x^{(1)}=0\) and \(\Delta _3 x^{(2)} -\Delta _3 x^{(1)}\ge 0\), the node distribution \(x^{(2)}\) fulfills (5), too.

Now, we show that \(x^{(3)}\) fulfills (5), as well. Without loss of generality, we can assume \(x^{(2)}_{m+1}\ge x^{(2)}_m\).

We have

$$\begin{alig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ligned} \Delta _3 x^{(3)}-\Delta _3 x^{(2)}={}&-x^{(2)}_{m-1}x^{(2)}_m+x^{(2)}_{m-1}x^{(2)}_{m+1}-x^{(2)}_1x^{(2)}_m+x^{(2)}_1x^{(2)}_{m+1}\\&-(m-3)x^{(2)}_m+(m-3)x^{(2)}_{m+1}\\ ={}&(x^{(2)}_{m+1}-x^{(2)}_m)(x^{(2)}_{m-1}+x^{(2)}_1+m-3)\\ \ge {}&0. \end{aligned}$$

We also see that \(\Delta _2 x^{(3)}-\Delta _2 x^{(3)}\ge 0\) because \(x^{(3)}\) is symmetric. Since \(x^{(2)}\) fulfills (5), \(x^{(3)}\) does, too. This also means that the two inequalities from (5) are equivalent.

Finally, we show that \(x^{(4)}\) fulfills (5). Let \(y{:}{=}\frac{x^{(3)}_{m-1}-1}{m-1}\). We see that

$$\begin{aligned} \forall 1\le i\le d:x^{(4)}_i={\left\{ \begin{array}{ll} x^{(3)}_{m}+(m-2)y&{}\text {if } i=m\text { or } i=m+1,\\ x^{(3)}_1+y&{}\text {if } i=1 \text { or } i=d,\\ 1&{}\text {else}. \end{array}\right. } \end{aligned}$$

We have

$$\begin{aligned}&\Delta _3 x^{(3)}\\ ={}&4x^{(3)}_1x^{(3)}_{m-1}+(2m-2)x^{(3)}_1x^{(3)}_1-(2m-6)x^{(3)}_{m-1}x^{(3)}_{m-1}-(4m-6)x^{(3)}_{m-1}x^{(3)}_m\\&-2x^{(3)}_1x^{(3)}_m+2(m-3)mx^{(3)}_1-2(m-3)(m-4)x^{(3)}_{m-1}-(m-3)(2m-2)x^{(3)}_m\\&+2(m-3)(m-3)\\ ={}&4x^{(3)}_1+4x^{(3)}_1(m-1)y+(2m-2)x^{(3)}_1x^{(3)}_1-(2m-6)(1+(m-1)y)^2\\&-(4m-6)x^{(3)}_m-(4m-6)x^{(3)}_m(m-1)y-2x^{(3)}_1x^{(3)}_m+2(m-3)mx^{(3)}_1\\&-2(m-3)(m-4)-2(m-3)(m-4)(m-1)y-(m-3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in{aligned} \Delta _3 x^{(4)}-\Delta _3 x^{(3)}={}&y(-(2m-4)x^{(3)}_1+(2m-4)(2m-1)x^{(3)}_m+4-(4m-6)(m-2)\\&\qquad +2(m-3)m-(m-3)(2m-2)(m-2)\\&\qquad +2(2m-6)(m-1)+2(m-3)(m-4)(m-1))\\&+y^2(2+(m-1)^2(2m-6))\\ ={}&y(2m-4)(-x^{(3)}_1+(2m-1)x^{(3)}_m-(m-2))\\&+y^2(2+(m-1)^2(2m-6))\\ \ge {}&0. \end{aligned}$$

The last step follows from \(x^{(3)}_m\ge x^{(3)}_1\), \(m\ge 3\) and \(y\ge 0\).

Since \(x^{(3)}\) and \(x^{(4)}\) are symmetric, we also have \(\Delta _2(x^{(4)})-\Delta _2(x^{(3)})\ge 0\), and with \(x^{(3)}\) fulfilling (5), the node distribution \(x^{(4)}\) fulfills (5), too. Because of \(x^{(4)}\) being a node distribution with only two variables (\(x^{(4)}_1=x^{(4)}_d\) and \(x^{(4)}_m=x^{(4)}_{m+1}\)), we can simplify \(\Delta x^{(4)}\) and \(\Delta d(x^{(4)})\) to

$$\begin{aligned} \Delta x^{(4)} {:}{=}{}&\Delta _2 x^{(4)} = \Delta _3 x^{(4)}\\ ={}&4x^{(4)}_1+(2m-2)x^{(4)}_1x^{(4)}_1-(2m-6)-(4m-6)x^{(4)}_m-2x^{(4)}_1x^{(4)}_m\\&+2(m-3)mx^{(4)}_1-2(m-3)(m-4)-(m-3)(2m-2)x^{(4)}_m\\&+2(m-3)(m-3)\\ ={}&2(m-1)x^{(4)}_1x^{(4)}_1+2(m-1)(m-2)x^{(4)}_1-2x^{(4)}_1x^{(4)}_m-2m(m-2)x^{(4)}_m \end{aligned}$$

and

$$\begin{aligned} \Delta d(x^{(4)})={}&2(m-1)x^{(4)}_1+(m-2)(m-1)+2. \end{aligned}$$

We now prove the lower bound.

We see that \(\Delta d\) is now only dependent on \(x^{(4)}_1\) which means we have to minimize \(x^{(4)}_1\). Since \(x^{(4)}\) sums up to n, we have \(n=2x^{(4)}_1+2x^{(4)}_m+2m-4\), and therefore \(x^{(4)}_m=\frac{n}{2}-x^{(4)}_1-m+2\). Substituting this into \(\Delta x^{(4)}\) yields

$$\begin{aligned} \Delta x^{(4)}={}&2(m-1)x^{(4)}_1x^{(4)}_1 + 2(m-1)(m-2)x^{(4)}_1 - 2x^{(4)}_1\left( \frac{n}{2}-x^{(4)}_1-m+2\right) \\&-2m(m-2)\left( \frac{n}{2}-x^{(4)}_1-m+2\right) \\ ={}&2mx^{(4)}_1x^{(4)}_1+(4m(m-2)-n)x^{(4)}_1-m(m-2)(n-2m+4). \end{aligned}$$

We know that \(x^{(4)}\) fulfills (5) if and only if \(\Delta x^{(4)}\ge 0\). Solving the quadratic inequality leaves us with

$$\begin{aligned} x^{(4)}_1\ge \frac{n}{4m}-(m-2)+\sqrt{\left( \frac{n}{4m}-(m-2)\right) ^2+(m-2)\left( \frac{n}{2}-(m-2)\right) }. \end{aligned}$$

Because of (6), we see that the term under the root is larger than

$$\begin{aligned}&0+(m-2)\left( \frac{3(m+3)}{2}-m+2\right) \\ \ge {}&\frac{1}{2}(m-2)(m-2). \end{aligned}$$

We therefore obtain

$$\begin{aligned} x^{(4)}_1&\ge \frac{n}{4m}-(m-2)+\frac{\sqrt{2}}{2}(m-2)\\&\ge \frac{n}{4m}-\frac{m-2}{2}, \end{aligned}$$

and finally

$$\begin{aligned} \Delta d(x^{(4)})\ge 2(m-1)\left( \frac{n}{4m}-\frac{m-2}{2}\right) +(m-2)(m-1)+2\ge \frac{m-1}{m}\cdot \frac{n}{2}\ge \frac{n}{3}, \end{aligned}$$

which concludes the proof. \(\square \)

Fig. 5
figure 5

This figure shows the cycle formed by adding \(e_1\) to the SMRCST. The cycle is of length d and contains the nodes \(v_1,\dots ,v_d\). Every other node is contained in one of the subtrees rooted in one of the nodes on the cycle. These subtrees are represented in yellow. The number of nodes contained in the subtree rooted in \(v_i\) is \(x_i\). Middle and right: the cycle for d being odd or even, respectively, and the two special edges \(e_2\) and \(e_3\) (Color figure online)

Next, we show that we can find a SMRCST in polynomial time via Algorithm 1 and even guarantee some bounds on the social welfare of the resulting network.

figure b

Our algorithm employs a greedy algorithm developed by Karger et al. [46] which can find a path of length at least \(\frac{|E_H|}{|V_H|}\) in \(\mathcal {O}(|E_H|)\) as a subroutine for initialization. We call this subroutine greedyLongPath. This will help us to derive bounds on the total distances of the computed SMRCST later. For extending the path to a spanning tree in line 2 of Algorithm 1, we can simply iterate over all edges and add them to the network if they do not close a cycle.

Theorem 11

Let H be a connected network containing n nodes and m edges. Then Algorithm 1 finds a Swap-Maximal Routing-Cost Spanning Tree of H in runtime \(\mathcal {O}(n^5m)\).

Proof

It is easy to see that, by construction, T is always a spanning tree of H. The condition in the while-loop ensures that all possible swaps are tried. This means that the while-loop ends if and only if T is a SMRCST. Therefore if the while-loop stops, the result is correct.

In every iteration in which the while-loop does not stop, the total distances of T increase by at least 1. Since the tree maximizing the total distances is the path, we get its total distances \(\frac{1}{3}(n-1)n(n+1)\in \mathcal {O}(n^3)\) as an upper bound for the number of iterations.

The runtime of Algorithm 1 is clearly dominated by the while-loop. Since T has \(n-1\) edges which can be removed and \(E_H\setminus E_T\) has \(\mathcal {O}(m)\) possible edges to add, the number of possible swaps is in \(\mathcal {O}(nm)\). For each swap, the total distances can be computed in \(\mathcal {O}(n)\) [47]. Therefore computing the condition can be done in \(\mathcal {O}(n^2m)\). Altering the current solution in the body of the while-loop only takes \(\mathcal {O}(n)\) when using adjacency lists. Since there are at most \(\mathcal {O}(n^3)\) iterations of the while-loop, the overall runtime is in \(\mathcal {O}(n^5m)\). \(\square \)

For the K-SDNCG, the social optima were also stable. For general host networks, this is not necessarily the case. However, we can show that for \(\alpha \le \frac{n}{3}\) there are stable states which approximate the social welfare better than with the trivial factor of \(\mathcal {O}(n)\).

Theorem 12

(OPT-Approximation via the MRCST) Let H be a connected host network containing n nodes and m edges and T be the MRCST of H.

  1. 1.

    We have \(\frac{{{\,\textrm{SW}\,}}({{\,\textrm{OPT}\,}}_H)}{{{\,\textrm{SW}\,}}(T)}\in \mathcal {O}\left( \frac{m}{n}\right) \).

  2. 2.

    For \(\alpha \in \mathcal {O}\big (\frac{n^2}{m}\big )\), we have \(\frac{{{\,\textrm{SW}\,}}({{\,\textrm{OPT}\,}}_H)}{{{\,\textrm{SW}\,}}(T)}\in \mathcal {O}(1)\).

  3. 3.

    For \(\alpha \in \omega \big (\frac{n^2}{m}\big )\), we have \(\frac{{{\,\textrm{SW}\,}}({{\,\textrm{OPT}\,}}_H)}{{{\,\textrm{SW}\,}}(T)}\in \mathcal {O}\big (\min \big \{\frac{m}{n},\alpha \frac{n}{m}\big \}+1\big )\).

Proof of (1) Let \(V{:}{=}V_H\) and \(O{:}{=}{{\,\textrm{OPT}\,}}_H\). Since T is a MRCST of H, we have \(d_T(V,V)\ge d_O(V,V)\). This yields

$$\begin{aligned} \frac{{{\,\textrm{SW}\,}}(O)}{{{\,\textrm{SW}\,}}(T)}=\frac{2\alpha |E_O|+d_O(V,V)}{2\alpha |E_T|+d_T(V,V)}\le \frac{2\alpha m+d_T(V,V)}{2\alpha (n-1)+d_T(V,V)}\le \frac{m}{n-1}+1\in \mathcal {O}\left( \frac{m}{n}\right) . \end{aligned}$$

\(\square \)\(\square \)

Proof of (2) Let \(V{:}{=}V_H\) and \(O{:}{=}{{\,\textrm{OPT}\,}}_H\). We have \(2\alpha |E_T|\le 2\alpha |E_O|\le 2\alpha m\in \mathcal {O}(n^2)\) and \(d_O(V,V)\in \Omega (n^2)\). We also know that \(d_O(V,V)\le d_T(V,V)\) because T is a MRCST. This yields

$$\begin{aligned} \frac{{{\,\textrm{SW}\,}}(O)}{{{\,\textrm{SW}\,}}(T)}=\frac{2\alpha |E_O|+d_O(V,V)}{2\alpha |E_T|+d_T(V,V)}\in \mathcal {O}\left( \frac{d_O(V,V)}{d_T(V,V)}\right) =\mathcal {O}(1). \end{aligned}$$

\(\square \)

Proof of (3) Let \(V{:}{=}V_H\) and \(O{:}{=}{{\,\textrm{OPT}\,}}_H\). Algorithm 1 uses the greedyLongPath algorithm to construct an initial tree that contains a path of at least length \(l\ge \frac{m}{n}\) [46]. Every node in that tree has a distance of at least \(\frac{l}{3}\) to at least \(\frac{l}{3}\) of the nodes on the long path. This means that the total distances are at least \(n\left( \frac{l}{3}\right) ^2\in \Omega \left( \frac{m^2}{n}\right) \). Since Algorithm 1 only increases the total distances, this is a lower bound for every solution found by the algorithm, and therefore also for the MRCST. With this, we get

$$\begin{aligned} \frac{{{\,\textrm{SW}\,}}(O)}{{{\,\textrm{SW}\,}}(T)}&=\frac{2\alpha |E_O|+d_O(V,V)}{2\alpha |E_T|+d_T(V,V)}\le \frac{2\alpha m}{2\alpha (n-1)+d_T(V,V)}+\frac{d_T(V,V)}{2\alpha (n-1)+d_T(V,V)}\\&\in \mathcal {O}\left( \frac{\alpha m}{\alpha n+\frac{m^2}{n}}+1\right) =\mathcal {O}\left( \min \left\{ \frac{m}{n},\alpha \frac{n}{m}\right\} +1\right) . \end{aligned}$$

\(\square \)

Since finding the MRCST is NP-hard [42], these are only existence results. However, the next theorem yields a bound for dense networks and the computed SMRCST from Algorithm 1.

Theorem 13

Let H be a connected host network containing n nodes and m edges and T be the SMRCST obtained by Algorithm 1. Then for \(\alpha \in \mathcal {O}(n)\), we have \(\frac{{{\,\textrm{SW}\,}}({{\,\textrm{OPT}\,}}_H)}{{{\,\textrm{SW}\,}}(T)}\in \mathcal {O}\big (\frac{n^4}{m^2}\big )\).

Proof

Let \(V{:}{=}V_H\) and \(O{:}{=}{{\,\textrm{OPT}\,}}_H\). We can trivially upper bound the distances and number of edges with \(d_O(V,V)\in \mathcal {O}(n^3)\) and \(|E_O|\le m\). Since T is a result of Algorithm 1, we have \(d_T(V,V)\in \Omega \left( \frac{m^2}{n}\right) \), as seen in the previous proof. This yields

$$\begin{aligned} \frac{{{\,\textrm{SW}\,}}(O)}{{{\,\textrm{SW}\,}}(T)}&=\frac{2\alpha |E_O|+d_O(V,V)}{2\alpha |E_T|+d_T(V,V)}\le \frac{2\alpha m}{2\alpha (n-1)+\frac{m^2}{n}}+\frac{n^3}{2\alpha (n-1)+\frac{m^2}{n}}\\&\in \mathcal {O}\left( \frac{n^2}{m}+\frac{n^4}{m^2}\right) =\mathcal {O}\left( \frac{n^4}{m^2}\right) . \end{aligned}$$

\(\square \)\(\square \)

This means, for \(\alpha \le \frac{n}{3}\) and a dense host network, we can compute a state which is pairwise stable and also has a favorable social welfare.

3.2 Price of Anarchy and Price of Stability

We derive several bounds on the PoA and the PoS for the SDNCG. For the K-SDNCG, the PoA is already quite high for small \(\alpha \). The next Theorem shows that this gets even worse for general host networks since the PoA is linear up to \(\alpha \le n\) and super-constant for \(\alpha \in o(n^2)\).

Theorem 14

(Price of Anarchy)

  1. 1.

    The Price of Anarchy is in \(\mathcal {O}(n)\).

  2. 2.

    For \(\alpha <1\), the Price of Anarchy is in \(\Theta (n)\).

  3. 3.

    For \(1\le \alpha \le n\), the Price of Anarchy is in \(\Theta (n)\).

  4. 4.

    For \(n<\alpha \le n^2\), the Price of Anarchy is in \(\Omega \left( \frac{n^2}{\alpha }\right) \).

  5. 5.

    For \(\frac{1}{4}(n-1)^2<\alpha \le \frac{1}{24}(n-2)n(n+2)\), the Price of Anarchy is in \(\Theta (1)\).

  6. 6.

    For \(\alpha >\frac{1}{24}(n-2)n(n+2)\), the Price of Anarchy is 1.

Proof of (1) and (2)

This follows in the same way as (1) and (2) of Theorem 5. \(\square \)

Proof of (3) and (4)

Let \(W=(V_W,E_W)\) be a wheel network on \(n'{:}{=}\left\lfloor \frac{n}{2}\right\rfloor \) nodes, i.e.,

$$\begin{aligned} V_W&{:}{=}\{v_1,\dots ,v_{n'}\}\quad \text {and}\\ E_W&{:}{=}\{\{v_1,v_i\}\mid 2\le i\le n'\}\cup \{\{v_i,v_{i+1}\}\mid 2\le i\le n'\}\cup \{\{v_2,v_{n'}\}\}. \end{aligned}$$

We then define the host network H as the clique network obtained by replacing every node of W by a clique of size 2. (See Fig. 6 for an illustration.) For odd n, we instead replace the central node by a clique of size 3. We see that H contains n nodes, \(\Theta (n)\) edges, and most importantly a Hamilton path. We also know that H is stable because of Theorem 3 and since no edge can be added. This yields the following lower bound for the Price of Anarchy

$$\begin{aligned} {{\,\textrm{PoA}\,}}\ge \frac{SW(P)}{SW(H)}=\frac{\alpha (n-1)+\Theta (n^3)}{\alpha \Theta (n)+\Theta (n^2)}\in \Omega \left( \min \left\{ n,\frac{n^2}{\alpha }\right\} \right) , \end{aligned}$$

which proves the claim. \(\square \)

Fig. 6
figure 6

This figure shows a clique network (black) for a wheel network (yellow) (Color figure online)

Proof of (5)

Let H be a (connected) host network and \(O{:}{=}{{\,\textrm{OPT}\,}}_H\) and \(V{:}{=}V_H\). From Item 2 we know that H itself is the only pairwise stable network. Since we can bound \(|E_O|\le |E_H|\) and \(d_O(V,V)\le n^3\), we obtain

$$\begin{aligned} {{\,\textrm{PoA}\,}}_n\le \frac{{{\,\textrm{SW}\,}}(O)}{{{\,\textrm{SW}\,}}(H)}=\frac{2\alpha |E_O|+d_O(V,V)}{2\alpha |E_H|+d_H(V,V)}\le \frac{2\alpha |E_H|+n^3}{2\alpha |E_H|}\in \Theta \left( 1+\frac{n^3}{\alpha n}\right) =\Theta (1). \end{aligned}$$

Proof of (6)

This follows directly from the host network being socially optimal and the only stable network (see Theorems 7 and  9). \(\square \)

Theorem 15

(Price of Stability)

  1. 1.

    The Price of Stability is in \(\mathcal {O}(n)\).

  2. 2.

    For \(\alpha \le 1\), the Price of Stability is 1.

  3. 3.

    For \(1<\alpha \le \frac{n}{3}\), the Price of Stability is in \(\mathcal {O}(\sqrt{n})\).

  4. 4.

    For \(\frac{1}{4}(n-1)^2<\alpha \le \frac{1}{24}(n-2)n(n+2)\), the Price of Stability is in \(\Theta (1)\).

  5. 5.

    For \(\alpha >\frac{1}{24}(n-2)n(n+2)\), the Price of Stability is 1.

Proof of (1), (4), and (5)

This follows from Theorem 14 and the Price of Anarchy being an upper bound for the Price of Stability. \(\square \)

Proof of (2)

This follows directly from the MRCST being socially optimal and stable (see Theorems 7 and  9). \(\square \)

Proof of (3) Let H be a (connected) host network and T be the MRCST of H. Let furthermore \(O{:}{=}{{\,\textrm{OPT}\,}}_H\) and \(V{:}{=}V_H\). From Theorem 10 we know that T is stable. From Theorems 7 and  12, we know that

$$\begin{aligned} \frac{{{\,\textrm{SW}\,}}(O)}{{{\,\textrm{SW}\,}}(T)}\in \mathcal {O}\left( \min \left\{ \frac{m}{n},\alpha \frac{n}{m}\right\} \right) \le \mathcal {O}\left( \min \left\{ \frac{m}{n},\frac{n^2}{m}\right\} \right) \le \mathcal {O}\left( \sqrt{n}\right) . \end{aligned}$$

\(\square \)

4 Conclusion

We introduced and analyzed a natural game-theoretic model for network formation governed by social distancing. Besides modeling this timely issue, our model resembles the inverse compared to the well-known (bilateral) Network Creation Game [8, 13]. Thus, via our analysis we could explore the impact of inverting the utility function in a non-trivial strategic game. We find that this inverts some of the properties, like the rough structure of optimum states, while it also yields non-obvious insights. First of all, for the variant with non-complete host networks we could show a strong equilibrium existence result, whereas no such result is known for the inverse model. Moreover, we established that the PoA is significantly higher in the (K-)SDCNG compared to the (bilateral) NCG. This demonstrates that the impact of the agents’ selfishness is higher under social distancing, which calls for external coordination.

The most obvious open question for future work is to settle the equilibrium existence. Do pairwise stable states exist for all connected host networks H and \(\alpha \)? Another research direction would be to consider the unilateral variant of the SDNCG. While this no longer realistically models the formation of social networks, it might still yield interesting insights and it allows for studying stronger solution concepts like the Nash equilibrium or strong Nash equilibria, similar to [48, 49]. Also, altering the utility function, e.g., to using the maximum distance instead of the summed distances, or the probability of infection, similar to [38], seems promising. Finally, also considering weighted host networks, as in [28], where the edge weight models the benefit of the social interaction, would be an interesting generalization.