Perfect matchings and derangements on graphs.

Matija Bucic,∗ Pat Devlin,† Mo Hendon,‡ Dru Horne,∗ Ben Lund§ October 14, 2019

Abstract We show that each perfect in a G intersects at least half of the perfect matchings in G. This result has equivalent for- mulations in terms of the permanent of the of a graph, and in terms of derangements and on graphs. We give sev- eral related results and open questions.

1 Introduction

Our main result concerns perfect matchings in bipartite graphs. Theorem 1. Let G be a bipartite graph having a M. Then M has non-empty intersection with at least half of the perfect matchings in G. The value of 1/2 in this conclusion can’t be improved, since even cycles have two perfect matchings, which are disjoint. Moreover, the hypothesis that G be bipartite is necessary (e.g., K4 has three perfect matchings, which are disjoint). In fact, it turns out that for general graphs, the behavior is quite different. Theorem 2. Let G be a graph on 2n vertices having a perfect matching M. Then M has non-empty intersection with at least 1/(2n−1 + 1) of the perfect matchings in G. Moreover, if n is even there is a 3-regular graph on 2n vertices having 2n/2 + 1 perfect matchings, one of which is disjoint from all the others. This work was originally motivated as a study of derangements and permu- tations on graphs, as introduced by Clark [3], and this approach leads to several related questions. Let G = (E,V ) be a directed, loopless graph. A derange- arXiv:1906.05908v2 [math.CO] 10 Oct 2019 ment on G is a bijection σ : V → V such that (v, σ(v)) ∈ E for all v ∈ V .A on G is a bijection σ : V → V such that either (v, σ(v)) ∈ E or v = σ(v) for all v ∈ V . For any directed graph G, denote by (d/p)G the ratio of the number of derangements on G to the number of permutations on G. We also consider

∗ETH Z¨urich, Supported by SNSF grant 200021-175573 †Yale University. ‡University of Georgia. §Princeton University. Supported by DMS-1344994.

1 derangements and permutations on undirected graphs, by treating them as di- rected graphs for which (u, v) is an edge if and only if (v, u) is an edge. From these definitions, it is easy to see that (d/p)Kn is the probability that a uni- formly random permutation on [n] is a derangement. A classic application of inclusion-exclusion shows that

lim (d/p)K = 1/e. n→∞ n Many graphs do not admit any derangements, and hence (d/p) may be as small as 0. In the other direction, if C is a directed cycle, then there is one derangement and two permutations on C, and hence (d/p)C = 1/2. Theorem 1 is equivalent to the claim that (d/p) is never larger than 1/2. Theorem 3. If G is a loopless directed graph, then

(d/p)G ≤ 1/2, with equality if and only if G is a directed cycle.

Let us see that the claim that (d/p)G ≤ 1/2 in Theorem 3 is equivalent to Theorem 1. Given a directed graph G, we construct a bipartite graph G0 as follows. For each vertex v ∈ V (G), we have a left vertex vl and a right vertex vr 0 0 in V (G ). We have {ul, vr} ∈ E(G ) if and only if either (u, v) ∈ E(G) or u = v. Then, each permutation on G corresponds to a perfect matching in G0, and a derangement on G corresponds to a perfect matching in G0 that does not use any edge of the form {vl, vr}. Hence, Theorem 3 is equivalent to the claim that 0 the matching {{vl, vr} : v ∈ V (G)} in G intersects at least half of the perfect matchings in G0. We can obtain the full statement of Theorem 1 by applying a permutation to the labeling of the right vertices of G0. The formulation in terms of derangements and permutations on graphs leads to several other natural questions. In particular, we investigate the ratio (d/p) for restricted families of graphs. In the case that G is regular and very dense, it turns out that (d/p)G is always close to 1/e, as it is for complete graphs.

Theorem 4. Let G = {G2,G3,...} be an infinite family of directed graphs, so that Gn is kn-regular on n vertices. Suppose that kn = n − o(n/ log(n)). Then,

lim (d/p)G = 1/e. n→∞ n By Theorem 3, (d/p) = 1/2 is attained only for directed cycles. A natural question is whether it is possible for (d/p) to be nearly 1/2 for dense graphs. It turns out that there are graphs having positive edge density and (d/p) arbitrarily close to 1/2.

