Connectedness of friends-and-strangers graphs of complete bipartite graphs and others
Abstract
Let and be any two graphs of order . The friends-and-strangers graph of and is a graph with vertex set consisting of all bijections , in which two bijections , are adjacent if and only if they differ precisely on two adjacent vertices of , and the corresponding mappings are adjacent in . The most fundamental question that one can ask about these friends-and-strangers graphs is whether or not they are connected. Let be a complete bipartite graph of order . In 1974, Wilson characterized the connectedness of by using algebraic methods. In this paper, by using combinatorial methods, we investigate the connectedness of for any and all , including being a random graph, as suggested by Defant and Kravitz, and pose some open problems.
1 Introduction
All graphs considered in this paper are finite and simple without loops. Let be a graph. For , denotes the subgraph of induced by and denotes the vertex set consisting of all vertices in that are adjacent to some vertex in . Let denote a cycle of order and a complete bipartite graph with bipartition of size and . In particular, set . By symmetry, when the graph is considered, we always assume that . An edge of a connected graph is a cut edge if its removal results a disconnected graph. A cut edge is non-trivial if none of its ends has degree one. If a path is a -subdivisions of a non-trivial cut edge of a connected graph, then we call a non-trivial -bridge of the resulting graph. A non-trivial cut edge corresponds to a non-trivial -bridge. For a finite sequence , let denote the reverse of .
The friends-and-strangers graphs, introduced by Defant and Kravitz [4], is a kind of flip graphs defined as follows.
Definition 1.1.
[4] Let and be two graphs, each with vertices. The friends-and-strangers graph of and is a graph with vertex set consisting of all bijections from to , two such bijections , are adjacent if and only if they differ precisely on two adjacent vertices, say with , and the corresponding mappings are adjacent in , i.e.,
-
•
;
-
•
, and for all
When this is the case, we refer to the operation that transforms into as an -friendly swap, and say that the swap along the edge transforms to .
The friends-and-strangers graph can be interpreted as follows. View as cities and as mayors. Two mayors are friends if and only if they are adjacent in and two cities are adjacent if and only if they are adjacent in . A bijection from to represents mayors managing these cities such that each mayor manage precisely one city. At any point of time, two mayors can swap their cities if and only if they are friends and the two cities they manage are adjacent. A natural question is how various configurations can be reached from other configurations when multiple such swaps are allowed. This is precisely the information that is encoded in . Note that the components of are the equivalence classes of mutually-reachable (by the multiple swaps described above) configurations, so the connectivity, is the basic aspect of interest in friends-and-strangers graphs.
The questions and results in literature on the friends-and-strangers graph can be divided into two categories. One is when at least one of are specific graphs, such as stars, paths, cycles, spider graphs and so on, [3], [4], [6], [8], [11], [12]. Another is when none of is specific graph, such as both and are random graphs, minimum degree conditions on and , the non-polynomially bounded diameters of and so on, [1]-[4], [6], [7], [9], [10]. We note that Milojevic [9] also studied a new model of friends-and-strangers graphs.
The structure of when belong to the first category is a basic question on the topic related to friends-and-strangers graphs, and the results on this category can also be used to study the other category. For example, Alon, Defant and Kravitz [1] used the structure of in researching the threshold probability and minimum degree conditions on for the connectedness of ; Jeong [7] used the structure of to investigate the connectedness of when is 2-connected.
The first, also foundational, result in the literature on friends-and-strangers graphs is the following, derived by Wilson [12] using algebraic methods, which gives a sufficient and necessary condition for to be connected.
Theorem 1.2.
[12] Let be a graph on vertices. The graph is connected if and only if is -connected, non-bipartite and , where is a graph of order as shown in Figure 1.

