You are on page 1of 16

BIPARTITE FRIENDS AND STRANGERS WALKING ON BIPARTITE

GRAPHS

RYAN JEONG
arXiv:2309.03848v1 [math.CO] 7 Sep 2023

Abstract. Given n-vertex simple graphs X and Y , the friends-and-strangers graph FS(X, Y ) has
as its vertices all n! bijections from V (X) to V (Y ), with bijections σ, τ adjacent if and only if they
differ on two adjacent elements of V (X) whose mappings are adjacent in Y . We consider the setting
where X and Y are both edge-subgraphs of Kr,r : due to a parity obstruction, FS(X, Y ) is always
disconnected in this setting. Sharpening a result of Bangachev, we show that if X and Y respectively
have minimum degrees δ(X) and δ(Y ) and they satisfy δ(X) + δ(Y ) ≥ ⌊3r/2⌋ + 1, then FS(X, Y )
has exactly two connected components. This proves that the cutoff for FS(X, Y ) to avoid isolated
vertices is equal to the cutoff for FS(X, Y ) to have exactly two connected components. We also
consider a probabilistic setup in which we fix Y to be Kr,r , but randomly generate X by including
each edge in Kr,r independently with probability p. Invoking a result of Zhu, we exhibit a phase
transition phenomenon with threshold function (log r)/r: below the threshold, FS(X, Y ) has more
than two connected components with high probability, while above the threshold, FS(X, Y ) has
exactly two connected components with high probability. Altogether, our results settle a conjecture
and completely answer two problems of Alon, Defant, and Kravitz.

1. Introduction
1.1. Background. Let X and Y be n-vertex simple graphs. Interpret the vertices of X as positions,
and the vertices of Y as people. Two people in the vertex set of Y are friends if they are adjacent
and strangers if they are not. Each person chooses a position, producing a starting configuration.
From here, at any point in time, two friends standing on adjacent positions may switch places: we
call this operation a friendly swap. Our main interest in this paper will be to understand, in terms
of assumptions on the structure of the graphs X and Y , which configurations are reachable from
which other configurations via some sequence of friendly swaps.
We may formalize this setup using the following definition, illustrated in Figure 1.
Definition 1.1 ([DK20]). Let X and Y be simple graphs on n vertices. The friends-and-strangers
graph of X and Y , denoted FS(X, Y ), is a graph with vertices consisting of all bijections from V (X)
to V (Y ), with bijections σ, τ ∈ FS(X, Y ) adjacent if and only if there exists an edge {a, b} in X
such that
(1) {σ(a), σ(b)} ∈ E(Y ),
(2) σ(a) = τ (b), σ(b) = τ (a),
(3) σ(c) = τ (c) for all c ∈ V (X) \ {a, b}.
In other words, σ and τ differ on two adjacent vertices of X whose images under σ are adjacent in
Y . For any such bijections σ, τ , we say that τ is reached from σ by an (X, Y )-friendly swap.
Since they were defined by Defant and Kravitz [DK20], the study of friends-and-strangers graphs
has been a productive area of research. Indeed, Definition 1.1 lends itself to several natural di-
rections of inquiry. One such direction is to assume (without loss of generality, as we will see in
Proposition 2.1) X to be some highly structured graph, and study the structure of FS(X, Y ) for
arbitrary graphs Y : see [Def+22; Jeo22; Lee22; Mil22; Naa00; WC23a; WC23b; Zhu23]. It is
also very natural to ask extremal and probabilistic questions about friends-and-strangers graphs:
in addition to the present paper, see [ADK23; Ban22; Jeo23; Mil22; WLC23]. We also mention
1
2 RYAN JEONG

(a) The graph X. (b) The graph Y .

(c) A sequence of (X, Y )-friendly swaps. Transpositions between adjacent configurations denote the two
vertices in X over which the (X, Y )-friendly swap takes place. Vertices in Y (in red text) are placed upon
vertices of X (in black text). The leftmost configuration corresponds to the bijection σ that maps σ(x1 ) = y1 ,
σ(x2 ) = y5 , σ(x3 ) = y3 , σ(x4 ) = y4 , and σ(x5 ) = y2 . Configurations correspond to vertices in FS(X, Y ).

Figure 1. A sequence of (X, Y )-friendly swaps in FS(X, Y ). Configurations in the bottom row
are vertices in V (FS(X, Y )). Two consecutive configurations differ by an (X, Y )-friendly swap, so the
corresponding vertices are adjacent in FS(X, Y ). The figure and subcaptions are adapted from [Jeo23].

that many other works in combinatorics and theoretical computer science may be recast using the
language of friends-and-strangers. For an incomplete listing of examples, studying the famous 15-
puzzle is equivalent to studying FS(X, Y ) where we let X be the 4-by-4 grid and Y be a star graph
(this setup was later generalized and studied by [Wil74]), [Naa00; Sta08] consider the setting in
which X is a path, asking if X and Y pack [BE78; SS78] is equivalent to asking if there exists an
isolated vertex in FS(X, Y ), and the token swapping problem [Aic+22; Bin+23; BMR18; Mil+16;
Yam+15] on the graph X corresponds to studying distances between configurations in FS(X, Kn ).
As suggested in the first paragraph, however, the most fundamental issue concerning friends-
and-strangers graphs that one can study is their connectivity. Under what conditions on X and Y
will FS(X, Y ) be connected? If we proceed under a regime in which FS(X, Y ) cannot be connected,
how small can the number of connected components get, and what conditions on X and Y ensure
that we achieve the smallest possible number of connected components? Of course, the resolution
of these questions depends on the assumptions on X and Y under which we work. In this paper,
we assume that X and Y are both edge-subgraphs of a complete bipartite graph whose partite
sets have the same size r, and investigate what happens as r grows large. Part of the motivation
for studying this setting comes from the observation that if X and Y are both bipartite, FS(X, Y )
cannot be connected: see the discussion around [DK20, Proposition 2.7] and [ADK23, Subsection
2.3] for a parity obstruction which demonstrates why this is the case.1 Additionally, this particular
setup was of interest to many: it was also studied in [ADK23; Ban22; Mil22; WLC23; Zhu23].
1.2. Notation and Conventions. We assume in this paper that all graphs are simple. For the
sake of completeness, we list the following standard conventions, which we make use of throughout
the article. For a graph G,
• we let V (G) and E(G) respectively denote the vertex and edge sets of G;
• if S ⊆ V (G), then we let G|S denote the induced subgraph of G on S;
• if v ∈ V (G), then we let N (v) = {u ∈ V (G) : {u, v} ∈ E(G)} denote the (open) neighbor-
hood of v;
1This is for reasons akin to why the 15-puzzle is unsolvable.
BIPARTITE FRIENDS AND STRANGERS WALKING ON BIPARTITE GRAPHS 3