Theorem 5. For any ε > 0, there is a constant cε > 0, an infinite set I of positive integers, and a family of graphs {Gn : n ∈ I} such that |V (Gn)| = n, 2 |E(Gn)| ≥ cεn , and limn→∞(d/p)Gn exists and is strictly larger than 1/2 − ε.

2 We are also interested in how large (d/p)G can be for an undirected graph

G. In Section 2, we show that (d/p)Kn,n > (d/p)K2n . However, in contrast to the case for directed graphs, this is essentially the only example we have found of an undirected graph G with (d/p)G > (d/p)Kn . We propose the following conjecture on the matter.

Conjecture 6. Let G be an undirected graph on n vertices. If n is even, then

(d/p)G ≤ (d/p)Kn/2,n/2 , with equality only for Kn/2,n/2. In the case that n is odd, we don’t know of any graphs G on n vertices with

(d/p)G > (d/p)Kn ; in particular, we don’t know of any way to add a vertex to Kn,n without substantially decreasing the ratio d/p. The following theorem provides some evidence for Conjecture 6. Theorem 7. Let G be a bipartite graph. Then, 1 (d/p)G ≤ Pn −2 , k=0 k! with equality if and only if G is a complete bipartite graph.

In the case of random graphs and digraphs, we show that the numbers of derangements and permutations are tightly concentrated about their means. This can be derived either from the arguments of Frieze and Jerrum [6] on the permanents of random matrices or from the more general framework of Janson [7] who proved limit distribution laws for a wide range of subgraph counts. For a probability q, we use Gn,q (resp. DGn,q) to denote the Erd˝os–R´enyi random graph (resp. digraph) on n vertices where each edge (resp. arc) is in- cluded independently with probability q. It turns out that a great deal can be said about the ratio (d/p) for these random structures (following [7]); however, for both brevity and accessibility we’ll restrict ourselves to the following.

Proposition 8. For each δ > 0, there is a sequence εn → 0 satisfying the following. If q = qn ∈ (δ, 1], then with probability tending to 1 as n → ∞,

−1/q −1/q e (1 − εn) ≤ (d/p)Gn,q ≤ e (1 + εn), and −1/q −1/q e (1 − εn) ≤ (d/p)DGn,q ≤ e (1 + εn).

Thus a large random (di)graph with edge density q will have (d/p) ∼ e−1/q. Setting q = 1/2 shows that for large n, the vast majority of graphs and digraphs have (d/p) tending to e−2. Taking q → 1, we obtain a randomized analog of Theorem 4. Moreover, the behavior for random graphs provides some (mild) additional evidence for Conjecture 6.

3 1.1 Prior work Derangements and permutations on graphs were introduced by Clark, [3], who considered mainly the cycle structure of graph derangements. Penrice [9] (using a slightly different terminology) investigated the number of derangements on n-partite graphs with t vertices in each part, for t fixed and n large. His result is a special case of Theorem 4, and his proof is based on the same ideas used in the proof of Theorem 4. The literature on perfect matchings in bipartite graphs is extensive. For a general background on this, see the textbook of Lov´aszand Plummer [8].

1.2 Organization of the paper The construction for Theorem 5 is in Section 2. The complete bipartite graph is a special case of this construction. Section 3 contains the proof of Theorem 4. Section 4 contains the proof of Theorem 7. Theorem 3 is proved in Section 5, which also includes the statement and proof of a result on Hamilton cycles in directed graphs (Corollary 15). In Section 6 we prove Theorem 2, and we discuss random graphs and digraphs in Section 7. Some open problems are listed in Section 8.

2 Constructions

In this section, we compute (d/p) for blowups of directed graphs. These provide the examples described in Theorem 5. A special case is the complete, balanced, undirected bipartite graph that plays an important role in Conjecture 6 and Theorem 7. Let Dk,l, for k ≥ 1 and l ≥ 2, be a graph on vertices vij for i ∈ [k] and j ∈ [l], such that (vij, vlm) ∈ Dk,l if and only if m = j + 1 mod l. Note that D1,n is the directed cycle on n vertices, and Dn,2 is the undirected complete bipartite graph on [n] t [n]. Figure 1 shows D2,5.

l Proposition 9. The number of derangements on Dk,l is (k!) , and the number of permutations on Dk,l is

