Asymptotic enumeration of orientations of a graph as a function of the out-degree sequence∗

We prove an asymptotic formula for the number of orientations with given outdegree (score) sequence for a graph G. The graph G is assumed to have average degrees at least n1/3+ε for some ε > 0, and to have strong mixing properties, while the maximum imbalance (out-degree minus in-degree) of the orientation should be not too large. Our enumeration results have applications to the study of subdigraph occurrences in random orientations with given imbalance sequence. As one step of our calculation, we obtain new bounds for the maximum likelihood estimators for the Bradley-Terry model of paired comparisons. Mathematics Subject Classifications: 05C88, 05C89 ∗This research is supported by the Australian Research Council, Discovery Project DP140101519. The first author’s research is also supported by Australian Research Council Discovery Early Career Researcher Award DE200101045. the electronic journal of combinatorics 27(1) (2020), #P1.26 1


Introduction
Let G be an undirected simple graph with vertices {1, 2, . . . , n}. An orientation of G is an assignment of one of the two possible directions to each edge, thereby making an oriented graph G. The imbalance (sometimes called excess) of a vertex v ∈ V ( G) is b v := outdeg(v) − indeg(v), and the imbalance sequence of G is b = b( G) := (b 1 , . . . , b n ). If b( G) = 0, then G is called an Eulerian orientation of G.
Our primary aim in this paper is to find the asymptotic number of orientations of G with given imbalance sequence. In solving this enumeration problem, we will apply the saddle point method to a suitable generating function, using Cauchy's Theorem while following the general framework outlined in [12]. In the process, we will use results from the theory of paired comparisons, uncovering an interesting link between mathematical statistics and enumerative combinatorics.
In order to apply the saddle point method to enumerate the number of orientations, we will use the standard parameters in the Bradley-Terry model of paired comparisons. This model was first studied by Zermelo in 1929 [24], and independently by Bradley and Terry [3], Ford [5], Jech [14] and many others. See, for example, Hunter [9] for a general treatment. Contestants in a competition carried out by pairwise comparisons are assumed to have "merits" r = (r 1 , . . . , r n ) such that contestant j defeats contestant k with probability λ jk = λ jk (r) := r j r j + r k . (1.1) Note that λ jk + λ kj = 1; i.e., ties are not allowed. The statistical problem is then to estimate the merits from the scores (the number of comparisons won by each contestant), after which the merits can be taken as a measure of the strength of each contestant. Each of the above authors noted that the maximum likelihood estimate of the merits given the scores is (up to multiplication by a constant factor, since only the ratios matter) the solution of the "balance equations" k:jk∈G r j − r k r j + r k = k:jk∈G (λ jk − λ kj ) = b j , 1 j n. (1.2) Zermelo [24] proved that (1.2) has a unique solution if the digraph defined by the results of each comparison is strongly connected. We generalise this in Theorem 7, using the fact, earlier noticed by Joe [15], that (1.2) corresponds to the point maximising a certain entropy. As a result of equation (1.2), the values {r j } are the squares of the radii of circles whose direct product passes through the saddle point of a generating function in n-dimensional complex space; see Section 3. If we orient each edge jk independently towards k with probability λ jk and towards j with probability λ kj , then, as we will prove in Lemma 5, the probability of a particular orientation depends only on its imbalance sequence. Because of this, it makes sense to choose r = (r 1 , . . . , r n ) so that the expected imbalances in the induced orientation equal some sequence b of interest.
This gives the equations (1.2). Note that if r satisfies (1.2), then so does cr for any constant c > 0. In the case of Eulerian orientations, a solution is r = (1, . . . , 1), which gives λ jk = 1 2 for all jk ∈ G. A special case of our problem is enumeration of tournaments with given scores. Some of the first results go back to Spencer in 1974 [23], who gave an estimate of the number of tournaments with a given imbalance sequence. More precise results were given in [16] and [18] based on the complex-analytic approach. This technique was applied in [7] to asymptotically enumerate the number of tournaments containing a given small digraph. The method was further generalised in [10,11] to calculate the number of Eulerian orientations for a large class of dense graphs with strong mixing properties. In this paper we extend all of the aforementioned results allowing much sparser graphs and much more variation in the imbalances of vertices.
Note that counting orientations with a given imbalance sequence of a bipartite graph corresponds to counting its subgraphs with fixed degree sequence (take all edges which go into one of the parts). Equivalently, we can count 0-1 matrices with given margins where some set of entries are forced to be 0. This question goes back to Read [22] in 1958, who derived a formula for the number of 3-regular bipartite graphs. For more recent asymptotic results, see, for example, [2,4,8,17] and references therein. Our formula applied to the bipartite case significantly improves known results for this enumeration problem as well.
The Cheeger constant (or isoperimetric number) of a graph G, denoted by h(G), is defined as follows.
where ∂ G U is the set of edges of G with one end in U and one end in V (G) \ U . The number h(G) is a discrete analogue of the Cheeger isoperimetric constant in the theory of Riemannian manifolds and it has many interesting interpretations (for more detailed information see, for example, [20] and the references therein). Let I denote the identity matrix, and let J denote the matrix with every entry 1; in each case of order n. Define the symmetric positive-semidefinite matrix L = L(G, b) by for x = (x 1 , . . . , x n ) T ∈ R n , and further define