• we let δ(G) and ∆(G) respectively denote the minimum degree and maximum degree of G;
• we let G(G, p) denote the probability space of edge-subgraphs of G in which each edge
appears with probability p and the events that different edges appear are independent.
We let Kr,r denote the complete bipartite graph whose two partite sets both have size r. If Σ
is a finite sequence, then rev(Σ) denotes the reverse of Σ. Finally, for two sets S and T , we let
S △ T = (S \ T ) ∪ (T \ S) denote their symmetric difference.
1.3. Main Results. As previously mentioned, when X and Y are both edge-subgraphs of Kr,r ,
the best we can hope for is that FS(X, Y ) has exactly two connected components. A natural
extremal problem results from asking for conditions on the minimum degrees of X and Y ensuring
that FS(X, Y ) has exactly two connected components. In this direction, we let dr,r be the smallest
nonnegative integer such that whenever X and Y are edge-subgraphs of Kr,r with δ(X) ≥ dr,r and
δ(Y ) ≥ dr,r , FS(X, Y ) has exactly two connected components. This problem was first studied in
[ADK23, Sections 5 and 6], which proved bounds on dr,r that were tight up to additive constants.
Asymmetrizing the problem by dropping the assumption that X and Y must satisfy the same
minimum degree condition, [Ban22, Sections 6 and 7] generalized the results of [ADK23], again
obtaining bounds that were tight up to additive constants. In the present article, we sharpen
the results of [Ban22] by shaving off the additive constants, producing completely tight conditions
concerning when FS(X, Y ) has exactly two connected components.
In a different direction (and in the spirit of prior work on the topic, as mentioned earlier), instead
of varying both edge-subgraphs X and Y , we may fix Y = Kr,r , and ask for conditions on X which
ensure that FS(X, Kr,r ) has exactly two connected components. A stochastic analogue of this
problem is obtained by letting X ∈ G(Kr,r , p) and by asking for both conditions on p = p(r) which
ensure that FS(X, Kr,r ) has exactly two connected components with high probability (that is, with
probability tending to 1 as r → ∞) and for conditions on p which ensure that FS(X, Kr,r ) has
more than two connected components with high probability. This problem was raised in [ADK23,
Question 7.6]. Here, we invoke a recent result of [Zhu23] to completely answer this problem, and
find a phase transition phenomenon with threshold function p(r) = (log r)/r.
We now state the specific results that we will prove. In Section 3, we prove the following result.
Theorem 1.2. Let r ≥ 4, and let X and Y be edge-subgraphs of Kr,r such that
δ(X) + δ(Y ) ≥ ⌊3r/2⌋ + 1.
Then FS(X, Y ) has exactly two connected components.
Theorem 1.2 sharpens [Ban22, Theorem 1.10], which had a lower bound of 3r/2 + 1. Together
with [Ban22, Theorem 1.11] and a computer check for the r = 3 case, Theorem 1.2 in the settings
δ(X) = δ(Y ) and δ(Y ) = r respectively implies the following statements.
Corollary 1.3. We have dr,r = ⌈(3r + 1)/4⌉.
Corollary 1.4. For each r ≥ 2, let d∗r,r be the smallest nonnegative integer such that whenever X
is an edge-subgraph of Kr,r with δ(X) ≥ d∗r,r , FS(X, Y ) has exactly two connected components. We
have that
( 
r/2 + 1 r ̸= 3,
d∗r,r =
3 r = 3.
Corollary 1.3 settles [ADK23, Conjecture 7.4], while Corollary 1.4 sharpens [Ban22, Corollary
1.12] and provides a complete answer to [ADK23, Problem 7.7]. We note that it follows from
the proof of [Ban22, Theorem 1.11] that ⌊3r/2⌋ + 1 is the cutoff to avoid isolated vertices. Thus,
Theorem 1.2 tells us that if X and Y are both edge-subgraphs of Kr,r , the cutoff for FS(X, Y ) to
avoid isolated vertices is exactly the same as the cutoff for FS(X, Y ) to have the smallest possible
4 RYAN JEONG

number of connected components. Our results here may thus be interpreted as providing further
motivation for [ADK23, Question 7.5], which asks whether there exists an analogue for friends-and-
strangers graphs of the well-known phenomenon that for a random graph process, the hitting times
for no isolated vertices and the graph being connected are asymptotically almost surely the same.
In Section 4, we prove the following result.
Theorem 1.5. Let X be a random graph in G(Kr,r , p), where p = p(r) depends on r. Let ω be a
function of r such that ω → ∞. If
log r − ω
p=
r
and p ≥ 0, then FS(X, Kr,r ) has more than two connected components with high probability. If
log r + ω
p= ,
r
and p ≤ 1, then FS(X, Kr,r ) has exactly two connected components with high probability.
Theorem 1.5, which identifies p(r) = (log r)/r as a threshold function, identifies a phase transition
and provides an essentially complete answer to [ADK23, Question 7.6].2

2. Preliminaries
In this section, we list results from prior work that will be relevant later in the paper. We mention
that some of the results below are special cases of what is stated in the corresponding cited result.
Proposition 2.1 ([DK20, Proposition 2.6]). Definition 1.1 is symmetric with respect to X and Y :
if X and Y are both n-vertex graphs, we have that FS(X, Y ) ∼
= FS(Y, X).
The following Proposition 2.2 presents an obstruction on the connectivity of FS(X, Y ) when X
and Y are edge-subgraphs of Kr,r , and also shows that the smallest number of connected components
that FS(X, Y ) may have in this setting is two.
Proposition 2.2 ([ADK23, Proposition 2.6]). For r ≥ 2, FS(Kr,r , Kr,r ) has exactly two connected
components.
We now introduce what might be thought of as an extension of an (X, Y )-friendly swap. Propo-
sition 2.4 demonstrates how this notion will be useful in the proof of Theorem 1.2.
Definition 2.3 ([ADK23, Subsection 2.4]). Take n-vertex graphs X and Y , a bijection σ : V (X) →
V (Y ), and distinct vertices u, v ∈ V (Y ). We say that u and v are (X, Y )-exchangeable from σ if σ
and (u v)◦σ are in the same connected component of FS(X, Y ). If Σ is a sequence of (X, Y )-friendly
swaps that transforms σ into (u v) ◦ σ, then we say that applying Σ to σ exchanges u and v.
Proposition 2.4 ([ADK23, Proposition 2.8]). Let X, Y , and Ỹ be n-vertex graphs such that Y
is an edge-subgraph of Ỹ . Suppose that for every {u, v} ∈ E(Ỹ ) and every bijection σ satisfying
{σ −1 (u), σ −1 (v)} ∈ E(X), the vertices u and v are (X, Y )-exchangeable from σ. Then the number
of connected components of FS(X, Ỹ ) is equal to the number of connected components of FS(X, Y ).
Finally, we introduce a result of [Zhu23], which will be our main tool in proving Theorem 1.5.
Definition 2.5 ([WLC23]). A path v1 , v2 , . . . , vk in a graph is a k-bridge if each edge in the path
is a cut edge, v2 , . . . , vr−1 have degree 2 in the graph, and v1 and vr do not have degree 1.
2The arXiv version of [ADK23, Question 7.6], but not the journal version, contains a mistake in its statement.
Specifically, if X is a random graph in G(Kr,r , p), the arXiv version asks for conditions on p ensuring that FS(X, Kr,r )
is disconnected with high probability and conditions on p ensuring that FS(X, Kr,r ) is connected with high probability.
From our discussion, that problem is trivial, since FS(X, Kr,r ) is always disconnected in this setting when r ≥ 2.
BIPARTITE FRIENDS AND STRANGERS WALKING ON BIPARTITE GRAPHS 5

Theorem 2.6 ([Zhu23, Theorem 1.7]). Suppose r ≥ 5. Let X be an edge-subgraph of Kr,r . It holds
that FS(X, Kr,r ) has exactly two connected components if and only if X is connected, is not a cycle,
and does not contain an r-bridge.

3. Minimum Degree
Theorem 1.2 is given by [Ban22, Theorem 1.10] for even values of r, so we assume throughout
this section (and the statements and proofs of all results within it), unless stated otherwise, that
r ≥ 5 and is odd. To begin, we establish the following generalization of [ADK23, Proposition 6.2].
The proof of this lemma is inspired by the proofs of [ADK23, Proposition 6.2] and [Ban22, Lemma
6.2], but in order to prove this sharper statement, we need a more winding argument.
Lemma 3.1. Let X and Y be edge-subgraphs of Kr,r such that δ(X) ≥ δ(Y ) and δ(X) + δ(Y ) ≥
(3r + 1)/2. Let σ : V (X) → V (Y ) be a bijection. If u, v are in different partite sets of Y and are
such that {σ −1 (u), σ −1 (v)} ∈ E(X), then u and v are (X, Y )-exchangeable from σ.
Proof. We assume that {u, v} ∈ / E(Y ), as u and v are trivially (X, Y )-exchangeable otherwise.
We also assume that δ(X) + δ(Y ) = (3r + 1)/2, since the lemma follows from [Ban22, Section 6]
otherwise. For later use, we note that the condition r ≥ δ(X) ≥ δ(Y ) implies that
(3.1) δ(X) ≥ ⌈(3r + 1)/4⌉, δ(Y ) ≥ (r + 1)/2.
Let {AX , BX } and {AY , BY } respectively denote the bipartitions of X and Y . Without loss of
generality, we may assume that u ∈ AY and v ∈ BY . Let u′ = σ −1 (u) and v ′ = σ −1 (v). Our goal
is to show that σ and (u v) ◦ σ are in the same connected component of FS(X, Y ). We may thus
assume that the partite set of X containing v ′ contains at least (r + 1)/2 elements of σ −1 (BY ), as
we may simply switch the roles of σ and (u v) ◦ σ otherwise. Without loss of generality, we may
assume that u′ ∈ AX and v ′ ∈ BX , so that
(3.2) |σ(BX ) ∩ BY | ≥ (r + 1)/2.
Now, let µ : V (X) → V (Y ) be a bijection such that
• µ can be obtained from σ by applying a sequence of swaps not involving u or v;
• |µ(AX ) ∩ AY | is maximal amongst all bijections in the same connected component as σ.
The first condition implies that µ(u′ ) = u and µ(v ′ ) = v. Let Σ be a sequence of (X, Y )-friendly
swaps not involving u or v that transforms σ into µ. We will demonstrate that there is a sequence
Σ̃ of (X, Y )-friendly swaps such that applying Σ̃ to µ exchanges u and v. It will then follow that
Σ∗ = Σ, Σ̃, rev(Σ) is a sequence of (X, Y )-friendly swaps such that applying Σ∗ to σ exchanges u
and v. We break into two cases.
Case 1: We have |µ(AX ) ∩ AY | = r. Here, we have that µ(AX ) = AY and µ(BX ) = BY . Since
|BX \ N (u′ )| ≤ r − δ(X), |BY \ N (u)| ≤ r − δ(Y ),
and we have that
(r − δ(X)) + (r − δ(Y )) = 2r − (3r + 1)/2 = (r − 1)/2 < r,
there exists w ∈ N (u) such that w′ = µ−1 (w) ∈ N (u′ ). Since |N (v ′ ) ∩ N (w′ )| ≥ 2δ(X) − r and
|N (v) ∩ N (w)| ≥ 2δ(Y ) − r imply
|AX \ (N (v ′ ) ∩ N (w′ ))| ≤ r − (2δ(X) − r) = 2r − 2δ(X),
|AY \ (N (v) ∩ N (w))| ≤ r − (2δ(Y ) − r) = 2r − 2δ(Y ),
respectively, and
(2r − 2δ(X)) + (2r − 2δ(Y )) = 4r − 2(δ(X) + δ(Y )) = 4r − (3r + 1) = r − 1 < r,
6 RYAN JEONG

there exists x ∈ N (v) ∩ N (w) ⊆ AY such that x′ = µ−1 (x) ∈ N (v ′ ) ∩ N (w′ ) ⊆ AX . Also, x ̸= u,
since u ∈
/ N (v). We denote
DA = AX \ (N (v ′ ) ∩ N (w′ )), DB = BX \ (N (u′ ) ∩ N (x′ )),
EA = AX \ (DA ∪ {u′ , x′ }), EB = BX \ (DB ∪ {v ′ , w′ }).
Assume that there exists y ∈ N (v) ∩ N (w) such that µ−1 (y) ∈ N (v ′ ) ∩ N (w′ ) and y ̸= x: a
visualization of these vertices and edges is given in Figure 2. Applying the sequence
Σ̃ = xv, yw, xw, uw, yw, xw, xv, yv, yw
to µ exchanges u and v. An entirely symmetric argument yields that if there exists z ∈ N (u)∩N (x)
such that µ−1 (z) ∈ N (u′ ) ∩ N (x′ ) and z ̸= w, then we may exchange u and v from σ. Now assume

Figure 2. The vertices and edges used in Case 1.

that there is no such y and no such z. The assumption implies that


(3.3) N (v) ∩ N (w) \ {x} ⊆ µ(DA ), N (u) ∩ N (x) \ {w} ⊆ µ(DB ).
Furthermore, we have that
(3.4) 2δ(Y ) − r − 1 ≤ |N (v) ∩ N (w) \ {x}| ≤ |µ(DA )| ≤ 2r − 2δ(X),
(3.5) 2(δ(X) + δ(Y )) = 3r + 1 =⇒ 2δ(Y ) − r − 1 = 2r − 2δ(X).
It follows from (3.5) that all inequalities in (3.4) are equalities, so the first subset inclusion in (3.3)
holds with equality. We may argue entirely analogously to study N (u) ∩ N (x) \ {w}. Altogether,
(3.6) N (v) ∩ N (w) \ {x} = µ(DA ), N (u) ∩ N (x) \ {w} = µ(DB ), |DA | = |DB | = 2r − 2δ(X).
The final statement of (3.6) easily implies N (v ′ ) ∪ N (w′ ) = AX and N (u′ ) ∪ N (x′ ) = BX , so that
(3.7) N (v ′ ) △ N (w′ ) = DA , N (u′ ) △ N (x′ ) = DB .
It is also easy to see that
(3.8) (N (v) △ N (w)) \ {u} ⊆ µ(EA ), (N (u) △ N (x)) \ {v} ⊆ µ(EB ).
Furthermore, we have that
(3.9) 2r − 2δ(Y ) − 1 ≤ |(N (v)△N (w)) \ {u}| ≤ |µ(EA )| = r − (2 + |DA |) = 2δ(X) − r − 2,
(3.10) 3r + 1 = 2(δ(X) + δ(Y )) =⇒ 2r − 2δ(Y ) − 1 = r − 2 − (2r − 2δ(X)).
It follows from (3.10) that all inequalities in (3.9) are equalities, so the first subset inclusion in (3.8)
holds with equality. We may argue entirely analogously to prove that the second subset inclusion
in (3.8) also holds with equality, so we have
(3.11) (N (v)△N (w)) \ {u} = µ(EA ), (N (u)△N (x)) \ {v} = µ(EB ).
Furthermore, both of these sets have exactly 2δ(X) − r − 2 vertices. From here, (3.1) implies that
both sets are nonempty. We take y ′ ∈ EA , and denote y = µ(y ′ ). By (3.1), we have that
(3.12)
|µ(EB ∩ N (y ′ ))| ≥ (2δ(X) − r − 2) − (r − δ(X)) = 3δ(X) − 2r + 1 ≥ 3(3r + 1)/4 − 2r + 1 > 0.
BIPARTITE FRIENDS AND STRANGERS WALKING ON BIPARTITE GRAPHS 7

Thus, there exists z ∈ µ(EB ∩ N (y ′ )). Let z ′ = µ−1 (z). We break into two subcases.
Subcase 1.1: We have δ(X) < r. Here, we also have that
|µ(DA ∩ N (z ′ ))| ≥ (2r − 2δ(X)) − (r − δ(X)) = r − δ(X) > 0.
Therefore, we may take s′ ∈ DA ∩ N (z ′ ). We let s = µ(s′ ). Similarly, we may take t′ ∈ DB ∩ N (y ′ ).
We let t = µ(t′ ). Now, (3.7) and (3.11) imply that
(3.13) |N (y) ∩ {v, w}| = |N (z) ∩ {u, x}| = |N (s′ ) ∩ {v ′ , w′ }| = |N (t′ ) ∩ {u′ , x′ }| = 1.
Figure 3a depicts these vertices and edges. In the order they are listed from left to right, denote the
four sets with cardinality 1 in (3.13) by S1 , S2 , S3 , S4 . There are several further subcases induced
by (3.13). In Table 1, contained in Appendix A, we present a sequence of (X, Y )-friendly swaps Σ̃
for each of these subcases such that applying Σ̃ to µ exchanges u and v.
Subcase 1.2: We have δ(X) = r. Here, δ(Y ) = (r + 1)/2. We may adapt (3.12) to observe that
|µ(EB ∩ N (y ′ )) ∩ N (y)| ≥ (2δ(X) − r − 2) − (r − δ(Y )) = δ(Y ) − 2 > 0,
so we may also assume that z ∈ N (y). We take s′ ∈ AX \ {u′ , x′ , y ′ } and t′ ∈ BX \ {v ′ , w′ , z ′ }
such that s = µ(s′ ) and t = µ(t′ ). It follows from the assumption of this subcase that s′ ∈ EA and
t′ ∈ EB . Now, (3.11) implies that
(3.14) |N (y) ∩ {v, w}| = |N (z) ∩ {u, x}| = |N (s) ∩ {v, w}| = |N (t) ∩ {u, x}| = 1.
Figure 3b depicts these vertices and edges. In the order they are listed from left to right, denote the
four sets with cardinality 1 in (3.14) by T1 , T2 , T3 , T4 . There are several further subcases induced
by (3.14). In Table 2, contained in Appendix A, we present a sequence of (X, Y )-friendly swaps Σ̃
for each of these subcases such that applying Σ̃ to µ exchanges u and v.

(a) Subcase 1.1. (b) Subcase 1.2

Figure 3. The vertices and edges used in Subcases 1.1 and 1.2. For each subfigure, exactly one edge
of a particular color is present.

Case 2: We have |µ(AX ) ∩ AY | < r. Let X̃ = X|V (X)\{u′ ,v′ } and Ỹ = Y |V (Y )\{u,v} . Let the
partite sets of X̃ corresponding to AX and BX respectively be AX̃ and BX̃ , and let the partite sets
of Ỹ corresponding to AY and BY respectively be AỸ and BỸ . We denote s = |µ(AX̃ ) ∩ AỸ |. It
follows from (3.2) and the assumption for this case that (r − 1)/2 ≤ s ≤ r − 1. It also follows that
|µ(AX̃ ) ∩ BỸ | = |µ(BX̃ ) ∩ AỸ | = r − 1 − s, |µ(BX̃ ) ∩ BỸ | = s.
There cannot exist vertices p ∈ µ(AX̃ ) ∩ BỸ and q ∈ µ(BX̃ ) ∩ AỸ satisfying {p, q} ∈ E(Y ) and
{µ(p), µ(q)} ∈ E(X), since the (X, Y )-friendly swap pq would then result in a bijection contradicting
the maximality of |µ(AX )∩AY |. Let m be the number of edges between µ(AX̃ )∩BỸ and µ(BX̃ )∩AỸ ,
8 RYAN JEONG

so that there are at most (r − 1 − s)2 − m edges between µ−1 (µ(AX̃ ) ∩ BỸ ) = AX̃ ∩ µ−1 (BỸ ) and
µ−1 (µ(BX̃ ) ∩ AỸ ) = BX̃ ∩ µ−1 (AỸ ).
We let a be a vertex in µ(AX̃ ) ∩ BỸ with the fewest neighbors in µ(BX̃ ) ∩ AỸ , and let b′ be a
vertex in BX̃ ∩ µ−1 (AỸ ) with the fewest neighbors in AX̃ ∩ µ−1 (BỸ ). We let a′ = µ−1 (a) ∈ AX
and b = µ(b) ∈ AỸ . It follows that
m
(3.15) |N (a) ∩ (µ(BX̃ ) ∩ AỸ )| ≤ =: t,
r−1−s
(r − 1 − s)2 − m m
(3.16) |N (b′ ) ∩ (AX̃ ∩ µ−1 (BỸ ))| ≤ = (r − 1 − s) − = r − 1 − s − t.
r−1−s r−1−s
We observe that
|N (a′ ) ∩ (BX̃ ∩ µ−1 (BỸ ))| = |N (a′ ) ∩ BX̃ | − |N (a′ ) ∩ (BX̃ ∩ µ−1 (AỸ ))|
(3.17) ≥ (δ(X) − 1) − |BX̃ ∩ µ−1 (AỸ )| = (δ(X) − 1) − (r − 1 − s),
and that (3.17) may hold with equality only if v ′ ∈ N (a′ ) and BX̃ ∩ µ−1 (AỸ ) ⊆ N (a′ ). Similarly,
|N (b) ∩ (µ(BX̃ ) ∩ BỸ )| = |N (b) ∩ BỸ | − |N (b) ∩ (BỸ ∩ µ(AỸ ))|
(3.18) ≥ (δ(Y ) − 1) − |BỸ ∩ µ(AỸ )| ≥ (δ(Y ) − 1) − (r − 1 − s),
and (3.18) may hold with equality only if v ∈ N (b) and BỸ ∩ µ(AX̃ ) ⊆ N (b). If both (3.17) and
(3.18) held with equality, then we would have that {a′ , b′ } ∈ E(X) and {a, b} ∈ E(Y ), and the
(X, Y )-friendly swap ab would result in a bijection contradicting the maximality of |µ(AX ) ∩ AY |.
Thus, we assume that either (3.17) or (3.18) is strict, so that
|N (a′ ) ∩ (BX̃ ∩ µ−1 (BỸ ))| + |N (b) ∩ (µ(BX̃ ) ∩ BỸ )|
> (δ(X) − 1) − (r − 1 − s) + (δ(Y ) − 1) − (r − 1 − s)
= (3r + 1)/2 − 2r + 2s ≥ (1 − r)/2 + (r − 1)/2 + s = |BX̃ ∩ µ−1 (BỸ )|.
It follows that there exists c′ ∈ BX̃ ∩ µ−1 (BỸ ) such that {a′ , c′ } ∈ E(X) and {b, µ(c′ )} ∈ E(Y ).
Arguing similarly, there exists d′ ∈ AX̃ ∩ µ−1 (AỸ ) such that {b′ , d′ } ∈ E(X) and {a, µ(d′ )} ∈ E(Y ).
We let c = µ(c′ ) and d = µ(d′ ).
Now, we observe that
|(N (a) ∩ AỸ ) ∩ (N (c) ∩ AỸ )| ≥ 2(δ(Y ) − 1) − |AỸ | = 2(δ(Y ) − 1) − (r − 1),
and since a has at most t neighbors in µ(BX̃ ) ∩ AỸ , the number of common neighbors in AỸ \
(µ(BX̃ ) ∩ AỸ ) = µ(AX̃ ) ∩ AỸ that a and c have satisfies
(3.19) |N (a) ∩ N (c) ∩ (µ(AX̃ ) ∩ AỸ )| ≥ 2(δ(Y ) − 1) − (r − 1) − t.
Furthermore, (3.19) may hold with equality only if {a, c} ⊆ N (u) and (3.15) holds with equality.
Similarly, we observe that
|(N (b′ ) ∩ AX̃ ) ∩ (N (c′ ) ∩ AX̃ )| ≥ 2(δ(X) − 1) − |AX̃ | = 2(δ(X) − 1) − (r − 1),
and since b′ has at most r − 1 − s − t neighbors in AX̃ ∩ µ−1 (BỸ ), the number of common neighbors
in AX̃ \ (AX̃ ∩ µ−1 (BỸ )) = AX̃ ∩ µ−1 (AỸ ) that b′ and c′ have satisfies
(3.20) |N (b′ ) ∩ N (c′ ) ∩ (AX̃ ∩ µ−1 (AỸ ))| ≥ 2(δ(X) − 1) − (r − 1) − (r − 1 − s − t).
Furthermore, (3.20) may hold with equality only if {b′ , c′ } ⊆ N (u′ ) and (3.16) holds with equality.
Now assume (towards a contradiction) that either (3.19) or (3.20) is strict. Then
|N (a) ∩ N (c) ∩ (µ(AX̃ ) ∩ AỸ )| + |N (b′ ) ∩ N (c′ ) ∩ (AX̃ ∩ µ−1 (AỸ ))|
> (2(δ(Y ) − 1) − (r − 1) − t) + (2(δ(X) − 1) − (r − 1) − (r − 1 − s − t))
= 2(δ(X) + δ(Y )) − 3r − 1 + s = (3r + 1) − (3r + 1) + s = |µ(AX̃ ) ∩ AỸ |.
BIPARTITE FRIENDS AND STRANGERS WALKING ON BIPARTITE GRAPHS 9

Thus, there exists w ∈ µ(AX̃ ) ∩ AỸ such that, letting w′ = µ−1 (w), {a, c} ⊆ N (w) and {b′ , c′ } ⊆
N (w′ ). Figure 4 depicts these vertices and edges. Now, the sequence of (X, Y )-friendly swaps
cw, aw, bc
results in a bijection contradicting the maximality of |µ(AX ) ∩ AY |. Therefore, (3.15) and (3.16)
both hold with equality. This implies {a, c} ⊆ N (u) and {b′ , c′ } ⊆ N (u′ ): we may argue similarly to

Figure 4. The vertices and edges used to raise a contradiction.

deduce that {b, d} ⊆ N (v) and {a′ , d′ } ⊆ N (v ′ ). This also implies that for any y ∈ µ(AX̃ ) ∩ BỸ and
z ∈ µ(BX̃ ) ∩ AỸ , exactly one of the two edges {µ−1 (y), µ−1 (z)} and {y, z} is present. In particular,
exactly one of {a′ , b′ }, {a, b} is an edge, and exactly one of {c′ , d′ }, {c, d} is an edge. Figure 5 depicts
these vertices and edges. Here, we have that

Figure 5. The vertices and edges in Case 2. Exactly one red edge and one blue edge are present.


uc, dv, da, bc, dc, dv, uc, ua, bv

 {a′ , b′ } ∈ E(X), {c, d} ∈ E(Y )
(3.21) Σ̃ = uc, dv, bv, ua, ba, bc, da, ua, bv {a, b} ∈ E(X), {c′ , d′ } ∈ E(Y )

uc, dv, da, bv, ba, bc, dc, da, uc, ua, bv {a, b}, {c, d} ∈ E(Y )

is a sequence of (X, Y )-friendly swaps such that, when assuming the existence of the edges in a
particular row of (3.21), applying the corresponding sequence to µ exchanges u and v. The only
remaining setting is that where {a′ , b′ }, {c′ , d′ } ∈ E(X). Assuming this, we break into two subcases.
Subcase 2.1: We have s < r − 2. The assumption of this subcase implies that there exist
w ∈ µ(AX̃ ) ∩ BỸ \ {a} and x ∈ µ(BX̃ ) ∩ AỸ \ {b}. Let w′ = µ−1 (w) and x′ = µ−1 (x). Assume that
upon tracing the preceding argument with the pair (w, x) playing the role of of the pair (a, b), the
exchangeability of u and v from µ still remains to be shown. Note that the argument carries over to
the pair (w, x) without issue, since (3.15) and (3.16) both holding with equality (which we deduced
while studying the pair (a, b)) implies that all vertices in µ(AX̃ ) ∩ BỸ have the same number of
neighbors in µ(BX̃ ) ∩ AỸ , and all vertices in BX̃ ∩ µ−1 (AỸ ) have the same number of neighbors
in AX̃ ∩ µ−1 (BỸ ). This implies the existence of y ′ ∈ BX̃ ∩ µ−1 (BỸ ) and z ′ ∈ AX̃ ∩ µ−1 (AỸ ) such
that, letting y = µ(y ′ ) and z = µ(z ′ ), we have
{w′ , y ′ }, {x′ , z ′ }, {u′ , x′ }, {u′ , y ′ }, {w′ , v ′ }, {z ′ , v ′ }, {w′ , x′ }, {y ′ , z ′ } ∈ E(X),
{w, z}, {x, y}, {u, w}, {u, y}, {x, v}, {z, v} ∈ E(Y ).
We split into three further subcases.
10 RYAN JEONG

(a) Subcase 2.1.1. (b) Subcase 2.1.2, with c = y. (c) Subcase 2.1.3.

Figure 6. The vertices and edges used in Subcase 2.1.

Subcase 2.1.1: We have c = y and d = z. Figure 6a depicts these vertices and edges. We may
exchange u and v from µ by applying the sequence
Σ̃ = uc, dv, bv, dw, dv, xv, bv, dv, bc, bv, xc, uc, uw.
Subcase 2.1.2: Exactly one of c = y and d = z holds. We assume that c = y and d ̸= z. The
argument is entirely analogous if c ̸= y and d = z holds instead. Figure 6b depicts these vertices
and edges. We may exchange u and v from µ by applying the sequence
Σ̃ = uc, dv, bv, xc, xv, uw, zw, zv, bv, dv, zv, zw, uw, xv, xc, bc, bv.
Subcase 2.1.3: We have c ̸= y and d ̸= z. Figure 6c depicts these vertices and edges. We may
exchange u and v from µ by applying the sequence
Σ̃ = uc, zv, zw, xv, zv, bv, xy, ua, uw, da, zw, zv, uy, uw, uc, uy, bc, bv,
xy, xv, dv, uc, bv, zv, dv, da, bv, dv, bc, bv, zv, zw, uw, dv, da, bv, dv, bc, bv.

Subcase 2.2: We have s = r − 2. The assumption for this subcase implies µ(AX ) ∩ BY = {a},
µ(BX ) ∩ AY = {b}, and |µ(AX ) ∩ AY | = |µ(BX ) ∩ BY | = r − 1. We split into two further subcases.
Subcase 2.2.1: We have δ(X) < r. We observe that
|AY \ (N (v) ∩ N (c))| ≤ 2r − 2δ(Y ), |AY \ N (d)| ≤ r − δ(Y ),
′ ′
|AX \ (N (a ) ∩ N (w ))| ≤ 2r − 2δ(X), |AX \ N (c′ )| ≤ r − δ(X).
Since
2(r − δ(Y )) + (r − δ(X)) = 3r − 2(δ(X) + δ(Y )) + δ(X) = δ(X) − 1 < r − 1,
there exists w ∈ N (v) ∩ N (c) such that w′ = µ−1 (w) ∈ N (c′ ). Since u ∈ / N (v) and d ∈
/ N (c), we
have w ∈ / {u, d}. Similarly, there exists x ∈ N (u) ∩ N (d) \ {v, c} such that x′ = µ−1 (x) ∈ N (d′ ).
Also, since
2(r − δ(X)) + (r − δ(Y )) = 3r − 2(δ(X) + δ(Y )) + δ(Y ) = δ(Y ) − 1 ≤ δ(X) − 1 < r − 1,
there exists y ∈ N (d) such that y ′ = µ−1 (y) ∈ N (a′ ) ∩ N (w′ ). Figure 7 depicts these vertices and
edges. If y ∈ {v, x}, we may exchange u and v from µ by applying the sequence
(
dv, wc, bv, da, dv, ua, wv, da, dv, uc, bc, bv, wv, dv, wc, uc, da, wv, dv, wc, bv y = v,
Σ̃ =
uc, dx, bc, ua, uc, ux, ua, uc, da, ua, dv, da, dx, dv, ux, ua, bv y = x.
If y ∈
/ {v, x}, we may exchange u and v from µ by applying the sequence
Σ̃ = uc, bc, ua, ad, bv, dx, ux, dy, ua, uc, ux, ua, wc, da, dx, dv, wv, bv, dv, dx,
BIPARTITE FRIENDS AND STRANGERS WALKING ON BIPARTITE GRAPHS 11

(a) Case where y = v. (b) Case where y = x. (c) Case where y ∈


/ {v, x}.

Figure 7. The vertices and edges used in Subcase 2.2.1.

da, ua, dy, da, dv, bv, wv, wc, bc, uc, dx, bv, dv, ua, da, dx, dv, da, ux, uc, ua.
Subcase 2.2.2: We have δ(X) = r. Here, X = Kr,r and δ(Y ) = (r + 1)/2. If there existed
w ∈ N (v) ∩ N (a) such that w′ = µ−1 (w) ∈ AX \ {u′ , a′ , d′ }, then we may exchange u and v from µ
by applying the sequence
Σ̃ = uc, dv, bv, ua, wa, da, ua, dv, wv, bv, dv, bc, bv.
Figure 8a depicts these vertices and edges. We can argue the exchangeability of u and v from µ

(a) First paragraph. (b) Second paragraph.

Figure 8. The vertices and edges used in Subcases 2.2.2.

similarly if we replace N (v) ∩ N (a) in the preceding argument with N (v) ∩ N (c) or N (a) ∩ N (c).
In an analogous manner, we can argue the exchangeability of u and v from µ if we replace the
condition µ−1 (w) ∈ AX \ {u′ , a′ , d′ } with the condition w′ = µ−1 (w) ∈ BX \ {v ′ , b′ , c′ } and also
replace N (v) ∩ N (a) in the preceding argument with N (u) ∩ N (b), N (u) ∩ N (d), or N (b) ∩ N (d).
Therefore, we may further assume that none of these six conditions hold.
It follows from |N (a)| ≥ (r + 1)/2 > 2 that there exists w ∈ N (a) \ {u, d}. Since b ∈ / N (a), we
have that w′ = µ−1 (w) ∈ AX \{u′ , a′ , d′ }. It now follows from |BY \N (b)| ≤ r −δ(Y ), |BY \N (w)| ≤
r − δ(Y ), and (r − δ(Y )) + (r − δ(Y )) = r − 1 < r that there exists x ∈ N (b) ∩ N (w). Furthermore,
12 RYAN JEONG

it follows from our most recent assumption and a ∈ / N (b) that x′ = µ−1 (x) ∈ BX \ {v ′ , b′ , c′ }. It
now follows from |N (x) \ {b, w}| ≥ (r + 1)/2 − 2 > 0 and our most recent assumption that there
exists y ∈ N (x) \ {b, w}. Since y ̸= b, we have that y ′ = µ−1 (y) ∈ AX . Similarly, there exists
z ∈ N (w) \ {a, x} such that z ′ = µ−1 (w) ∈ BX . Figure 8b depicts these vertices and edges. We
may now exchange u and v from µ by applying the sequence
Σ̃ = uc, wz, ua, da, wa, wx, bx, bv, bc, dv, uc, bv, bc, bx, wx, wa, wz.
This completes the proof of the lemma. □
Proof of Theorem 1.2. Suppose X and Y are edge-subgraphs of Kr,r such that δ(X) ≥ δ(Y ) and
δ(X) + δ(Y ) ≥ (3r + 1)/2. Lemma 3.1 implies that the hypothesis of Proposition 2.4 is satisfied
with Ỹ = Kr,r , so it follows that FS(X, Y ) and FS(X, Kr,r ) have the same number of connected
components. Since Kr,r and X are both edge-subgraphs of Kr,r with δ(Kr,r ) ≥ δ(X) and δ(Kr,r ) +
δ(X) ≥ (3r + 1)/2, Lemma 3.1 implies that the hypothesis of Proposition 2.4 is satisfied with the
pair (Kr,r , X) playing the role of (X, Y ) and with Ỹ = Kr,r , so FS(Kr,r , X) and FS(Kr,r , Kr,r )
have the same number of connected components. Propositions 2.1 and 2.2 respectively imply that
FS(X, Kr,r ) ∼= FS(Kr,r , X) and that FS(Kr,r , Kr,r ) has two connected components. Altogether, it
follows that FS(X, Y ) also has two connected components. The theorem follows for edge-subgraphs
X and Y of Kr,r such that δ(X) < δ(Y ) by invoking Proposition 2.1. □
Since 2⌈(3r + 1)/4⌉ ≥ ⌊3r/2⌋ + 1, Corollary 1.3 follows immediately from Theorem 1.2. We have
confirmed via a computer check that for a 2-regular bipartite graph Y whose partite sets each have
three vertices, FS(K3,3 , Y ) has exactly 12 connected components. Corollary 1.4 follows from this
observation together with Theorem 1.2.

4. Random Edge-Subgraphs
We will invoke the following result in the proof of Theorem 1.5.
log r−ω
Proposition 4.1. Let X ∈ G(Kr,r , p). Then X is disconnected with high probability if p = r ,
and X is connected with high probability if p = log rr+ω .
The latter statement of Proposition 4.1 is [FK16, Exercise 4.3.8]. Proposition 4.1 follows from
standard techniques in random graph theory, so we have deferred its proof to Appendix B.
Proof of Theorem 1.5. The first part of Theorem 1.5 follows immediately from Proposition 4.1,
since FS(X, Kr,r ) has more than two connected components whenever r ≥ 2 and X is disconnected.
We assume for the rest of the argument that r is large, and that p = log rr+ω . All asymptotic notation
will be with respect to r. If p > 1/2, it is clear that X has no r-bridge with high probability, since
δ(X) ≥ r/2 with high probability; this is straightforward to prove by the Chernoff bound together
with a union bound over the vertices of Kr,r , for instance. Thus, we also assume that ω is such
that p ≤ 1/2. We let
• C1 (r) denote the collection of all edge-subgraphs of Kr,r with a path v1 , . . . , vr such that
v2 , . . . , vr−1 have degree 2 in X;
• C2 (r) denote the collection of all edge-subgraphs of Kr,r which have a connected component
that is a path on a number of vertices in {r − 2, r − 1, . . . , 2r − 2};
• C2 (r, k) denote the subcollection of C2 (r) consisting of such edge-subgraphs whose largest
F2r−2
path component is on k vertices, so that C2 (r) = k=r−2 C2 (r, k);
• C3 (r) denote the collection of all edge-subgraphs of Kr,r which have a connected component
that is a tree on a number of vertices in {r − 2, r − 1, . . . , 2r − 2};
• C3 (r, k) denote the subcollection of C3 (r) consisting of such edge-subgraphs whose largest
F2r−2
tree component is on k vertices, so that C3 (r) = k=r−2 C3 (r, k).
BIPARTITE FRIENDS AND STRANGERS WALKING ON BIPARTITE GRAPHS 13

Notice that the event X ∈ C1 (r) contains the event that X is a cycle and the event that X contains
an r-bridge. Take X ∈ C1 (r), with k-bridge v1 , . . . , vk such that k is maximal; in particular,
r ≤ k ≤ 2r. We may remove the edges {v1 , v2 } and {vk−1 , vk } from X to form an edge-subgraph
with a component that is a path on k − 2 vertices, and thus lies in C2 (r). This defines a map
φ : C1 (r) → C2 (r). Now, any edge-subgraph Y ∈ C2 (r) has that |φ−1 (Y )| ≤ (r + 2)2 . This is
immediate from the definition of φ if Y has exactly one component that is a path on at least r − 2
vertices. If Y has two components that are paths on at least r − 2 vertices, then there are at most
four remaining vertices which may have been incident to the edges removed from φ−1 (Y ): it is
easy to see that if X ∈ φ−1 (Y ) had an edge between these two paths, this would contradict the
maximality of k. Also, since p ≤ 1/2, any edge-subgraph in C1 (r) is no more likely in G(Kr,r , p)
than any edge-subgraph in C2 (r).
Fix some k ∈ {r − 2, . . . , 2r − 2}. The number of paths on k vertices is k!/2, and by Cayley’s
formula, the number of trees on k vertices is k k−2 . We may partition the collections C2 (r, k) and
C3 (r, k) based on the number of (respectively) path and tree components on k vertices and their
vertex sets. By fixing some block of the partition and comparing the sizes of the corresponding
subsets of C2 (r, k) and C3 (r, k), it follows quickly that uniformly over such values of k,3
|C2 (r, k)| k!/2
≤ k−2 ≪ 1/k 2 ≲ 1/r2 .
|C3 (r, k)| k
where the ≪ is from (for example) Stirling’s approximation. Since all graphs in C2 (r, k) and C3 (r, k)
have the same number of edges, they all have the same probability of being realized under G(Kr,r , p).
Altogether, letting X ∈ G(Kr,r , p), it now follows that
2r−2
X 2r−2
X
Pr[X ∈ C1 (r)] ≲ r2 Pr[X ∈ C2 (r)] = r2 Pr[X ∈ C2 (r, k)] ≪ r2 · (1/r2 ) Pr[X ∈ C3 (r, k)]
k=r−2 k=r−2
 
= Pr X ∈ C3 (r) ≤ Pr [X is disconnected] .
The desired result now follows easily from Theorem 2.6 and Proposition 4.1. □

A. Sequences of (X, Y )-Friendly Swaps in the Proof of Lemma 3.1


In Table 1 and Table 2, we isolate those sequences of swaps Σ̃ corresponding to the relevant
subcases in the proof of Lemma 3.1. On the right columns, we write the unique element in each set
rather than the corresponding singleton set. Blanks indicate that Σ̃ works regardless of what the
unique vertex in the set is. These sequences of (X, Y )-friendly swaps were all found using computer
assistance. In particular, all of these sequences are shortest possible.

B. Proof of Proposition 4.1


Proof. For k ∈ {1, . . . , 2r}, let Xk denote the number of connected components of X on k vertices.
For each v ∈ V (X), let Iv be the indicator
P random variable corresponding to the event that v is an
isolated vertex in X, so that X1 = v∈V (X) Iv . We have
2
(B.1) E[X1 ] = 2r(1 − p)r = 2elog r+r log(1−p) = 2elog r−r(p+O(p )) ,
X X X
E[X12 ] = Pr[Iu Iv = 1] + Pr[Iv = 1] = Pr[Iu Iv = 1] + E[X1 ]
u,v∈V (X), v∈V (X) u,v∈V (X),
u̸=v u̸=v

≥ 2r(2r − 1)(1 − p)2r + E[X1 ] ≳ (2r)2 (1 − p)2r + E[X1 ] = E[X1 ]2 + E[X1 ].

3We say that A ≪ B if A/B → 0 as r → ∞. We say that A ≲ B if there exists a constant C > 0 such that
A ≤ CB for all large r.
14 RYAN JEONG

Σ̃ (S1 , S2 , S3 , S4 )
uw, sv, sw, xw, xv, uw, uz, sw, uw, xw, ut, xt, xv, sv, yv, xv, sv, sw, xw, (v, u, v ′ , u′ )
uw, ut, uz, xv, xw, xt, xv, xw, yv, uw, xv, xw
uz, sw, yv, sv, xv, yv, xw, sw, uw, ut, uz, xw, sw, sw, xw, ut, sw, xv, xw, (v, u, w′ , u′ )
sw, ut, xv, uz, sw, ut, yv, xv, sv, yv, uw, sw, sv, uz, uw, sw, xw, uw, sw, uz,
xv, sw, xw, yv, sv, xv, yv, sw, xw, uw, ut, sw, uz, uw, xv, xw
uz, ws, yv, sv, xv, xw, ws, sv, uw, xw, ut, sw, xv, yv, sv, xv, sw, ut, xw, uw, (v, u, w′ , x′ )
ws, sv, uz, uw, ws, xw, xv, sv, ws
uw, xz, yv, xv, sv, ws, xw, uw, xz, ut, xw, sw, xz, xw, ws, sv, xv, yv, xz, (v, x, , )
sw, xw, ut, uw, xv, xw, xz, xv, xw, yv, xv, uw, xw, xz, xv, xw, yv, uw, xz,
xw, xv, xz
uw, xv, xw, yw, uw, xw, yw, xv, sv, xw, ws, yw, xw, uw, yw, ws, sv, xv, xw (w, u, w′ , u′ )
uw, xz, xw, yw, xv, xz, uw, xw, xv, xz, xw, uw, yw, xw, xz, xv, xw (w, x, , )

Table 1. Subcase 1.1. The exchangeability of u and v for the possibilities not listed here
follows easily from left-right symmetries with listed possibilities.

Σ̃ (T1 , T2 , T3 , T4 )
uw, yz, sv, yv, xv, sv, xv, xv, uz, yz, yv, sv, xv, yv, yz, uz, xv, xv, yv, sv, (v, u, v, u)
xv, yz, xv
xv, yv, xv, sv, yv, xv, xv, uw, xt, xv, yv, sv, xv, yv, xv, xv, xt (v, u, v, x)
uw, xt, xv, sw, xv, xt, uw, xv, xv, xt, xv, uw, sw, xv, xt, xv, xv (v, u, w, x)
xv, yz, xz, xv, yv, xv, uw, xz, xv, xv, xz (v, x, , )
uw, xz, xv, yw, yz, xv, uw, yw, xv, uw, yw (w, x, , )

Table 2. Subcase 1.2. The exchangeability of u and v for the possibilities not listed here
follows easily from left-right symmetries with listed possibilities.

log r−ω
Towards proving the first statement, we begin by assuming that p = r . We additionally
assume that ω ≤ log r, so that p ≥ 0. Here, we may further (B.1) to get
2 /r)
E[X1 ] = eω+O((log r) ≫ 1.

E[X12 ] 1
Since Pr[X1 > 0] ≥ E[X1 ]2
≥ 1 − E[X 1]
= 1 − o(1), it holds with high probability that X contains an
isolated vertex, which implies the first statement. Now assume that p = log rr+ω and that ω is such
that p ≤ 1. It is clear that the probability that X is connected increases in p, so it suffices to prove
the desired result when ω ≪ log r: henceforth, we assume this. Here, we may further (B.1) to get
2 /r)
(B.2) E[X1 ] = e−ω+O((log r+ω) ≪ 1.

If X is disconnected, it must have a component with at most r vertices. We now closely follow the
proof of [FK16, Theorem 4.1]. We have that
r
X
Pr [X1 > 0] ≤ Pr [X is disconnected] ≤ Pr [X1 > 0] + Pr [Xk > 0] .
k=2
BIPARTITE FRIENDS AND STRANGERS WALKING ON BIPARTITE GRAPHS 15

Now, where the latter inequality in the first line bounds E[Xk ] by the number of spanning trees for
components on k vertices and invokes Cayley’s theorem,
r r r  
X X X 2r k−2 k−1
Pr [Xk > 0] ≤ E [Xk ] ≤ k p (1 − p)k(2r−k)
k
k=2 k=2 k=2
r  k  k−1
X 2re k−2 log r + ω log r+ω
≤ k e−k(2r−k) r
k r
k=2
r
log r k−1 −k(2r−k) log r+ω
X  
≲ (2re)k e r
r
k=2
10  k−1 r  k−1
k log r k(5−r) log rr+ω k log r
X X
≲ (re) e + (2re) e−k(log r+ω)/2
r r
k=2 k=11
10 r
!k r
 k−1 X r e1−ω/2 log r
X
−kω log r X
≲ e + 1/2
= o(1) + (r/4)1+o(1)−k/2 ≪ 1.
r 4 (r/4)
k=2 k=11 k=11
It thus follows that
Pr [X is connected] = Pr [X1 = 0] + o(1) = 1 − o(1),
since it follows from Markov’s inequality and (B.2) that Pr[X1 ≥ 1] ≪ 1. □

References
[ADK23] N. Alon, C. Defant, and N. Kravitz. Typical and extremal aspects of friends-and-strangers graphs. Journal
of Combinatorial Theory, Series B 158.1 (2023), pp. 3–42.
[Aic+22] O. Aichholzer, E. D. Demaine, M. Korman, J. Lynch, A. Lubiw, Z. Masárová, M. Rudoy, V. V. Williams,
and N. Wein. Hardness of token swapping on trees. 30th Annual European Symposium on Algorithms 33
(2022), 33:1–33:15.
[Ban22] K. Bangachev. On the asymmetric generalizations of two extremal questions on friends-and-strangers
graphs. European Journal of Combinatorics 104 (2022), p. 103529.
[BE78] B. Bollobás and S. E. Eldridge. Packings of graphs and applications to computational complexity. Journal
of Combinatorial Theory, Series B 25.2 (1978), pp. 105–124.
[Bin+23] A. Biniaz, K. Jain, A. Lubiw, Z. Masárová, T. Miltzow, D. Mondal, A. M. Naredla, J. Tkadlec, and A.
Turcotte. Token swapping on trees. Discrete Mathematics & Theoretical Computer Science 24.2 (2023).
[BMR18] É. Bonnet, T. Miltzow, and P. Rzkażewski. Complexity of token swapping and its variants. Algorithmica
80 (2018), pp. 2656–2682.
[Def+22] C. Defant, D. Dong, A. Lee, and M. Wei. Connectedness and cycle spaces of friends-and-strangers graphs
(2022). arXiv: 2209.01704 [math.CO].
[DK20] C. Defant and N. Kravitz. Friends and strangers walking on graphs. Combinatorial Theory, 1. (2020).
[FK16] A. Frieze and M. Karoński. Introduction to random graphs. Cambridge University Press, 2016.
[Jeo22] R. Jeong. On structural aspects of friends-and-strangers graphs (2022). arXiv: 2203.10337 [math.CO].
[Jeo23] R. Jeong. On the diameters of friends-and-strangers graphs (2023). arXiv: 2201.00665 [math.CO].
[Lee22] A. Lee. Connectedness in Friends-and-Strangers Graphs of Spiders and Complements. arXiv preprint
arXiv:2210.04768 (2022).
[Mil+16] T. Miltzow, L. Narins, Y. Okamoto, G. Rote, A. Thomas, and T. Uno. “Approximation and Hardness of
Token Swapping”. 24th Annual European Symposium on Algorithms. Vol. 57. 2016, 66:1–66:15.
[Mil22] A. Milojevic. Connectivity of old and new models of friends-and-strangers graphs (2022). arXiv: 2210.
03864 [math.CO].
[Naa00] M. Naatz. The graph of linear extensions revisited. SIAM Journal on Discrete Mathematics 13.3 (2000),
pp. 354–369.
[SS78] N. Sauer and J. Spencer. Edge disjoint placement of graphs. Journal of Combinatorial Theory, Series B
25.3 (1978), pp. 295–302.
[Sta08] R. P. Stanley. An equivalence relation on the symmetric group and multiplicity-free flag h-vectors. Journal
of Combinatorics 0.0 (2008).
16 RYAN JEONG

[WC23a] L. Wang and Y. Chen. Connectivity of friends-and-strangers graphs on random pairs. Discrete Mathe-
matics 346.3 (2023), p. 113266.
[WC23b] L. Wang and Y. Chen. The connectedness of the friends-and-strangers graph of a lollipop and others.
Graphs and Combinatorics 39.3 (2023), p. 55.
[Wil74] R. M. Wilson. Graph puzzles, homotopy, and the alternating group. Journal of Combinatorial Theory,
Series B 16.1 (1974), pp. 86–96.
[WLC23] L. Wang, J. Lu, and Y. Chen. Connectedness of friends-and-strangers graphs of complete bipartite graphs
and others. Discrete Mathematics 346.8 (2023), p. 113499.
[Yam+15] K. Yamanaka et al. Swapping labeled tokens on graphs. Theoretical Computer Science 586 (2015), pp. 81–
94.
[Zhu23] H. Zhu. Evacuating “O”- and “Y”-shaped houses on fire: the connectivity of friends-and-strangers graphs
on complete multipartite graphs (2023). arXiv: 2307.08121 [math.CO].

Department of Pure Mathematics and Mathematical Statistics, University of Cambridge, Wilber-


force Road, Cambridge, CB3 0WA, UK
Email address: ryanjeong2000@gmail.com

You might also like