k l X k  (k − i)! . i i=0 Consequently, k !−1 X 1 (d/p) = . Dk,l (i!)l i=0

Proof. The graph Dk,l is organized into l parts, with k vertices in each part. In any derangement on Dk,l, each vertex in part j has a single out-neighbor in part j +1 mod l, and no two vertices have the same out-neighbor. The claim on the number of derangements follows immediately.

4 Figure 1: D2,5

If P is a permutation on Dk,l, the number of fixed points of P in each part of Dk,l must be equal. Hence, to count the number of permutations with m fixed points, it is enough to count the number of ways to choose m/l fixed points in each part, and multiply by the number of derangements on the remaining elements. This is the formula given above. Pn 1 Since e = limn→∞ i=0 i! and Kn,n = Dn,2, it follows from Proposition 9 that limn→∞(d/p)Kn,n > 1/e. For small values of n, it is easy to calculate that

(d/p)Kn,n > (d/p)K2n . Hence, (d/p)Kn,n > (d/p)K2n for all n > 1, consistent with Conjecture 6. In light of Theorem 3, it is natural to wonder if it is possible for (d/p)G to be very close to 1/2 if G is not a directed cycle. Choosing l to be a large constant shows that this is the case. In particular, Theorem 5 follows from Proposition 9 by taking Gn = Dn/l,l for a suitably chosen constant l depending on ε.

3 Very dense graphs

In this section, we prove Theorem 4. The proof is based on two standard bounds on the permanents of matrices, the Minc-Br´egmaninequality (proved by Br´egmanin [2]) and van der Waerden conjecture (proved independently by Egorychev in [4] and by Falikman in [5]). Recall that the permanent of an n × n matrix A = [aij] is X Perm(A) = a1σ(1)a2σ(2) . . . anσ(n), σ where the sum runs over all permutations of [n]. If A is the adjacency matrix of Q a directed graph G, and σ is a fixed permutation, then i aiσ(i) = 1 if and only

5 Q Q if (i, σ(i)) ∈ G for each i ∈ [n], and i aiσ(i) = 0 otherwise. Hence, i aiσ(i) = 1 if and only if σ is a derangement on G, and so the permanent of A is equal to the number of derangements on G. Similarly, the permanent of A + I, where I is the identity matrix, is the number of permutations on G. Using the connection between derangements and permanents, Theorem 4 follows as an immediate corollary to the following, stronger, theorem.

Theorem 10. Let I be an infinite set of positive integers, and let {An : n ∈ I} and {Bn : n ∈ I} be families of n × n matrices with entries in {0, 1}. Suppose that the sum of entries in each row and each column of An is kn, and that the sum of entries in each row and each column of Bn is kn + 1. Further, suppose that kn = n − o(n/ log(n)). Then,

P er(A ) lim n = 1/e. n→∞ P er(Bn) Proof of Theorem 10. We use two standard estimates on the permanent of a matrix. First, the Minc-Br´egmaninequality [2] is that, if A is a (0, 1)-matrix with row sums k, then Perm(A) ≤ k!n/k, with equality attained only by block-diagonal matrices. Second, the van der Waerden Conjecture, proved independently in [5, 4], is that, if A is a doubly n 1 stochastic matrix, then Perm(A) ≥ n!/n , with equality attained only by n J, where J is the all-ones matrix. An immediate corollary to this is that, for a matrix A with row and column sums equal to k, we have

Perm(A) ≥ n!(k/n)n.

Notice the upper and lower bounds meet for k = n. What remains is calculation using Stirling’s approximation. In what follows, f(n) ∼ g(n) means limn→∞(f(n)/g(n)) = 1, and we denote k = kn. First, we show that limn→∞ Perm(An)/ Perm(Bn) ≤ 1/e.

k!n/knn Perm(A )/ Perm(B ) ≤ , n n n!(k + 1)n √ n/k 2πk kn ∼ √ , 2πn (k + 1)n kn ≤ (2πn)(n−k)/2k , (k + 1)n kn = (2πn)o(1/ log n) , (k + 1)n ∼ 1/e.

In the last line, we use that (k/(k + 1))n ∼ 1/e for any k = (1 − o(1))n, and n1/ log n is a constant so (2πn)o(1/ log n) ∼ 1.