Note that an is also a . Defant and Kravitz [4] suggested to investigate the connectivity of for any graph and they thought it might be interesting even if to consider the case when .
In this paper, by using combinatorial methods, we consider the connectedness of in general situation. At first, we get the following theorem that tells us when is disconnected for , which is a little different from that in Theorem 1.2.
Theorem 1.3.
Let be a graph on vertices. If is disconnected, or is bipartite, or contains a non-trivial -bridge, or , then is disconnected.
Next, we consider when is connected. For , we characterize the connectedness of completely as follows.
Theorem 1.4.
Let be a graph on vertices. Then the graph is connected if and only if is a connected non-bipartite graph with no non-trivial cut edge and .
For , we fail in doing that as in Theorem 1.4, and obtain a sufficient condition for to be connected as below.
Theorem 1.5.
Let be a graph on vertices. If is a -connected, non-bipartite graph and , then the graph is connected.
Finally, we determine the threshold probability that guarantees being connected when is a random graph. Let denote the Erdős-Rényi random graphs with vertices and edge-chosen probability .
Theorem 1.6.
Let be a random graph chosen from . For any fix integer , the threshold probability guaranteeing the connectedness of is
2 Preliminaries
In this section, we give some results for proving Theorems 1.3, 1.4, 1.5 and 1.6. The first four results are the basic properties of friends-and-strangers graphs.
Lemma 2.1.
[4] For any two graphs and on vertices, the graphs and are isomorphic.
Lemma 2.2.
[4] Let be graphs on vertices. If are spanning subgraphs of , respectively, then is a spanning subgraph of . In particular, is connected if is connected.
Lemma 2.3.
[4] Let and be two graphs on vertices. If one of and is disconnected, then the graph is disconnected.
Lemma 2.4.
[4] If both and are bipartite graphs on vertices, then the graph is disconnected.
The following lemma will be used to investigate the disconnectedness of friends-and-strangers graphs, due to Milojevic [9].
Lemma 2.5.
[9] Let be a graph containing a non-trivial -bridge. If is not -connected, then the graph is disconnected.
The following lemma is an addition to Theorem 1.2, due to Defant and Kravitz [4]. Let denote a graph obtained from by adding one extra edge.
Lemma 2.6.
[4] Let be a graph on vertices. Then the graph is connected if is -connected and , .
Defant and Kravitz [4] charactered the components of . Note that an is also a , the following lemma extends their result and reveals the structure of the graph .
Lemma 2.7.
Let and be the bipartition of the vertex set of a . Then has precisely components, each of which corresponds to a pair of cyclic orderings of and .
Proof.
Assume that is a . For any bijection , we can map to a cyclic ordering of . This cyclic ordering can be divided uniquely to a pair of cyclic orderings of and . So we obtain a map that sends any bijection to a pair of cyclic orderings of and .
Because any vertices and are adjacent in , two bijections are in the same component of if and only if they are mapped to the same pair of cyclic orderings. Thus, each component of corresponds to a pair of cyclic orderings of and . Because a set has precisely cyclic orderings, the graph has precisely components.
For any graph and , we use to denote the bijection such that , and for any . In order to study the connectedness of friends-and-strangers graphs, Alon, Defant and Kravitz [1] introduced the notion of an exchangeable pair of vertices: Let and be two graphs on vertices, be a bijection and . We say that and are -exchangeable from if and , i.e., , are in the same component. In other words, we say and are -exchangeable from if there is a sequence of -friendly swaps that we can apply to in order to exchange and , that is, there is a path between and in . The following two lemmas give two sufficient conditions for to be connected in terms of exchangeable pairs of vertices.
Lemma 2.8.
[1] Let , and be three graphs on vertices such that is a spanning subgraph of . Suppose that for any edge and any bijection satisfying , the vertices and are -exchangeable from . Then the number of components of equals to the number of components of . In particular, the graph is connected if and only if is connected.
Godsil and Royle [5] proved that the graph is connected if and only if is connected. By setting in Lemma 2.8, the following lemma holds.
Lemma 2.9.
[1] Let be two graphs on vertices such that is connected. Suppose that for any two vertices and every satisfying , the vertices and are -exchangeable from . Then is connected.
Throughout the rest part of this paper, we always assume that has vertex set with bipartition and .
The following lemma reveals the exchageability of a pair of vertices in .
Lemma 2.10.
Suppose that is an odd integer. Then the vertices are -exchangeable from any bijection satisfying .
Proof.
Fix such a bijection and let satisfying . Let be the sequence of swaps along the edges . Then the sequence transforms into a new bijection satisfying . Set , see Table 1. It is easy to verify that since is an odd integer, which implies that and lie in the same component of .
Table 1. The images of under , , and .
The following lemma is due to Bangachev [2].
Lemma 2.11.
[2] If two bijections are in the same component of and there is a sequence of swaps transforming into only involving edges in , then are -exchangeable from if and only if are -exchangeable from .
3 Proof of Theorems 1.3 and 1.4
Proof of Theorem 1.3.
If is disconnected, Lemma 2.3 implies that is disconnected. If is bipartite, Lemma 2.4 implies that is disconnected since is also bipartite. If contains a non-trivial -bridge, then Lemma 2.5 implies that is disconnected since is not -connected. If is a cycle, then Lemma 2.7 implies that is disconnected.
Proof of Theorem 1.4.
It is easy to see that the disconnectedness part of Theorem 1.4 follows from Theorem 1.3, just taking .
For the connectedness part of Theorem 1.4, we need the following.
Proposition 3.1.
Suppose that is a connected non-bipartite graph on vertices with no non-trivial cut edge and . Then the graph is connected.
To make the arguments easier to follow, we postpone the proof of Proposition 3.1 until the end of this section. Note that if and so Theorem 1.4 holds by the connectedness of as shown by Defant and Kravitz [4]. If , then Theorem 1.4 follows from Proposition 3.1.
Therefore, we complete the proof of Theorem 1.4.
We are now in position to prove Proposition 3.1. Before starting to do this, we need in addition the following lemma. Recall that the bipartition of is and .
Lemma 3.2.
Suppose that is a connected non-bipartite graph on vertices. Then the vertices are -exchangeable from any bijection satisfying .
Proof.
Since is non-bipartite, there exists an odd cycle in . Fix a bijection satisfying .
If both and are in , then Lemma 2.10 implies directly that are -exchangeable from by considering swaps along edges in .
If exactly one of and is in , assume that . Let be one of the two neighbors of in and swap along the edges , which results a new bijection satisfying and . Applying Lemma 2.10 to obtains a sequence of swaps that transforms to . Then we can swap along the edges to get the desired .
If none of and are in , let be a shortest path in between the two vertex sets and . Assume without loss of generality that and denote by . Denote by the sequence of swaps along the edges , , . The sequence transforms into a new bijection satisfying , and . Similar to the case when exactly one of and is in , there is a sequence of swaps that transforms into . Then, the sequence transforms into the desired .
Proof of Proposition 3.1.
By Lemma 2.8, it suffices to show that any two vertices are -exchangeable from any bijection satisfying . If , then Lemma 3.2 implies directly that are -exchangeable from . If , then we can swap along the edge to obtain directly the bijection , i.e., are -exchangeable from . So we are left to consider the case .
Firstly, we prove that there exists a sequence of swaps only involving edges in that transforms into a bijection such that is connected and . If there are no edges between and , let be a shortest path between the two vertex sets and . Assume without loss of generality that . Denote by the sequence of swaps along the edges , which can transform into a bijection such that is connected and . For the same reason, if is not adjacent to any vertex in , , then there exists a sequence of swaps transforming into a bijection satisfying that is connected and . So, by Lemma 2.11, are -exchangeable from if and only if are -exchangeable from . So, we assume that is connected.
If one of and has no neighbor in , assume that it is and that . Denote by the sequence of swaps along the edges , . The sequence transforms into a new bijection such that both and have neighbors in and . If are -exchangeable from , then there will exist a sequence of swaps that transforms to . Thus, the sequences will transform to . So, to complete the proof, it suffices to show that are -exchangeable from under the assumption that both and have neighbors in .
Case 1. The vertices and have a common neighbor in .
Assume that is a common neighbor. Swapping along the edges , , transforms into a new bijection with , and , see Figure 2. Apply Lemma 3.2 to , we obtain a sequence of swaps that transforms to . Then swapping along the edges , , transforms into the desired bijection .