4)
the electronic journal of combinatorics 27(1) (2020), #P1.26 X := an n-dimensional normally distributed random variable with density π −n/2 |A| 1/2 e −x T Ax , , (1.5) where E Z and Var Z stand for the expectation and the variance of a random variable Z. In the following theorem, a pair (G, b) stands for a sequence of graphs and imbalance sequences (G(n), b(n)) parametrised by a positive integer n. Statements involving n and ε hold if n is sufficiently large and ε is sufficiently small. Throughout the paper, the asymptotic notations o( ), O( ), Ω( ) have their usual meaning. Theorem 1. Let G be a graph with n vertices and maximum degree ∆. Let b be the imbalance sequence for some orientation of G. Assume the following hold as n → ∞.
A3. Equations (1.2) have a solution r = (r 1 , . . . , r n ) such that Adopt all the definitions in (1.4) and (1.5). Then the number of orientations of G with imbalance sequence b is Note that R 3 ∆ −3/2+ε/2 n = O(n −1/2+ε ) by assumption A3 so the error terms in (1.6) are always vanishing. In the particular case of Eulerian orientations, R = 0.
The quantities P (G, b) and ∆ 1/2 n 1/2 |A| −1/2 have interesting interpretations. First, P (G, b) is the probability of each orientation with imbalance sequence b in the Bradley-Terry model, as we indicate in Lemma 5. Second, suppose each edge jk of G is assigned weight 2λ jk λ kj and each spanning tree of G is assigned weight equal to the product of the weights of its edges. Define κ(G, r) to be the sum over all weights of spanning trees in G. Note that the eigenvalues of A are ∆ (from the term ∆ n J) together with the non-zero eigenvalues of L. Therefore, using the Matrix-Tree Theorem (for example, [21, Theorem 5.2]), we get The quantities E f 4 (X), E f 6 (X), Var f 3 (X), and Var f 4 (X) defining ψ(G, b) can be calculated by inverting the matrix A and using Isserlis' formula; see Lemma 13. Their growth rates are given in the next lemma. Note that if ∆ n 1/2+ε and r j /r k 1 + ∆ 1/2 n −1/2+ε for all j, k then E f 6 (X), Var f 3 (X), Var f 4 (X) are vanishing while E f 4 (X) can be explicitly approximated in terms of the degrees of the graph G.
For the case when b = 0, we solve (1.2) by setting r 1 = · · · = r n . Thus, Theorem 1 and Lemma 2 immediately give an asymptotic formula for the number of Eulerian orientations. This formula was previously known only for the dense range ∆ = Ω(n); see [11].
Corollary 3. Let G = G(n) be a graph with even degrees d 1 , . . . , d n , satisfying assumptions A1 and A2 of Theorem 1. Then the number of Eulerian orientations of G is where κ(G) is the number of (unweighted) spanning trees.
We prove Theorem 1 and Lemma 2 in Section 3.3. Applications of these results include estimating the probability for a uniform random orientation with given imbalance sequence to contain a prescribed subdigraph. For example, one might be interested in estimating the chance that a team A has defeated both teams B and C in a tournament given the scores of all the teams. We give a simple demonstration of such an application in Section 4 (for Eulerian orientations).
In Section 2 we study equations (1.2). We provide necessary and sufficient conditions for the existence and the uniqueness (up to scaling) of the solution and find an explicit bound on the ratios {r j /r k }. In particular we obtain a simple sufficient condition for assumption A3 of Theorem 1 to hold, stated below.
then assumption A3 of Theorem 1 holds with Throughout the paper · p stands for the standard vector norm or for the corresponding induced matrix norm. The proof of Theorem 4 is given at the end of Section 2.