6 Next, we show that limn→∞ Perm(An)/ Perm(Bn) ≥ 1/e. n!kn Perm(A )/ Perm(B ) ≥ , n n (k + 1)!n/(k+1)nn √ 2πn kn ∼ , n/(k+1) n p2π(k + 1) (k + 1) √ 2πn kn ≥ √ n/(k+1) √ n 2πn − o( nn/(k+1)) (k + 1) 1 ∼ (1/e), (2πn)o(1/ log n) ∼ 1/e.

4 Undirected bipartite graphs

In this section, we prove Theorem 7. As in Section 3, we depend on the con- nection between derangements on graphs and permanents of matrices. In what follows, for any n × n matrix M and sets S, S0 ⊂ [n], we denote by M(S, S0) the sub-matrix of M consisting of rows in S and columns in S0, and denote by M(S, S0) the sub-matrix of M with rows in S and columns in S0 deleted. We denote by M(i, j) the sub-matrix of M obtained by deleting only row i and column j. For any graph G, we denote by pG the number of permutations on G, and by dG the number of derangements on G. First, we need the following lemma on the permanent of an arbitrary matrix. Lemma 11. Let M be an n × n matrix, and let 0 ≤ k ≤ n. Then,

n X Perm(M) = Perm(M(S, S0)) Perm(M(S, S0)). k 0 [n] S,S ∈( k )

[n] 0 [n] Proof. Let S ∈ k . For any S ∈ k , let ΣS0 be the set of permutations of [n] such that σ(i) ∈ S0 for all i ∈ S. For each permutation σ of [n], there is a 0 [n] 0 unique set S ∈ k such that σ(i) ∈ S for all i ∈ S, and hence the sets ΣS0 partition the set of all permutations.

X Y Perm(M) = miσ(i), σ i X X Y Y = miσ(i) miσ(i). [n] 0 σ∈ΣS0 i∈S i∈S S ∈( k )

7 1 0 2 Let ΣS0 be the set of bijections between S and S , and let ΣS0 be the set of 0 bijections between S and S . Each σ ∈ ΣS0 corresponds to exactly one pair of 1 2 functions σ1 ∈ ΣS0 and σ2 ∈ ΣS0 , so that σ(i) = σ1(i) for i ∈ S and σ(j) = σ2(j) for j ∈ S. Hence,

    X X Y X Y Perm(M) =  miσ(i)  miσ(i) , 0 [n] σ∈Σ1 i∈S σ∈Σ2 i∈S S ∈( k ) S0 S0 X = Perm(M(S, S0)) Perm(M(S, S0)).

0 [n] S ∈( k )

We will need to break the permutations up by their fixed points. Lemma 12. If G is a directed, loopless graph on [n] with adjacency matrix M, then X pG = Perm(M(S, S)). S⊆[n] If G is an undirected bipartite graph on [n] t [n] with biadjacency matrix M, then X 0 2 pG = Perm(M(S, S )) . S,S0⊆[n] Proof. Each term on the right side of the equality counts the number of permu- tations on G with the fixed points S. In the case of a bipartite graph, the fixed points occur in pairs; S is the set of fixed points among the left vertices, and S0 is the set of fixed points among the right vertices. We’re now ready to prove the theorem. For convenience, we recall it here. Theorem 7. Let G be a bipartite graph. Then, 1 (d/p)G ≤ Pn −2 , k=0 k! with equality if and only if G is a complete bipartite graph. Proof. Let M be the biadjacency matrix of G. Applying Lemma 11, we have, for each k in the range 0 ≤ k ≤ n, that

2 dG = Perm(M) ,  2 −2 n X =  Perm(M(S, S0)) Perm(M(S, S0)) . k   0 [n] S,S ∈( k )

8 Note that Perm(M(S, S0)) ≤ k!, with equality holding for all S, S0 if and only if G = Kn,n. Hence,  2 −2 n X d ≤ k!2  Perm(M(S, S0)) . G k   0 [n] S,S ∈( k )

By the Cauchy-Schwarz inequality,  2  X 0  X 0 2 X  Perm(M(S, S )) ≤ Perm(M(S, S )) 1. 0 [n] 0 [n] 0 [n] S,S ∈( k ) S,S ∈( k ) S,S ∈( k )

Note that this inequality is tight if G = Kn,n. Substituting back into the expression for dG, we get