Case 2. The vertices and have no common neighbors in .
Since is not a trivial cut edge and contains no non-trivial cut edge, there exist cycles in that contain the edge . Let be such a shortest one. The length of is strictly less than since is not a cycle. Assume without loss of generality that are edges in .
Subcase 2.1. Exactly one of and is in .
Assume that it is . Let with , , .
Denote by the sequence of swaps along the edges , . The sequence transforms into a new bijection such that and are adjacent to a common vertex , see Figure . The same as Case , we obtain a sequence of swaps that transforms to . Then the sequence of swaps transforms into the desired .

Subcase 2.2. None of and are in .
Let be the other neighbor of in . Denote by the sequence of swaps along the edges , , , , , . The sequence transforms into a new bijection satisfying , and , see Figure . By Subcase 2.1, we obtain a sequence of swaps that transforms to . Then the sequence transforms into the desired .

Subcase 2.3. Both and are in .
Let be a vertex in . By the structure of described in Lemma 2.7, we may assume without loss of generality that .
Denote by the sequence of swaps along the edges , , , , , . The sequence transforms into a new bijection satisfying , , and , see Figure . By Subcase 2.2, we obtain a sequence of swaps that transforms to . Then the sequence transforms into the desired .

4 Proofs of Theorems 1.5 and 1.6
In order to prove Theorem 1.5, we need in addition the following lemma.
Lemma 4.1.
Let be a -connected non-bipartite graph on vertices and . Then for any vertices , are -exchangeable from any bijection satisfying .
Proof.
Assume without loss of generality that . Fix such a bijection and let denote a shortest odd cycle in , whose existence is because being non-bipartite. We divide into two parts according to the cycle , that is, we denote and .
Case 1. Both and are in .
We use induction on . If , then Lemma 2.10 implies directly that are -exchangeable from by considering swaps along edges in . Suppose now that it holds for all , where . Because is -connected and , the graph is connected.
We now show that is a proper subset of . Suppose to the contrary that , then it also holds that since is a shortest odd cycle in . Thus, since is not a cycle. Because is -connected, we have , i.e., . So, we have since . Because is -connected, the minimum degree of is at least , so every vertices in is adjacent to all vertices in , which implies that contains a triangle. The contradiction arises since .
Let be a vertex in . By the structure of described in Lemma 2.7, there is a sequence of swaps, involves only edges in , that transforms into a new bijection such that for some satisfying . Let denote the bijection obtained from by swapping the edge . Then we have . By induction hypothesis, there exists a sequence of swaps that transforms into . Then the sequence transforms into the desired .
Case 2. Exactly one of and is in .
Assume that . We consider the following two subcases separately.
Subcase 2.1. The vertex set is non-empty.
Let be a vertex in . By the structure of described in Lemma 2.7, there is a sequence of swaps, involves only the edges in , that transforms into a new bijection satisfying , . So, the bijection satisfies that . By Case 1, there is a sequence of swaps that transforms into . Then the sequence transforms into the desired .
Subcase 2.2. The vertex set is empty.
We first observe that , which implies that . Because is -connected, the graph is connected.
Because , we have the relation
which implies that is a proper subset of . So, there exists a vertex and let be a vertex such that . Then the bijection satisfies , which implies that satisfies the condition in Subcase 2.1. Thus, there is a sequence of swaps that transforms into . Then the bijection equals to the desired .
Case 3. None of and is in .
We consider the following two subcases separately.
Subcase 3.1. The vertex set is non-empty.
Because is -connected, the graph is connected. Let be a shortest path in between the two sets and . Assume that . Let and denote by the sequence of swaps along the edges . The sequence transforms into a new bijection satisfying and only one of and lies in . By Case 2, there is a sequence of swaps that transforms into . Then the sequence transforms into the desired .
Subcase 3.2. The vertex set is empty.
We first observe that , which implies that . Because is -connected, the graph is connected.
Because , we have
which implies that is a proper subset of . So, there exists a vertex and let be a vertex such that . Then the new bijection satisfies , which implies that satisfies the condition in Subcase 3.1. Thus, there is a sequence of swaps that transforms into . It is easy to verify that the bijection equals to the desired .
Proof of Theorem 1.5.
5 Open problems
Conjecture 5.1.
Let be a graph on vertices. The graph is connected if and only if is a connected non-bipartite graph without non-trivial -bridge and .
The disconnectedness part of Conjecture 5.1 is guaranteed by Theorem 1.3.
And Theorems 1.4 and 1.5 are weaker forms of the connectedness part of Conjecture 5.1.
Wilson [12] gave a sufficient and necessary condition for to be connected, see Theorem 1.2. In addition, he also proved that has exactly components for any -connected bipartite graph . Based on his result and Theorem 1.4, we have the following conjecture.
Conjecture 5.2.
Let be a connected bipartite graph on vertices with no non-trivial cut edge and , then the graph has exactly components.
Let be a bipartite graph on vertices with bipartition and of size and , respectively. Alon, Defant and Kravitz [1] proved that the graph has exactly components. By Lemma 2.8, in order to prove Conjecture 5.2, it suffices to show that any two vertices and in are -exchangeable from any bijection satisfying .
Date availability
No data was used for the research described in the article.
Acknowledgments
This research was supported by NSFC under grant numbers 12161141003 and 11931006.
References
- [1] N. Alon, C. Defant, N. Kravitz, Typical and extremal aspects of friends-and-strangers graphs, J. Combin. Theory Ser. B 158 (2023) 3-42.
- [2] K. Bangachev, On the asymmetric generalizations of two extremal questions on friends-and-strangers graphs, Eur. J. Combin. 104 (2022) 103529.
- [3] C. Defant, D. Dong, A. Lee, M. Wei, Connectedness and cycle spaces of friends-and-strangers graphs, ArXiv preprint, arXiv:2209.01704, 2022.
- [4] C. Defant, N. Kravitz, Friends and strangers walking on graphs, Combin. Theory 1 (2021).
- [5] C. Godsil, G. Royle, Algebraic Graph Theory, Springer, 2001.
- [6] R. Jeong, Diameters of connected components of friends-and-strangers graphs are not polynomially bounded, ArXiv preprint, arXiv:2201.00665v3, 2022.
- [7] R. Jeong, On structural aspects of friends-and-strangers graphs, ArXiv preprint, arXiv:2203.10337v1, 2022.
- [8] A. Lee, Connectedness in friends-and-strangers graphs of spiders and complements, arXiv:2210.04768, 2022.
- [9] A. Milojevic, Connectivity of old and new models of friends-and-strangers graphs, arXiv:2210.03864, 2022.
- [10] L. Wang and Y. Chen, Connectivity of friends-and-strangers graphs on random pairs, Discrete Math. 346 (2023) 113266.
- [11] L. Wang and Y. Chen, The connectedness of the friends-and-strangers graph of lollipop graphs and others, arXiv:2211.07458, 2022.
- [12] R.M. Wilson, Graph puzzles, homotopy, and the alternating group, J. Combin. Theory, Ser. B 16 (1974) 86-96.