The Bradley-Terry model of orientations
In this section we explore the existence and nature of solutions to the balance equations (1.2). Except in the proof of Theorem 4, we do not require assumptions A1-A3 in the electronic journal of combinatorics 27(1) (2020), #P1.26 this section. Some of the techniques used in this section follow those of Barvinok and Hartigan [2].
Consider a graph G and for each edge jk ∈ G choose numbers p jk , p kj with 0 p jk , p kj 1 and p jk + p kj = 1. Now independently orient each edge jk towards k with probability p jk and towards j with probability p kj . We call this a random orientation of G with parameters {p jk }. It is degenerate if some p jk equals 0 or 1. It is conditionally uniform if, for every orientation G of G, all the orientations of G with the same imbalances as G have the same probability.
Lemma 5. A non-degenerate random orientation of G with parameters {p jk } is conditionally uniform if and only if there exists r ∈ R n + such that p jk = λ jk (r) for all jk ∈ G, where (λ jk ) are given by (1.1).
Proof. Let b be the imbalance sequence of an orientation G. Then, for a random orientation with parameters (λ jk ), G occurs with probability P (G, b) (whether or not (1.2) holds). This proves uniformity.
Conversely, suppose that the non-degenerate random orientation with parameters {p jk } is conditionally uniform. Assume that G is connected (otherwise, apply the following argument to each component).
Take a spanning tree T , and assign a number r j to each vertex j as follows. First, r 1 := 1. Then, for j = 1, let 1 = v 0 , v 1 , . . . , v s = j be the unique path from 1 to j in T .
Then, using this r to define the parameters (λ jk ), we can now check that p jk = λ jk for jk ∈ T . Consider an edge jk ∈ G \ T and let u 0 , u 1 , . . . , u s = u 0 be the unique cycle in G that contains jk and otherwise only edges of T . Let G be any orientation of G in which this cycle is a directed cycle. Since reversing the edges on the cycle gives the same imbalance sequence as G, uniformity implies that s t=1 p u t−1 ut = s t=1 (1 − p u t−1 ut ). Then, by the definition of r, we get that p jk 1−p jk = r j r k . This implies that p jk = λ jk , and the proof is complete. In addition, b is the expected imbalance sequence of some non-degenerate random orientation if and only if (2.1) holds and is strict for every U that is not a union of connected components of G.
Proof. In order to prove the lemma, we consider an equivalent network flow problem, and apply the max-flow min-cut theorem of Ford and Fulkerson [6]. To this end, given G we define an auxiliary flow network (F, c, s, t) with source s and sink t, such that where we have used j d j = 2|E(G)| and j b j = 0. By (2.2) and the max-flow min-cut theorem ( [6], Theorem 1), there is a flow ϕ : holds. Such a flow saturates all the edges incident to s or t, so from each vertex j ∈ V (G), the net flow on the arcs between j and other vertices in where N (j) is the set of neighbours of j in G. Now, for jk ∈ G, define {p jk } by ). Note that p jk + p kj = 1 for any jk ∈ G and, by (2.3), the random orientation with parameters {p jk } has expected imbalance sequence b. This proves the first equivalence.
For the second part, suppose that b is such that (2.1) holds and is strict for any U such that ∂ G (U ) = ∅; that is, it is not a union of connected components of G. Then, there is some ε with 0 < ε < 1 2 such that By the first part of this lemma, there exists a (possibly degenerate) random orientation of G with parameters {p jk } and expected imbalance sequence b . Now define {p jk } by p jk := ε + (1 − 2ε)p jk for jk ∈ G, and note that we still have p jk + p kj = 1 and k∈N (j That is, {p jk } are non-degenerate parameters with expected imbalance sequence b. Conversely, note that any random orientation of G with parameters {p jk } induces a maximum flow φ on the network, by setting ϕ(j, k) = p jk , and assuming the flow is at maximum capacity on arcs incident to s or t. But, now, if equality occurs in (2.1) for some U that ∂ G (U ) = ∅, then the cut ({s} ∪ U, (V (G) \ U ) ∪ {t}) is saturated by any flow of value 2|E(G)|, so the edges crossing it must have flow 1 in one direction and 0 in the other. In particular, this implies that the probabilities corresponding to flows on arcs across the cut must be degenerate.
with the inequality being strict for any U that is not the union of connected components of G. Then there exists r = (r 1 , . . . , r n ) ∈ R n , unique up to uniform scaling in each connected component of G, such that the random orientation of G with parameters (λ jk ) given by (1.1) has expected imbalance sequence b.
Proof. Consider a random orientation of G with parameters {p jk }. We view these parameters as a vector p ∈ [0, 1] 2|E(G)| , and let S be the set of possible directed edges jk in an orientation of G. Then, since the edges of G are oriented independently, the entropy function corresponding to this orientation is given by with the usual convention that the terms corresponding to 0 log 0 are 0. This is a continuous function on a compact set, thus there exists a maximiser p. Next, we show by contradiction that p is non-degenerate. Assume otherwise. Note that by Lemma 6, there exists a non-degenerate p for which the expected imbalance sequence is b. Let A be the set of directed edges jk such that p jk = 0. Then, for ε ∈ (0, 1), Using the strict concavity of the function Using the fact that H(p) = − jk∈S\A p jk log p jk , this yields the lower bound Now, for ε sufficiently small, the bracketed term on the right can be made negative, which implies H((1 − ε)p + εp ) > H(p), a contradiction.
Denoting Lagrange multipliers by {β j }, definẽ and consider this is a function of |E(G)| variables p jk for jk ∈ G, where one of p jk and p kj is arbitrarily chosen and the other is determined by p jk + p kj = 1. The partial derivatives satisfy the electronic journal of combinatorics 27(1) (2020), #P1.26 By setting these partial derivatives to 0, we find that the maximiser p satisfies so that if we set r j = e β j for 1 j n, the corresponding random orientation has parameters (λ jk ) as defined by (1.1). Moreover, by the strict concavity of the entropy function, on the convex, compact set corresponding to the equality constraints, the maximiser p is unique. This implies by (2.4) that for jk ∈ G the ratios r j /r k are unique, so that the r j are unique up to uniform scaling in every connected component of G.
Lemma 8. Let G be a connected graph of maximum degree ∆. Let b ∈ R n and 0 < δ 1 be such that j b j = 0 and Then, for n 10, every solution r of the system (1.2) is such that, for all j and k, We defer the proof of Lemma 8 until Section 5.1.
By assumptions, we can bound Thus, we get that This completes the proof of that assumption 3 holds.

Enumeration
The Laplacian matrix of G is the symmetric matrix given by the diagonal matrix of degrees minus the adjacency matrix of G. Since the row sums of this matrix are zero, it has a zero eigenvalue corresponding to an eigenvector with all components equal. The next smallest eigenvalue, λ 2 (G), is called the algebraic connectivity of G and is closely related to the Cheeger constant.
(a) The minimum degree of G is at least γ∆.
Proof. Part (a) follows from the trivial fact that h(G) cannot be larger than the minimum degree. Part (b) follows from Lemma 9. Part (c) is a simple consequence of A3.
Let N (G, b) be the number of orientations of G with imbalance sequence b. By Cauchy's integral formula, using the generating function jk∈G where the contours circle the origin once anticlockwise. We choose the circles x j = r 1/2 j e iθ j as contours, so that the electronic journal of combinatorics 27(1) (2020), #P1.26 It is easily seen that | · | π is a seminorm on R that induces a norm on R/π, the real numbers modulo π. An interval of R/π of length ρ 0 is a set of the form I(x, ρ) := {ξ ∈ R/π : |x − ξ| π 1 2 ρ}. We will also write I(x, ρ) as [x − 1 2 ρ, x + 1 2 ρ] when it is not ambiguous. Next, note that any individual value θ j can be replaced by θ j + π without changing F (θ), since in every orientation the imbalance of a vertex has the same parity as its degree in G. This means we can write We will approach (3.3) by splitting the region of integration (R/π) n in several parts. Let In other words, the region Ω 0 consists of those θ ∈ (R/π) n such that all components θ j can be covered by an interval of R/π of length at most ∆ −1/2 log 4 n. It will turn out that J 0 will dominate J , and that in the complement of Ω 0 even the integral of |F (θ)| is negligible.

The integral inside Ω 0
We are going to apply the techniques developed in [12]. For any c, define U n (c) = I(0, c) n . The assumptions of Theorem 1 hold throughout this section. First note that, since j b j = 0, we can uniformly translate each θ j without changing F (θ). Also, {θ ∈ (R/π) n : |θ j − θ n | π ∆ −1/2 log 4 n, 1 j n−1} Therefore, if we define θ = (θ 1 , . . . , θ n−1 , 0), we have an (n−1)-dimensional integral: Next we lift the integral back to full dimension using [12, Lemma 4.6], which we quote for convenience as Lemma 31. Let M be the matrix with 1 in the last column and 0 elsewhere. Define: the electronic journal of combinatorics 27(1) (2020), #P1.26 One can easily check that P Q + SW = I, and also that ker Q ∩ ker W = {0}, ker Q has dimension 1 and span(ker Q, ker W ) = R n . We also have |Q T Q + W T W | = n∆, κ = 1, P ∞ 2, Q ∞ = 2, S ∞ = ∆ −1/2 and W ∞ = ∆ 1/2 . Now applying [12,Lemma 4.6], and the fact that F (θ) is invariant under translating each coordinate, we have where Ω is a region such that U n ( 1 2 ∆ −1/2 log 4 n) ⊆ Ω ⊆ U n (5∆ −1/2 log 4 n) and Lemma 11. For θ ∈ Ω, we have where Proof. Note that the definitions of f jk in (3.2) and λ jk in (1.1) imply that By Taylor's Theorem and Lemma 10, for |x| ∆ −1/2 log 4 n, we have Summing log f jk (θ j − θ k ) over jk ∈ G, and subtracting i n j=1 b j θ j , we find that the linear term cancels because of (1.2) and the error term is as stated because of Lemma 10(c).  We will also use the following simple applications of Isserlis' formula [13].
Lemma 13. Let Z and (Z 1 , Z 2 ) be normal random variables with zero mean. For integer m, let p(m) be the number of ways to divide m things into m/2 pairs (i.e., 0 for odd m and (m − 1)!! for even m). Then, for integers s, t 0, Let X = (X 1 , . . . , X n ) be a random vector with normal density π −n/2 |A| 1/2 e −x T Ax . The covariance matrix of X is (σ jk ) = (2A) −1 . For jk ∈ G, define Y jk := X j − X k . Then the vector Y := (Y jk ) jk∈G also has a normal density with zero mean; let Σ = (ς jk,j k ) denote its covariance matrix.
Lemma 14. We have the following.
(a) For jk, j k ∈ G, the electronic journal of combinatorics 27(1) (2020), #P1.26 Proof. Part (a) follows from Lemma 12(b). For (b), note that n j =1 σ jj (2A) −1 ∞ and that there at most ∆ choices of k for each j . The other terms are similar, so the result follows on applying Lemma 12(a). Part (c) follows from Part (a) and Lemma 13(a). We use Lemma 13(b) for Part (d): bound all variances and covariances except Cov(Y jk , Y j k ) by O(∆ −1 ) (on account of Part (a)) and then using Part (b) to bound the sum of these terms over j k ∈ G.
We will also need the following bound.
Proof. Revisiting the proof of Lemma 15, note that the difference between the integrals of F (θ) and |F (θ)| came only from f im (x) and amounted to a factor of e o(log n) . This implies the first equality.
Observe that all of the eigenvalues of A −1 are bounded below by A −1 ∞ and bounded above by A −1 ∞ . Using Lemma 12(a), we find that |A| −1/2 = e O(n log n) . The remaining factors in the expression for J 0 in Lemma 15 are also e O(n log n) . The bounds E f re (X), Var f 3 (X), Var f 4 (X) = O(n log n) follow by assumption A3, applying Lemma 14. Thus, we get the second equality from the first.

The integral outside Ω 0
The conditions of Theorem 1 are assumed throughout this section. We begin with a few lemmas.
Proof. Consider any of the paths v 0 , v 1 , . . . , v provided by Lemma 30. By assumption, |θ v 0 − θ v | π x. Since = O(log n) and | · | π is a seminorm, we find that Multiplying the bound (3.7) over all the edges of all the paths given by Lemma 30 completes the proof.
First, we bound the integral of |F (θ)| in the region Ω 1 := θ ∈ (R/π) n : for every ξ ∈ R/π we have |{j : θ j ∈ I(ξ, ρ small )}| < 4 5 n . Lemma 19. Suppose 0 < t < 1 3 π and q 1 5 n. Let X = {x 1 , . . . , x n } be a multisubset of R/π such that no interval of length 3t contains n − q or more elements of X. Then there is some interval I(x, ρ), ρ < 1 3 π, such that both I(x, ρ) and R/π − I(x, ρ + t) contain at least q elements of X. Proof. Since the conditions and conclusion are invariant under translation, we can assume without loss of generality that [t, 2t] is an interval with the greatest number of elements of X out of all intervals of length t. Since R/π − [0, 3t] has at least q elements of X by assumption, [t, 2t] satisfies the requirements of the lemma unless it contains less than q elements of X.
Therefore, assume that all intervals of length t have less than q elements of X. For 0 y π − 3t, let φ(y) be the number of elements of X that lie in [t, 2t + y]. Note that φ(y) is a non-decreasing step function with steps of size less than q, also that φ(0) < q and φ(π − 3t) > n − 2q. Therefore, there is some y such that 1 2 n − 3 2 q φ(y) 1 2 n − 1 2 q. It can now be checked that [t, 2t + y] satisfies the lemma.
Lemma 20. We have Proof. If θ ∈ Ω 1 , the definition of Ω 1 implies that every interval of R/π of length ρ small has fewer than 4 5 n components of θ. Applying Lemma 19 with t = 1 3 ρ small , q = 1 5 n, and X = θ tells us that there exist p ∈ R/π and s < π 3 such that both I(p, s) and R/π − I(p, s + t) contain at least 1 5 n components of θ. For such θ, Lemma 18, with x = t and U, U corresponding to the indices of the elements of θ belonging to I(p, s) and R/π − I(p, s + t) respectively, tells us that |F (θ)| exp −Ω(1)∆t 2 n log −2 n = e −Ω(n log 2 n) . Using π n as a bound on the volume of Ω 1 , the result follows from Lemma 16.
Lemma 21. We have Proof. The volume of Ω 2 is only e −Ω(n log 3 n) , so the bound |F (θ)| 1 is adequate in conjunction with Lemma 16.
For disjoint U, W ⊆ V (G) define by Ω U,W the set of θ ∈ (R/π) n for which there exists some x ∈ R/π and ρ with ρ small ρ ρ big such that the following hold: (i) θ j ∈ I(x, ρ small ) for at least 4n/5 components θ j .
where the union is over all disjoint U, W ⊂ V (G) with 1 |U | n/5 and |W | |U |/ log n. Proof. Any θ ∈ (R/π) n − Ω 1 is such that at least 4n/5 of its components θ j lie in some interval I(x, ρ small ). Suppose it is not covered by any Ω U,W . For 1 k log 2 n, take ρ = kρ small ρ big and let U correspond to the components not in I(x, ρ + ρ small ). Since (iii) cannot hold, we get Recalling that |{j : θ j / ∈ I(x, ρ small )}| n/5, we can apply this ratio repeatedly starting with k = 1 to find that This implies that θ ∈ Ω 0 , which completes the proof.
the electronic journal of combinatorics 27(1) (2020), #P1.26 Note that the map φ is injective, since I(z, ξ) can be determined from {φ j } j∈X = {θ j } j∈X . Also, φ is analytic except at places where the map from {θ j } j∈X to (z, ξ) is nonanalytic, which happens only when two distinct components θ j , θ j for j, j ∈ X lie at the same endpoint of I(z, ξ). Thus, the points of non-analyticity of φ lie on a finite number of hyperplanes, which contribute nothing to the integral. To complete the calculation, we need to bound the Jacobian of the transformation φ in the interior of a domain of analyticity.
We have if j = k and either j ∈ X or k / ∈ X.
Although we have not specified all the entries of the matrix, these entries show that the matrix is triangular, and hence the determinant has absolute value ξ π−ξ |U |+|W | , which is

Proofs of Theorem 1 and Lemma 2
Proof of Theorem 1. The number of orientations in terms of the integral J appears in (3.3). That integral restricted to the region Ω 0 is J 0 , evaluated in Lemma 15. This gives the expression in Theorem 1 so it remains to show that the other parts of the integral fit into the error terms given there. The integral in Ω 1 ∪ Ω 2 is bounded in Lemmas 20 and 21. The remaining parts of J are bounded by the sum of Lemma 23 over disjoint U, W ⊂ V (G) with 1 |U | 1 5 n and |W | |U |/ log n. The number of choices of W for given U is less than 2 |U | , so the total contribution here is which is easily small enough.

Probability of subdigraph occurrence
Let H be a spanning subgraph of G, and let H be an orientation of H with imbalance sequence b . Then is the probability that a uniform random orientation of G with imbalances b contains H as a subdigraph. Consequently, Theorem 1 gives this probability asymptotically provided both the numerator and the denominator satisfy the conditions of that theorem. We will not explore this issue further in this paper except for the case that b = b = 0; i.e., both orientations are Eulerian.
Theorem 24. Let G be a graph with even degrees d 1 , . . . , d n and let H be a spanning subgraph of G with even degrees h 1 , . . . , h n . Define m = 1 2 n j=1 h j , and assume that where ∆ is the maximum degree of G. Also assume that there is a constant γ > 0 such that h(G \ H) γ∆. Then, for any fixed Eulerian orientation H of H, the probability that a random Eulerian orientation of G includes H is Proof. We will evaluate (4.1) using Corollary 3. Note that h(G \ H) γ∆ implies h(G) γ∆, so assumption A2 is satisfied by both numerator and denominator. Furthermore, h(G \ H) γ∆ implies that h j (1 − γ)d j for 1 j n.
First, we have Next we consider the ratio κ(G \ H)/κ(G), which equals the ratio |A |/|A|, where A is defined as in (1.4) and A is the corresponding matrix for G \ H. As in the proof of Lemma 2, we have A −1 = Λ + X, where Λ = diag(2/d 1 , . . . , 2/d n ) and X = (x jk ) with the electronic journal of combinatorics 27(1) (2020), #P1.26 . . , h n /2) and Y = (y jk ) with y jk = 1 2 for jk ∈ H and y jk = 0 otherwise. We have The Frobenius norm U F of U = (u jk ) is defined by U 2 F = jk |u jk | 2 . By subadditivity, where the last equality follows from the theorem assumptions. Thus, U F = o(1). Schur's Inequality [25, p. 50] says that j |λ j | 2 U 2 F , where {λ j } are the eigenvalues of U , so By the definition of U and the above bound on the entries of X, tr U = O(∆ −2 m log 2n ∆ ). Thus, |I + U | = exp O(∆ −2 (m + n) log 2n ∆ ) , which completes the proof.

Corollary 25.
Under the conditions of the theorem, if G has N H hamiltonian cycles, then the expected number of directed hamiltonian cycles in a random Eulerian orientation of G is the electronic journal of combinatorics 27(1) (2020), #P1.26

Appendix
Here we will collect some technical lemmas that are used in the proof. This section is self-contained and does not rely on assumptions other than those stated. Now we will construct S. By applying equation (5.1) for s = 1, we can start with S = {1k}, where 1k ∈ H and k 1 + ηh(G) 1+η . From here we proceed recursively. Suppose we have edges covering [1, ] (in the sense of (ii)), where < n/2. Applying (5.1) to {1, . . . , } and recalling that all vertices have degree at most ∆, there must be at least ηh(G) (1+η)∆ vertices in { + 1, . . . , n} that in H have neighbours in {1, . . . , }. So there is some k 1 + ηh(G) (1+η)∆ such that jk ∈ H for some j . Adding this edge to S means that we have covered [1, k]. Continuing in this manner, we will have covered [1, n/2] while S has at most Proof of Lemma 8. Without loss of generality we may assume r 1 . . . r n . We employ Lemma 26, where for any jk ∈ G we take j < k and define w jk by w jk := r j − r k r j + r k = λ jk − λ kj 0.
Note that jk∈∂ G {1,...,s} w jk = s j=1 b j . Thus, by assumptions, we getw 1 − δ. Take η = δ and consider the set S constructed in Lemma 26. For w jk (1 + η)w, we have log Also, observe that By [20,Thm. 2.2], for n 10 we have h(G) n/2 n−1 ∆ 3 5 ∆ and also h(G) h(K n ) 6 11 n. Now we can calculate where In each case the bounds on the right hand side follow from the fact that the supremum occurs as δ → 1 and h(G) has the greatest allowed value. Then, from property (ii) of Lemma 26 and (5.2), we find that where jk ∈ S in the sum is ordered as j < k. The result follows on applying the above numerical bounds.

Matrices and norms
Lemma 27. Let L be a symmetric matrix with nonpositive off-diagonal elements and zero row sums. Suppose the eigenvalues of L are 0 = µ 1 < µ 2 · · · µ n . For any real α, define the matrix L α † by L α † x = µ α 2 v 2 + · · · + µ α n v n , where x = v 1 + · · · + v n is the decomposition of x as a sum of eigenvectors of L (numbered consistently with the eigenvalues). Then Proof. Let X := I − (2 L ∞ ) −1 L. The eigenvalues of X are 1 = ν 1 > ν 2 · · · ν n , where ν j = 1 − (2 L ∞ ) −1 µ j for each j. Since |ν j | < 1 for 2 j n, we have where we have used the fact that v 1 = 1 n Jx. We will now find two different bounds on X k (I − 1 n J) ∞ . First note that X ∞ = 1 so X k (I − 1 n J) ∞ I − 1 n J ∞ < 2. Second, the maximum eigenvalue of X k (I − 1 n J) is ν k 2 , so X k (I − 1 n J) ∞ √ n X k (I − 1 n J) 2 √ n ν k 2 . Combining these two bounds completes the proof. Corollary 28. For c > 0, consider the positive-definite matrix A := c n J + L, where L satisfies the conditions of Lemma 27 with ν 2 = 1 − (2 L ∞ ) −1 µ 2 . Then, for any real α −1, the positive-definite power A α satisfies where N = |α| + log ν 2 n −1 .
Proof. Since A has the same eigenvectors as L, and the same eigenvalues except that 0 has been replaced by c, we have Now we can apply the Lemma in the obvious way, using √ n ν k 2 n −1/2 ν N −k 2 for k N and α k In some cases we can improve on Corollary 28. We will only use a bound on A −1 ∞ .
Lemma 29. Let G be a connected graph of maximum degree ∆. Let L = ( jk ) be a symmetric matrix with zero row sums such that, for j = k, jk = 0 if jk / ∈ G and jk < − min if jk ∈ G, for some min > 0. Define A := c n J + L for c > 0. Then, if n 10, Proof. As in Corollary 28, we have is defined in Lemma 27. Moreover, where the maximum is taken over x = 0 such that x 1 + · · · + x n = 0. Permuting L if necessary, we can assume that the maximum occurs for x with x 1 · · · x n . Let y = (y 1 , . . . , y n ) := Lx, and for jk ∈ E(G) and j < k, put w jk := − jk (x j − x k ). Observe that, for 1 j n, from which it follows that for 1 s n, Thus, definingw as in Lemma 26, we have Lx ∞ h(G)w. Since x 1 + · · · + x n = 0, we have x 1 − x n x ∞ . Taking the set S of edges guaranteed by Lemma 26 with η = 1, we find that
To complete the numerical bound, continue as in the proof of Lemma 8; we omit the uninteresting details.
Then, there exist at least γ∆ pairwise edge-disjoint paths in G with one end in U 1 and the other end in U 2 of lengths bounded above by (U 1 , U 2 ).
Proof. Let n be the number of vertices of G. Denote u := min{|U 1 |, |U 2 |}. Without loss of generality we may assume that |U 1 | = |U 2 | = u because we can always remove some vertices from the larger set. We call a path short if it has length at most (U 1 , U 2 ). For a subgraph H denote Starting from H = G, we construct the required set of short paths by repeating the following procedure.
Add P to the set of constructed paths. Delete the edges of P from H and repeat from (1).
Suppose, we found fewer than γ∆u 2 (U 1 ,U 2 ) paths by the procedure above, so that, in particular, we deleted less than γ∆u/2 edges. Therefore, for any U such that u |U | n/2, Therefore, we can reach more than n/2 vertices starting from U 1 (or from U 2 ) by paths of length at most log 1+γ/2 n 2u . Alternatively, since |N (U 1 )| γ∆/2, we can reach more than n/2 vertices starting from N (U 1 ) by paths of length at most log 1+γ/2 n γ∆ (and the same holds for U 2 ). Therefore, we can find a vertex which is not too distant from both U 1 and U 2 and construct the required short path P Our procedure will stop at some moment since G is finite. As shown above, this can only happen after we found at least γ∆u 2 (U 1 ,U 2 ) edge-disjoint short paths from U 1 to U 2 . This completes the proof.

Integration theorem
For the reader's convenience, we quote [12,Lemma 4.6] and [12,Theorem 4.4] with very minor changes to match the notations of this paper.
If T : R n → R n is a linear operator, let ker T := {x ∈ R n : T x = 0}.
Lemma 31. Let S, W : R n → R n be linear operators such that ker S ∩ ker W = {0} and span(ker S, ker W ) = R n . Let n ⊥ denote the dimension of ker S. Suppose Ω ⊆ R n and F : Ω ∩ S(R n ) → C. For any ρ > 0, define Ω ρ := x ∈ R n : Sx ∈ Ω and W x ∈ U n (ρ) .
For a domain Ω ⊆ R n and a twice continuously-differentiable function q : Ω → C, define H(q, Ω) = (h jk ), where h jk := sup For a complex number z we denote by (z) and (z) the real and imaginary parts, respectively.
Let Ω be a measurable set such that U n (ρ 1 ) ⊆ T −1 (Ω) ⊆ U n (ρ 2 ), and let f : R n → C, g : R n → R and ζ : Ω → C be twice continuously-differentiable functions. We make the following assumptions.