2 X 0 2 dG ≤ k! Perm(M(S, S )) . (1)

0 [n] S,S ∈( k )

On the other hand, we have by Lemma 12 that

n X X 0 2 pG = Perm(M(S, S )) . (2)

k=0 0 [n] S,S ∈( k )

Combining (1) and (2), we have

n pG X ≥ k!−2, dG k=0 with equality if and only if G = Kn,n.

5 Arbitrary directed graphs

In this section, we prove Theorem 3. Let us recall the statement of the theorem. Theorem 3. If G is a loopless directed graph, then

(d/p)G ≤ 1/2, with equality if and only if G is a directed cycle. The basic idea of the proof is to construct an injection from derangements to non-derangement permutations. The injection that we construct is based on the cycle structure of the de- rangement. As a graph, any permutation is the union of directed cycles and isolated vertices. In particular, if π(u) = w in a permutation π, then uw is

9 an edge in the corresponding graph. If π(u) = u, then u is an isolated vertex. Derangements are those permutations with no isolated vertices. Given a derangement D, the plan is to map D to a permutation that shares all but one of the cycles of D. The cycle C that we break is the one that contains a specified vertex v. The injection depends on the choice of v. The image of C will normally be a smaller cycle that contains v, together with at least one fixed point. In some special cases, the image of C may be a collection of fixed points, with no cycle. Given the image of D, it is easy to recover all of the cycles in D, except for C. It is easy to obtain the set of vertices in C, but harder to recover the order of these vertices in C. Handling the cycle that contains the special vertex v is the main difficulty of the proof, and we encapsulate it in the following Lemma. Lemma 13. Let G be a directed, loopless graph, and let v ∈ V (G). Let H be the set of Hamilton cycles on G. Let G be the set of permutations on G with at least one fixed point and at most one cycle, such that v is a vertex of the cycle if it exists. Then, there is an injection fv from H to G. In addition, assuming that G is not a directed cycle, there is a choice of v for which the identity is not in the image of fv. Before proving Lemma 13, we show how it implies Theorem 3.

Proof of Theorem 3. It is an easy observation that (d/p)G = 1/2 if G is a di- rected cycle. Assume that G is not a directed cycle. We describe a family of injections Fv from derangements on G to non- derangement permutations on G, one injection for each vertex v ∈ V (G). This family of injections has the property there exists at least one v for which the identity permutation is not in the image of Fv. Hence, the total number of permutations is at least twice the number of derangements, plus one for the identity permutation. For each derangement D on G, let Fv(D) be the union of all cycles of D that do not contain v, together with the image of the cycle C that contains v under the function described in Lemma 13 applied to the subgraph of G induced by the vertices of C. For the derangements that are Hamilton cycles, the map Fv is exactly the map fv described in Lemma 13. By Lemma 13, there is a choice of v so that the identity permutation is not in the image of fv. For derangements that are not Hamilton cycles, each cycle that does not contain v will be mapped to itself, and so the these derangements cannot map to the identity. Hence, there is a choice of v for which the identity is not in the image of Fv. Given Lemma 13, it is easy to see that each permutation P in the image of Fv has a unique preimage D. Indeed, the preimage of each cycle in P that doesn’t contain v is the same cycle. The preimage of the remaining vertices is their preimage under the map fv defined in Lemma 13, which is injective. Hence, Fv is injective, which is sufficient to prove Theorem 3. It remains to prove Lemma 13.

10 Proof of Lemma 13. For any permutation P , we denote by Fix(P ) the set of fixed points of P . The identity permutation is the unique permutation on G such that Fix(P ) = V (G). Let v0 = v and let C = (v0, v1, v2, . . . , vn−1, v0) ⊆ G be a Hamilton cycle on G. Let (vi, vj) ∈ G be a chord of C. Note that (vi, vj) completes a cycle Cij with edges from C, and there is a nonempty set Lij of vertices in G that are not contained in Cij. Further, knowing C, it is easy to identify i, j from either Cij or Lij. If v0 is a vertex of Cij, then we say that (vi, vj) is a forward chord of C. If there are no forward chords with respect to C, then C is the only Hamilton cycle of G. Indeed, suppose that (v0 = u0, u1, u2, . . . , un−1, u0) 6= C is a Hamil- ton cycle of G. Suppose that (v0, v1, . . . , vi) = (u0, u1, . . . , ui), and vi+1 6= ui+1. Then, (ui, ui+1) = (vi, vk) is a forward chord of C. Indeed, since k > i + 1, the sequence (v0, v1, . . . , vi, ui+1 = vk, vk+1, . . . , vn−1, v0 = u0) is a cycle that contains v0. We define a partial order on forward chords as follows. Let (vi, vj) 6= (vk, vl) be forward chords for C. Then, (vi, vj) ≺ (vk, vl) if and only if Lij ⊂ Lkl. This relation inherits the property of being a partial order from the Boolean lattice. We say that a forward chord (vi, vj) is minimal if there is no forward chord (vk, vl) ≺ (vi, vj). We say that the first minimal forward chord is a minimal forward chord (vi, vj) such that i is as small as possible. Since there is at most one minimal forward chord starting at any vertex, the first minimal forward chord is unique. See Figure 2.

v3 v4 v2

v5 Figure 2: The first minimal v1 forward chord for this cycle is v1v4. The chord v7v2 is not forward, v v is forward v6 1 5 v 0 but not minimal, and v3v6 is forward and minimal but not first.

v7 ::: :::

We now describe how to map C to a permutation. If there are no forward chords with respect to C, we map the single Hamilton cycle of G to the permu- tation consisting only of fixed points. Otherwise, let (vs, vt) be the first minimal forward chord. We map C to the permutation P consisting of the cycle Cst and the fixed points Fix(P ) = Lst. In order to show that the map we’ve described is injective, it will suffice to show that we can recover C if we know P and v0. To do this, we need to recover

11 the identity of vs and vt, and to find the order of Fix(P ) in C.

Claim 14. The first vertex in Cst that has an edge into Fix(P ) is vs, and vs has exactly one edge into Fix(P ).

Proof. Suppose, for contradiction, that there is an edge (vi, vj) with i < s and vj ∈ Fix(P ). Then, either (vi, vj) is minimal, or there is a minimal forward chord (vk, vl) ≺ (vi, vj). If (vi, vj) is minimal, then (vs, vt) cannot be the first minimal forward chord, and we reach a contradiction. If (vk, vl) ≺ (vi, vj), then either k < s or k ≥ s. If k < s, then (vs, vt) is not first, and we reach a contradiction. If k ≥ s, then (vs, vt) is not minimal, and we reach a contradiction. We still need to show that vs has only one edge into Fix(P ). Suppose that there is an edge (vs, vj) ∈ G with j 6= s + 1 and vj ∈ Fix(P ). Then (vs, vj) is a forward chord of C with (vs, vj) ≺ (vs, vt), contradicting the choice of (vs, vt) in the construction.

Using this claim, we can identify vs and vt, and we can identify vs+1 ∈ Fix(P ). To do this, we simply start at v0 and follow edges of Cst until we find a vertex that has an edge into Fix(P ). The vertex with an edge into Fix(P ) is vs, the vertex in Fix(P ) that has an edge from vs is vs+1, and the vertex that follows vs in Cst is vt. Having identified vs+1, we claim that we can determine the order of Fix(P ) in C. Indeed, there are no forward chords in Fix(P ), since any such forward chord would precede (vs, vt) in our partial order on forward chords, contra- dicting the minimality of (vs, vt). Hence, there is exactly one edge from any set {vs+1, vs+2, . . . , vk} into {vk+1, vk+2, . . . , vt−1}. Using this fact in an easy inductive argument, we can identify the order Fix(P ) in C. It only remains to show that, under the assumption that G is not a directed cycle, there is a choice of v = v0 for which the identity permutation is not in the image of fv. It is already established that the permutation consisting of fixed points is only in the image of f if there is exactly one Hamilton cycle C on G. If there is a chord u, w of C, then fu(C) will include the cycle formed by (u, w) together with edges of C, and hence the permutation consisting of fixed points will not be in the image of fu. This completes the proof of Lemma 13. The proof of the main theorem is done. Here is one other interesting conse- quence of Lemma 13. Corollary 15. For any directed graph G = (E,V ) that is not a directed cycle, there is a vertex v ∈ V such that the number of cycles in G that contain v is at least twice the number of Hamilton cycles in G. Indeed, for an appropriate choice of v, Lemma 13 gives an explicit injection from the set of Hamilton cycles that contain v to cycles that are not Hamilton. If G is a directed cycle together with an additional edge, then there are two cycles in G, one of which is Hamilton. In this case, the conclusion of Corollary 15 does not hold for those vertices not in the second cycle of G, and cannot be improved for those vertices that are in the second cycle of G. The 2-blowup

12 of a directed cycle, discussed in Section 2, gives a more interesting example for which the conclusion of Corollary 15 is tight.

6 Matchings in general graphs

Let us now proceed to the proof of Theorem 2.

Proof of Theorem 2. Let G be a graph and M = {v1u1, v2u2, . . . , vnun} be a perfect matching in G. By assigning vi, ui one each to sets L and R for all i we obtain 2n−1 different bipartitions of the vertex set. Let us denote by G1,...,G2n−1 the bipartite graphs obtained by only retaining the edges of G between L and R for each of these bipartitions. Note that M is a perfect matching in each of the Gi by construction. Let ai denote the number of perfect matchings of Gi which intersect M and bi the number of perfect matchings of Gi that do not. By Theorem 1 we know ai ≥ bi. Furthermore, if M 0 is any perfect matching of G then M ∪ M 0 is bipartite, 0 which means M is contained in at least one graph Gi. This implies that the number of perfect matchings in G which don’t intersect M is upper bounded by b1 + ··· + bn ≤ a1 + a2 + ··· + an. On the other hand every perfect matching M 0 of G intersecting M appears n−1 n−1 in at most 2 of the Gi, so there are at least (a1 + ··· + an)/2 such matchings. In particular, this is at least 1/2n−1 times the number of perfect matchings in G which don’t intersect M. This means that the proportion of perfect matchings which intersect M is at least 1/(2n−1 +1) of the total number of perfect matchings as claimed.

Our construction is the graph H defined on {v1, . . . , v2n, u1, . . . , u2n} as follows. For each i = 1, . . . , n we put all the edges between {v2i−1, v2i} and {u2i−1, u2i} and make v2i−1v2i and u2iu2i+1 edges (with u2n+1 = u1). Let M0 be the perfect matching in G given by {v1v2, . . . , v2n−1v2n} and {u2u3, u4u5, . . . , u2nu1}. Notice that if for each i we choose either v2i−1u2i−1 and v2iu2i or v2i−1u2i and v2iu2i−1 we get a perfect matching in G, so there n are 2 perfect matchings disjoint from M0. And in fact H has no other per- fect matchings, since (perhaps after some thought) it is clear that any perfect matching containing an edge of M0 must coincide with M0. The argument for our lower bound could perhaps be improved in two ways. First, note that every perfect matching M 0 appears in 2c−1 bipartitions G[L, R], where c is the number of components of M ∪ M 0. For matchings disjoint with M, we used the crude lower bound of 1 and for the others an upper bound of 2n−1. Although this may feel like giving up quite a lot, these were actually tight in our construction H. The second possible area for improvement would be to remove the slack incurred in our application of Theorem 1.

13 v6 v5

u6 u5

v7 v4 u7 u4

u8 u3 v8 v3

u1 u2

v1 v2

Figure 3: The construction in Theorem 2 for n = 4. The red edges form M0.

7 Random (di)graphs

Here, we outline the proof of Proposition 8. Our approach for this is a routine second-moment method in the spirit of Janson’s [7], where the main idea is to first condition on the number of edges (resp. arcs). We direct the readers to [1] for a general text on probabilistic and to the papers [7] and [6] for details of the argument we outline below. Proof. We first outline the proof for the directed graph case, discussing modifi- cations needed for the graph case at the end. Following the ideas in [7, 6], let DG = DGn,m denote a uniformly random digraph on n vertices having exactly m arcs. Let X denote the number of derangements of DG and let Y denote the number of permutations. Note for a digraph H on [n] having t arcs, the probability that H is contained in DG depends only on t and is given by

n(n − 1) − tn(n − 1)−1 (H ⊆ DG) = f(t) := . P m − t m

For 1 ≤ t ≤ 2n (and εn2/2 ≤ m ≤ n2), this is given by

 m t −t2  1 1   (H ⊆ DG) = f(t) = exp − + O(1/n) . P n(n − 1) 2 m n(n − 1)

When t = n, this gives the probability that a given derangement is contained in DG. Let Der(n) denote the number of derangements of the set [n], and define

14 γ = m/[n(n − 1)]. Using that n!/e − 1 ≤ Der(n) ≤ n!/e + 1, we have

−n2 n   [X] = f(n)Der(n) = γn exp + + O(1/n) Der(n) E 2m 2(n − 1) −1 1  −1 1  = γn exp + + O(1/n) Der(n) = n!γn exp − + O(1/n) 2γ 2 2γ 2 as the expected number of derangements of DGn,m. Similarly, if σ is a permutation of [n] with k fixed points, then the probability that σ is a permutation of DG is f(n − k). Therefore, the expected number of permutations of DG is given by

n X n [Y ] = f(n − k) Der(n − k) E k k=0 −1 1  = n!γn exp − + O(1/n) 2γ 2 n X (1/γ)k 2kn − k2  1 1  × exp − k! 2 m n(n − 1) k=0  1 1  = n!γn exp − + O(log(n)/n) , 2γ 2 where in the last line, we estimate the sum by the Taylor series for e1/γ . The slightly enlarged (suboptimal) error term comes from a very crude bound esti- mating the sum based on whether or not (1/γ)k/k! ≤ 1/n. After this, to finish the directed graph case we need only estimate the vari- ances of X and Y . Routine computations almost identical to those in [6] show that E[X2] = E[X]2(1 + o(1)) and E[Y 2] = E[Y ]2(1 + o(1)). Therefore, by Chebyshev’s inequality, with high probability X/Y = (1 ± o(1))E[X]/E[Y ] = −1/γ (1 ± o(1))e . The proof concludes by the standard coupling of DGn,q and DGn,m using the fact that γ = q + o(1) with high probability (since the number of arcs of DGn,q is well concentrated). See [7, 6] for full details of this method. The graph case is almost identical but with γ = 2m/n2. In the directed graph case, a guiding heuristic in computing moments is that two random derange- ments should share approximately as many edges as two random permutations. Whereas in the graph case, the heuristic is that for a random permutation, the number of fixed points and the number of cycles of length 2 should be approxi- mately independent.

8 Open problems

Finally, we mention a few open problems, mostly inspired by studying derange- ments and permutations on graphs. 1. Theorem 2 shows that in general, a perfect matching may intersect with only an exponentially small proportion of all perfect matchings, but there

15 is a sizable gap between our construction and the general lower bound. What is the correct base for the exponent? 2. Let S = {(d/p)G : G is a digraph} be the set of values arising as a ratio (d/p). We have shown that S ⊆ [0, 1/2] and that S is dense in [0, 1/e] (by taking the appropriate Erd˝os–Renyi graphs). Is S dense in [0, 1/2]? If so, is S equal to [0, 1/2] ∩ Q? 3. What can be said about (d/p) for regular directed graphs with degree greater than n/2, but much less than n?

References

[1] Noga Alon and Joel H Spencer. The probabilistic method. John Wiley & Sons, 2004. [2] Lev Meerovich Br`egman.Some properties of nonnegative matrices and their permanents. In Doklady Akademii Nauk, volume 211, pages 27–30. Russian Academy of Sciences, 1973.

[3] Pete L. Clark. Graph derangements. Open Journal of Discrete Mathematics, 3(4):183, 2013. [4] Georgii Petrovich Egorychev. The solution of van der Waerden’s problem for permanents. Advances in Mathematics, 42(3):299–305, 1981.

[5] Dmitry I Falikman. Proof of the van der Waerden conjecture regarding the permanent of a . Mathematical Notes, 29(6):475– 479, 1981. [6] Alan Frieze and Mark Jerrum. An analysis of a Monte Carlo algorithm for estimating the permanent. Combinatorica, 15(1):67–83, 1995.

[7] Svante Janson. The numbers of spanning trees, Hamilton cycles and perfect matchings in a random graph. Combinatorics, Probability and Computing, 3(1):97–126, 1994. [8] L´aszl´oLov´aszand Michael D Plummer. Matching theory, volume 367. Amer- ican Mathematical Soc., 2009. [9] Stephen G Penrice. Derangements, permanents, and christmas presents. The American mathematical monthly, 98(7):617–620, 1991.

16