Turán Problems for k-Geodetic Digraphs

A digraph G is k-geodetic if for any pair of (not necessarily distinct) vertices u,v∈V(G)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$u,v \in V(G)$$\end{document} there is at most one walk of length ≤k\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\le k$$\end{document} from u to v in G. In this paper, we determine the largest possible size of a k-geodetic digraph with a given order. We then consider the more difficult problem of the largest size of a strongly-connected k-geodetic digraph with a given order, solving this problem for k=2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k = 2$$\end{document} and giving a construction which we conjecture to be extremal for larger k. We close with some results on generalised Turán problems for the number of directed cycles and paths in k-geodetic digraphs.


Introduction
Turán problems are a fundamental part of extremal combinatorics. Such a problem typically asks for the largest possible size of a graph G with a family F of forbidden subgraphs. When F consists of small cycles, this is equivalent to the girth problem. Erdős conjectured in 1975 that the largest possible size of a graph with order n and girth at least 5 is given by ( 1 2 + o(1)) 3/2 n 3/2 [12]; this conjecture remains open. Lazebnik and Ustimenko gave a construction of dense graphs with arbitrarily large girth in [19]; the latest computational results for the problem can be found in [1]. It is natural to extend this problem to directed graphs by asking for the largest possible size of a strongly connected digraph with order n and no directed cycles of length at most g. This problem was solved by Bermond, Germa and Heydemann in [4]. For the degree-restricted case, the well-known Caccetta-Häggkvist Conjecture states that the girth of a digraph with order n and minimum out-degree r is at most n r . Theorem 1 [4] Let D be a strongly connected digraph of order n, size m and girth g.
we must have g ≤ k. This bound is tight.
In this paper we consider an analogous problem using a different 'girth-like' parameter. A digraph G is k-geodetic if for any pair of not necessarily distinct vertices u, v there is at most one walk in G from u to v with length at most k. The geodetic girth of G is the largest value of k such that G is k-geodetic, when this value is defined (a bipartite graph has k-geodetic orientations for arbitrarily large k). By way of motivation, observe that all orientations of a graph with girth at least 2k +1 are k-geodetic. The geodetic girth is of interest in a directed analogue of the degree/girth problem [25]. A related problem was considered in the papers [17,18,20,28], which, for fixed k ≥ 2, determine the largest size of a digraph with given order such that, for each pair of vertices u, v, there is at most one u, v-walk with length exactly k.
In the papers [23,27], Shaska, Ustimenko and Kozicki prove that if f (n, k) is the largest size of a diregular k-geodetic digraph with order n, then for fixed k we have f (n, k) ∼ n k+1 k . They also give a family of digraphs, now known as the permutation digraphs, which meet this asymptotic bound. These digraphs were introduced in [13] and some further properties of these digraphs are given in [7]. For d, k ≥ 2 the permutation digraph P(d, k) is defined as follows. The vertices of P(d, k) are all permutations x 0 x 1 . . . x k−1 of length k of symbols from the set [d +k] = {0, 1, . . . , d + k −1}. A vertex x 0 x 1 . . . x k−1 has an arc to all permutations of the form x 1 x 2 . . . x k−1 x k for any x k / ∈ {x 0 , x 1 , . . . , x k−1 }. It is simple to verify that P(d, k) is diregular with outdegree d and is k-geodetic. The order of P(d, k) is n = (d + k)(d + k − 1) · · · (d + 1) and has size m = nd ∼ n k+1 k . We will see in the final section that these digraphs have other interesting extremal properties. The result of Ustimenko and Kozicki also holds in the more general setting of out-regular digraphs, using the following short argument.

Remark 2
For k ≥ 2 the largest size ex out (n; k) of an out-regular k-geodetic digraph with order n satisfies ex out (n; k) ∼ n k+1 k as n → ∞.
Proof It is known that the order n of a k-geodetic digraph with minimum out-degree d is bounded below by the directed Moore bound M(d, k) = 1 + d + d 2 + · · · + d k (see [22]). Hence n ≥ d k and, rearranging, d ≤ n 1/k . The size m of an out-regular k-geodetic digraph G with order n thus satisfies m = nd ≤ n k+1 k .
In this paper, we consider this problem without the restriction of diregularity. This problem can be put into the form of a forbidden subgraph problem, as every violation of k-geodecity in G can be identified with the occurrence of a specific subdigraph of G; in [27] these subdigraphs are referred to as 'hooves' or 'commutative diagrams'. In Sect. 2, we find the largest size of a k-geodetic digraph with given order n and classify the extremal digraphs. We then discuss the more difficult problem of finding the largest size of a strongly connected k-geodetic digraph; we solve this problem for k = 2 and give constructions that we conjecture to be extremal for larger k in Sect. 2. We classify the extremal digraphs for k = 2 in Sect. 3. Finally, in Sect. 4 we study some generalised Turán problems for k-geodetic digraphs. A few words concerning notation. If there is an arc in a digraph G from u to v, then we write u → v. The distance d(u, v) between vertices u, v of a digraph G is the length of a shortest directed path from u to v in G (or ∞ if no such path exists); note that we A vertex with out-degree zero is a sink and a vertex with in-degree zero is a source. For any other graph-theoretical terminology not defined here we follow [6].

The Largest Size of a k-Geodetic Digraph
In this section, we first classify the 2-geodetic digraphs with given order and largest size without the assumption of diregularity; the corresponding result for larger k follows immediately. We then solve the more difficult problem of the largest size of strongly connected 2-geodetic digraphs with given order and give upper and lower bounds for the extremal size for larger k. Theorem 3 For n ≥ 4, k ≥ 2, the largest size of a k-geodetic digraph with order n is n 2 4 . Proof Orienting all edges of the complete bipartite graph K n/2 , n/2 in the same direction yields a k-geodetic digraph for all 2 ≤ k ≤ 2; this gives the required uniform lower bound for each value of k. Equality is easily checked for 4 ≤ n ≤ 6.
For the upper bound, consider first the graph K − 4 consisting of the complete graph K 4 with one edge deleted. We claim that no graph containing a copy of K − 4 has a kgeodetic orientation for k ≥ 2. Suppose for a contradiction that a graph G contains two triangles x, y, z and x, y, z , where z = z . The only 2-geodetic orientation of a triangle is a directed 3-cycle, so we can assume that x → y → z → x and x → y → z → x; however there are now two distinct directed paths from y to x of length two, violating 2-geodecity. A simple inductive argument shows the well-known result [8,10] that for n ≥ 7, any graph with order n and size greater than n 2 4 contains a copy of K − 4 and the unique K − 4 -free graph with size n 2 4 is K n 2 , n 2 . As a k-geodetic digraph with k ≥ 3 is also 2-geodetic, the same upper bound applies for larger k. We, therefore, have equality for k ≥ 2 and n ≥ 4.
We now classify the 2-geodetic digraphs that meet the bound in Theorem 3.

Lemma 4 Let K be a 2-geodetic orientation of a complete bipartite graph K s,t with
partite sets X and Y , where s ≥ t ≥ 2. If x is any vertex of K that is neither a source nor a sink, then either d Proof Let x ∈ X be a vertex of K that is neither a source nor a sink. Suppose that d + (x) ≥ 2 and d − (x) ≥ 2. Let y ∈ Y be an out-neighbour of x such that y is not a sink. Hence y → x for some x ∈ X − {x}. If any other out-neighbour y of x has an arc to x , then we would have two 2-paths x → y → x and x → y → x , violating 2-geodecity, so it follows that x has arcs to every vertex of N + (x) − {y}. Any in-neighbour y − of x can already reach every vertex of N + (x) by a 2-path via x. As x has arcs to every vertex of N + (x) − {y}, it follows that x → y − for every in-neighbour y − of x. However, there are at least two such in-neighbours y − 1 and y − 2 by assumption, so there exist paths x → y − 1 → x and x → y − 2 → x, a contradiction. It follows that every out-neighbour of x in Y is a sink; and similarly, every inneighbour of x is a source. Let x * ∈ X − {x}. Then if y + ∈ N + (x), y − ∈ N − (x), we have two paths y − → x → y + and y − → x * → y + , which is impossible. Hence we must have either d Theorem 5 For n ≥ 7, the 2-geodetic digraphs with largest size are isomorphic to an orientation of K n 2 , n 2 with all arcs oriented in the same direction, except for a matching that is oriented in the opposite direction. The number of isomorphism classes of extremal digraphs is n + 1 for odd n ≥ 7 and n 2 + 1 for even n ≥ 8. Proof Let K be a 2-geodetic orientation of K n 2 , n 2 ; call the partite sets X and Y , where |X | ≥ |Y |. If X contains a source, then Y contains no sources and vice versa, so we can assume that any source of G lies in X . If X contains only sources, then we recover the construction in Theorem 3, so we can assume that X contains a vertex that is neither a source nor a sink. As K is 2-geodetic, X cannot contain both sources and sinks; for example if x 1 ∈ X is a source and x 2 ∈ X is a sink, then if y 1 , y 2 ∈ Y we have paths x 1 → y 1 → x 2 and x 1 → y 2 → x 2 , which is impossible.
Note that if all vertices are neither a source nor a sink, then both partitions contain a vertex which is neither a source nor a sink. If s = t = 2, then the result follows by Lemma 4, so we may assume that |Y | > 2 and X contains a vertex, say x 1 , which is neither a source nor a sink. By Lemma 4, any such vertex has either in-degree or out-degree one; without loss of generality, we assume that Suppose that X contains a vertex x with d + (x ) > 1. If x has two out-neighbours y , y ∈ Y − {y 1 }, then x → y → x 1 and x → y → x 1 would be two distinct x , x 1 -paths of length two. Hence we can assume that N + (x ) = y 1 , y for some y ∈ Y − {y 1 }. Therefore for any y ∈ Y − {y 1 , y}, we have y → x 1 and y → x , so that y has two paths of length two to y 1 , a contradiction. Applying Lemma 4, we have the desired result.
For even n, if the matching mentioned in Theorem 5 is chosen to be a perfect matching, then the resulting digraph is strongly connected; however, all of the extremal Fig. 1 A strongly connected digraph with n = 2r + 1 and m = r 2 + 2 for r = 4 with the triangle in bold digraphs in Theorem 5 for odd n contain either a source or a sink. It is therefore natural to ask for the largest size of a strongly-connected k-geodetic digraph with given order.

Definition 6
For n ≥ k + 1 and k ≥ 2, ex(n; k) is the largest possible size of a strongly-connected k-geodetic digraph with order n.
We now determine the exact value of ex(2r +1; 2); we classify the extremal digraphs for odd n in Sect. 3. Taking a strongly connected 2-geodetic digraph with order 2r and size r 2 and expanding one arc into a directed triangle shows that ex(2r +1; 2) ≥ r 2 +2 (this construction is shown in Fig. 1). We now show that this lower bound is optimal and that any 2-geodetic digraph with odd order and larger size contains either a source or a sink.
Theorem 7 For all r ≥ 1, we have ex(2r +1; k) = r 2 +2, and any 2-geodetic digraph with larger size contains a source or a sink. For r ≥ 3, the underlying graph of any 2-geodetic digraph G with order n = 2r + 1 and size m = r 2 + 2 that has no sources or sinks is isomorphic to a graph formed from a triangle T and a copy of K r −1,r −1 by joining every vertex in K r −1,r −1 to exactly one vertex of T .
Proof The result for r ≤ 2 follows easily by computer search, so we can assume that r ≥ 3. Let G be a 2-geodetic digraph with size m ≥ r 2 + 2 and H be the underlying undirected graph of G; then H is K − 4 -free. We will proceed to show that H contains a triangle with a special substructure.
Suppose that H is triangle-free. As the size of H is at least r 2 + 2, it follows by the stability results of [11,24] that H is bipartite. We will name the larger partite set X and the smaller Y . We claim that there are at least three vertices of X that are connected to every vertex of Y . Otherwise, setting t = |X |, the size of H is bounded above by Let X be the set of vertices in X that are adjacent to every vertex of Y , and let H be the complete bipartite subgraph of H with partite sets X and Y . By Theorem 5, all edges of H between X and Y are directed in the same direction with the exception of a matching M of size at most r in the opposite direction. Taking the converse of G if necessary, we can assume that the edges of M are directed from Y to X , with all other edges in the other direction. By assumption, G contains no sources or sinks, so every vertex of X must be incident with an edge of the matching M.
Therefore if two vertices y, y of Y have a common out-neighbour x, then there will be a vertex x ∈ X that has arcs to both y and y , and hence has two paths of length two to x, violating 2-geodecity. Hence the out-neighbourhoods of the vertices of Y are pairwise disjoint. No vertex of X is a source and so each vertex of X has at least one in-neighbour in Y . As |X | > |Y | there must be a vertex y ∈ Y that has (at least) two out-neighbours x 1 and x 2 in X . If x 1 and x 2 had a common out-neighbour y ∈ Y , then there would be two paths of length two from y to y , so we have Hence there are at most two arcs incident to {x 1 , x 2 }, and at most r − 1 arcs incident from {x 1 , x 2 }, so there are at most r + 1 arcs incident with x 1 or x 2 . If we delete x 1 and x 2 , we would thus obtain a 2-geodetic digraph with order n = 2(r − 1) ≥ 4 and size m , where contradicting Theorem 3. Therefore H contains a triangle T .
Let us label the vertices of T by x, y, z. As G is K − 4 -free every vertex of V (G) − T is adjacent to at most one vertex of T , so deleting T from G removes at most n = 2r +1 arcs. By Theorem 3, the size of G−T is at most (r −1) 2 . Thus m ≤ (2r +1)+(r −1) 2 = r 2 + 2, and equality holds only if G − T is an extremal digraph given in Theorem 5 and every vertex of H − T is adjacent to exactly one vertex of T .
We turn now to the question of the largest size of strongly-connected k-geodetic digraphs for k ≥ 3. It is trivial to provide a stronger upper bound on ex(n; k) than Theorem 3 for k ≥ 5.
Proof Let G be a k-geodetic digraph without sinks. Suppose that G contains a vertex u with out-degree d + (u) ≥ n k . As every vertex has out-degree at least one, it follows that |N +t (u)| ≥ d + (u) = n k for 1 ≤ t ≤ k, where N +t (u) denotes the set of vertices at distance t from u. As G is k-geodetic, all of the vertices in these sets are distinct, so it follows that n ≥ 1 + k n k , a contradiction. Hence the maximum out-degree of G is + < n k and, summing over all vertices of G, the size of G is m < n n k = n 2 k .
It follows that lim sup n→∞ ex(n;k) n 2 ≤ 1 k . We now provide a construction that shows that 1 k 2 ≤ lim inf n→∞ ex(n;k) n 2 . Definition 9 Let the quotient and remainder (when n is divided by k) be r and s respectively; that is n = kr + s, where s ≤ r (this will hold for sufficiently large n). The vertex set of G(n, k) consists of vertices u i, j for 1 ≤ i ≤ r and 1 ≤ j ≤ k, as well as s further vertices v 1 , v 2 , . . . , v s . We define the adjacencies of G(n; k) as follows.
The digraph G(n, k) is k-geodetic and has size m = rs which is equivalent to n ≤ k 2 − k − 1; thus these digraphs exist for n ≥ k 2 − k. The arcs in part iii) can also be directed to u j,1 ; combined with taking the converse of the resulting digraphs, this generates several different isomorphism classes. These digraphs admit a particularly simple description when k|n. Let n = kr for some r ≥ 2. Then G(kr, k) is k-geodetic and has order kr and size r (r −1)+r (k −1) = r 2 +(k −2)r = n 2 k 2 + (k−2)n k . It has vertices u i, j , where 1 ≤ i ≤ r and 1 ≤ j ≤ k and contains the following arcs: Observe that G(kr, k) can be derived from the orientation of K r ,r with a perfect matching pointing in one direction and all other arcs directed in the opposite direction by extending the perfect matching into paths of length k − 1. The digraph G(24; 6) is shown in Fig. 2. Table 1 displays the results of computational work on the values of ex(n; k) for some small values of n and k ≥ 3. It can be seen that the digraph G(n, k) has largest possible size whenever n = kr + s, where s ≤ min{r , k − 1}. In fact, for n and k in the above range such that k|n, we can say further that the underlying undirected graph of G(n, k) is the unique graph with size n 2 k 2 + (k−2)n k that has a strongly-connected k-geodetic orientation. This leads us to make the following conjecture that generalises Theorem 7. Conjecture 10 For k ≥ 2 and sufficiently large n, Also if k|n, then G(n, k) is the unique extremal digraph with that order.

Classification of Extremal 2-Geodetic Digraphs Without Sources and Sinks
In the previous section, it was shown that for r ≥ 1, any strongly-connected 2-geodetic digraph with order n = 2r + 1 has at most ex(2r + 1; 2) = r 2 + 2 arcs. In this section, we will classify the strongly-connected 2-geodetic digraphs that achieve this bound. Our analysis will focus on the case r ≥ 5, for odd n ≥ 11. Computer search shows that there is a unique extremal strongly-connected 2-geodetic digraph with size r 2 + 2 for r = 1, three extremal digraphs for r = 2, 29 solutions for r = 3 and 19 solutions for r = 4; and any 2-geodetic digraphs with larger size contain either a source or a sink. Let G be a 2-geodetic digraph with order n = 2r + 1 ≥ 11, size r 2 + 2 and no sources or sinks and let H be the underlying undirected graph of G. By Theorem 7, H contains a triangle T with vertices x, y, z, which is oriented in G as x → y → z → x and each vertex in H − T is adjacent to exactly one of x, y or z. Furthermore, G − T must be one of the r orientations of K r −1,r −1 given in Theorem 5. Let the bipartition of K r −1,r −1 be X , Y , where X = {x 1 , . . . , x r −1 }, Y = {y 1 , . . . , y r −1 }; we can assume that x i → y i for 1 ≤ i ≤ r − 1 − s for some 0 ≤ s ≤ r − 1, with all other edges oriented in the other direction, so that there are s sources and s sinks in G − T .
We will say that a partite set is covered by a subset T of T if all of its neighbours in T belong to T ; in particular, if all of the neighbours of a partite set, say X , are the same vertex of T , say x, then X is covered by x. We call a vertex in T bad if it has neighbours in both partite sets of H − T .

Lemma 11 Any bad vertex of T has degree 4 in H . If n ≥ 11, then there is at most one bad vertex.
Proof It is easily seen that if a bad vertex has degree at least 5 in H , and hence at least three neighbours in K r −1,r −1 , then H contains a copy of K − 4 , which is impossible by Theorem 3. As any bad vertex of T is adjacent to one vertex of X and one vertex of Y , for r ≥ 5 not all three vertices of T can be bad. Furthermore, if two vertices of T are bad then the third vertex of T would also have to be bad.

Lemma 12 If there is no bad vertex in T , then either X or Y is covered by a single vertex of T and s ≤ 1.
Proof If there is no bad vertex, then the neighbours of any vertex of T in K r −1,r −1 must be entirely contained in one partite set, so one partite set is covered by one vertex of T and the other partite set is covered by the other two vertices of T .
Concerning the value of s, suppose that s ≥ 2 and that X is covered by x (the argument for Y is similar). There must be an arc from every sink in X to x. But any source in Y has arcs to all the sinks in X , and hence will have multiple 2-paths to x, contradicting 2-geodecity.

Lemma 13 Any vertex of T with neighbours in X has at most one in-neighbour in X . Any vertex of T that is joined to at least two non-sink vertices of X has no in-neighbour among the non-sink vertices of X . Substituting 'source' for 'sink' and 'out-neighbour' for 'in-neighbour', the analogous results hold for Y .
Proof Suppose that a vertex of T , say x, has at least two in-neighbours x i and x j in X . For any ∈ {1, 2, . . . , r − 1} − {i, j} we have y → x i → x and y → x j → x, a contradiction.
Now let x be adjacent to vertices x i and x j in X , where we now assume that x i and x j are not sinks in G − T . If x i → x, then as x has at most one in-neighbour in X we must have x → x j . Hence there are paths x i → x → x j and x i → y i → x j , a contradiction. The results for Y follow in a similar manner.
First, we deal with the case that T has no bad vertices. Assume firstly that X is covered by x. Suppose that s = 1 (Fig. 3a). Then x r −1 and y r −1 are the sink and the source of G − T respectively. Now x must have an arc from the sink so that it does not remain a sink in G; hence by Lemma 13, we have x → x i for 1 ≤ i ≤ r − 2. Y is covered by y and z, and either y or z has an arc to the source y r −1 .
If z has an arc to Y , then there would be multiple 2-paths from z to a non-sink vertex in X ; and similarly, if z has an in-neighbour y i in Y , then there would be 2paths y i → z → x and y i → x r −1 → x. Therefore z has no neighbours in Y , so y must have an arc to y r −1 , and by Lemma 13, y i → y for 1 ≤ i ≤ r − 2. This yields the 2-geodetic digraph A r , an example of which is shown in Fig. 3a. This digraph is isomorphic to its converse.

Fig. 3
The graphs A 6 and B 6,2 Now let X be covered by x and s = 0. By Lemma 13, x → x i for 1 ≤ i ≤ r − 1. By reasoning similar to the previous case, y and z can have no out-neighbours in Y . Let the resulting digraph in which y has t in-neighbours in Y be denoted by B r ,t for 0 ≤ t ≤ r − 1 (see Fig. 3b). Each B r ,t is a 2-geodetic extremal digraph.
The case of Y being covered by one vertex of T is symmetric. In particular, we denote the converse of B r ,t by B r ,t . We have B r ,0 ∼ = B r ,0 and B r ,r −1 ∼ = B r ,r −1 , but otherwise these digraphs are pairwise non-isomorphic. We now turn to the case that there is a bad vertex; say z is bad. Hence d(z) = 4 in H . It follows by Lemma 11 that x and y each have r − 2 neighbours in K r −1,r −1 , and each is connected to just one partite set.

Lemma 14 If z is bad, then s ≤ 2. If z is joined to a source in Y , then X is covered by {y, z} and Y is covered by {x, z}. Likewise, if z is joined to a sink in X , then X is covered by {x, z} and Y is covered by {y, z}. If s = 2, then z is connected to a source in Y and a sink in X .
Proof Suppose that s ≥ 3. The bad vertex z is adjacent to one vertex of Y in H − T , so the vertex of T that also has edges to Y must have arcs to two or more sources in Y , violating Lemma 13. This reasoning also demonstrates that if s = 2, then z is connected to a source in Y and a sink in X .
For any s ≤ 2, suppose that z is joined to a source in Y . Suppose that X is covered by {x, z}. Then z has a 2-path to every vertex of X via the source, but by Lemma 13, x has an out-neighbour x i ∈ X , so there will also be a 2-path from z to x i via x, violating 2-geodecity. Hence X must be covered by {y, z}, and hence Y is covered by {x, z}. The other statement is symmetric to this one. Fig. 4 The digraphs C 6 and D 6 Let s = 2. The sources in G − T are y r −2 and y r −1 and the sinks are x r −2 and x r −1 . By Lemma 14, we can assume that z → y r −2 and x r −2 → z. Also by Lemma 14, X is covered by {y, z}. There must be an arc from x r −1 to y so that x r −1 is not a sink in G and y → x i for 1 ≤ i ≤ r − 3, by Lemma 13. Likewise, there is an arc from x to y r −1 . However, we now have two 2-paths from x to the vertices in {x 1 , . . . , x r −3 }; one via y and the other via y r −1 , a contradiction. It follows that s ≤ 1.
Let s = 1. The sink and source of G − T are x r −1 and y r −1 respectively (Fig. 4a). Suppose that z is joined to x r −1 and y r −1 . By Lemma 14, X is covered by {y, z} and Y is covered by {x, z}. By Lemma 13, y → x i for 1 ≤ i ≤ r − 2 and y i → x for 1 ≤ i ≤ r − 2. This gives the single solution C r , an example of which is shown in Fig. 4a. Note that the digraph C r is isomorphic to its converse.
Suppose that z is joined to the source y r −1 but is not joined to the sink x r −1 of G − T ; say z has an edge to x r −2 in H − T . By Lemma 14, X is covered by {y, z} and Y is covered by {x, z}. Hence there is an arc x r −1 → y, and by Lemma 13, x has at most one out-neighbour in Y − y r −1 , so that there is a vertex y i with y i → x. Hence there would be paths y i → x → y and y i → x r −1 → y in G, a contradiction. We will get a similar contradiction if z is joined to the sink x r −1 in X , but not to the source y r −1 in Y .
Finally, let z be joined to x i and y j , where 1 ≤ i, j ≤ r − 2. Suppose that X is covered by {x, z} and Y by {y, z}. If i = j, then the triangle is oriented as x i → y i → z → x i ; however, this yields paths y i → z → x and y i → x r −1 x, so we must have i = j. Without loss of generality, we can set i = r − 2 and j = r − 3. The triangle is now oriented as y r −3 → x r −2 → z → y r −3 . There is an arc x r −1 → x, so by Lemma 13 there are arcs x → x l for 1 ≤ l ≤ r − 3. In this case we would have paths z → y r −3 → x 1 and z → x → x 1 .
Hence we can assume that X is covered by {y, z} and Y by {x, z}. By Lemma 13, y has at least two out-neighbours in X , so if x has any out-neighbour in Y then there would be more than one 2-path from x to an out-neighbour of y in Y . In particular, we must have z → y r −1 , a case that we have already considered. Now we can set s = 0. Suppose that z is joined to x 1 and y 2 . As y 2 → x 1 , we must orient the triangle z, x 1 , y 2 as z → y 2 → x 1 → z. If X is covered by {x, z} and Y is covered by {y, z}, then by Lemma 13, x → x i for 2 ≤ i ≤ r − 1, and so there would be paths z → y 2 → x 3 and z → x → x 3 . Hence X must be covered by {y, z} and Y must be covered by {x, z}. By Lemma 13, we have y 1 → x. Hence there are paths Therefore we can assume that z is joined to x 1 and y 1 . We must have z → x 1 and y 1 → z. If X is covered by {y, z} and Y by {x, z}, then by Lemma 13, y → x i and y i → x for 2 ≤ i ≤ r − 1. This yields the solution D r shown in Fig. 4b; the digraph D r is isomorphic to its converse. If X is covered by {x, z} and Y by {y, z}, then by a suitable redrawing of the digraph it can be seen that we obtain a solution isomorphic to C r in Fig. 4a.
This completes our classification of the strongly-connected 2-geodetic digraphs with order n = 2r + 1 and size r 2 + 2. We therefore have the following theorem.

Theorem 15
If G is a 2-geodetic digraph with order n = 2r +1 ≥ 11, size m = r 2 +2 and no sources or sinks, then G is either isomorphic to one of A r , B r ,0 , B r ,r −1 , C r or D r or is isomorphic to a member of the family B r ,t , B r ,t for some 1 ≤ t ≤ r − 2. The digraphs in this list are pairwise non-isomorphic, and so there are 2r + 1 distinct solutions up to isomorphism.

Generalised Turán Problems for k-Geodetic Digraphs
Recently the following extension of Turán's problem has received a great deal of attention: given graphs T and H , what is the largest possible number of copies of T in an H -free graph with order n? Erdős considered this problem in 1962 [9] when T and H are complete graphs. The largest number of 5-cycles in a triangle-free graph was treated in [14,16], and the converse problem of the largest number of triangles in a graph without a given odd cycle C 2k+1 is discussed in [5,15]. The problem was considered in greater generality in [2]. To investigate this problem in digraphs, we define the following notation.

Definition 16
For any digraph Z and k ≥ 2, we denote the largest number of copies of Z in a k-geodetic digraph by ex(n; Z ; k).
Observe that if Z is a directed arc then ex(n; Z ; k) = ex(n; k). We will study the asymptotics of the function ex(n; Z ; k) in the cases that Z is a directed (k + 1)-cycle or a directed path. We begin with the function ex(n; C k+1 ; k), where k ≥ 2 and C k+1 is a directed (k + 1)-cycle. Earlier we made use of the fact that any arc in a 2-geodetic digraph is contained in at most one triangle; a similar principle applies for larger k.

Lemma 17 Every arc in a k-geodetic digraph is contained in at most one directed
Proof Suppose that an arc x y is contained in two distinct (k + 1)-cycles. Then y has distinct paths of length k to x, violating k-geodecity.
We now utilise an inductive approach to give an upper bound on the number of directed (k + 1)-cycles in a k-geodetic digraph.

Lemma 18 Every k-geodetic digraph with order n contains a vertex with out-degree at most n 1/k .
Proof Assume the contrary. Then for any vertex x, the set N +k (x) will contain at least n vertices, a contradiction.

Theorem 19
Proof We claim that This is easily verified for small n, giving a basis for induction. Assume that the result is true for digraphs with order n − 1 and consider a k-geodetic digraph G with order n and ex(n; C k+1 ; k) directed (k + 1)-cycles and, subject to this, the smallest possible size m. In particular, every arc of G is contained in a unique C k+1 ; otherwise, deleting this arc would yield a k-geodetic digraph with the same number of (k + 1)-cycles but smaller size. It follows that we can pair off the in-and out-neighbours of every vertex according to the corresponding (k +1)-cycles.
By Lemma 18, G contains a vertex x with out-degree at most n 1/k . Deleting this vertex, we obtain a k-geodetic digraph with order n − 1 which, by induction, contains at most n−1 i=1 i 1/k copies of C k+1 . Deleting x destroyed at most n 1/k (k + 1)-cycles, so the result follows by induction.
In fact, the upper bound is tight up to a multiplicative constant. We can show this using the permutation digraphs P(d, k) that were discussed in Sect. 2. The permutation digraph P(d, k) has order n = (d + k)(d + k − 1) . . . (d + 1) and size dn. It is easily seen that each arc of P(d, k) is contained in a unique (k + 1)-cycle; for example 0123 . .
Hence P(d, k) contains nd k+1 copies of C k+1 . Therefore, asymptotically, ex(n; C k+1 ; k) is at least 1 k+1 n k+1 k . In particular, ex(n; C 3 ; 2) must lie somewhere between 1 3 n 3/2 and Proof Let G be a 2-geodetic digraph with order n and N := ex(n; C 3 ; 2) directed triangles. As before, we can assume that every arc is contained in a unique triangle.
In the sum v∈G u∈N Squaring both sides yields N 2 ≤ n 9 (n 2 − n − 3N ). Rearranging and solving the associated quadratic equation, it follows that

Remark 21
For infinitely many n, the upper bound in Theorem 20 is at most n 3 off from the lower bound of the permutation digraph P(d, 2).
Based on this example, we make the following conjecture. We turn now to the problem of the largest number of directed paths of given length in a 2-geodetic digraph. Let P be the path of length (so of order + 1). Surprisingly, there are some differences between odd and even length paths; in the following theorem we show different lower bounds.
If is odd, we have: ex(n; P ; 2) ≥ (n/2) ( +3)/2 .  P(d, k). For an upper bound, consider a path of length with vertices 0, 1, . . . , . By k-geodecity, given the two endpoints of a path of length k, all of the intermediate vertices are determined. Hence we can only choose vertices 0, k, 2k, . . . , independently. Hence ex(n; P ; k) is at most n ( /k)+1 . Now let be odd and consider an orientation of the complete bipartite graph K r ,r where n = 2r , in which a perfect matching is oriented in one direction and all other arcs are oriented in the opposite direction. We have already seen that this digraph is 2-geodetic. The n 2 vertices of one partite set are the initial vertices of ( n 2 ) ( +1)/2 + O(n ( −1)/2 ) distinct -paths, whereas the vertices in the other partite set are the initial vertices of only O(n ( −1)/2 ) -paths each. Multiplying by n 2 yields the result.
As for paths of odd length, we have an asymptotically sharp result only for P 3 .
Theorem 24 ex(n; P 3 ; 2) = (n/2) 3 + O(n 2 ). Note that by 2-geodecity, for each fixed first vertex and last arc we have at most one path of length three; similarly we have at most one path of length three for each fixed first arc and last vertex. We will make use of this several times in the following argument.

Proof
There are at most 2n arcs starting from N 0 ∪ N 1 since G is 2-geodetic. Hence, by the observation of the previous paragraph, the number of 3-paths starting from N 0 or N 1 has quadratic order. Similarly, there are at most a quadratic number of paths of length three with third vertex lying in N 0 or N 1 . Therefore, since the desired upper bound for the number of 3-paths is cubic in order, we may ignore paths of length three which contain a vertex from N 0 or N 1 as the first or third vertex.
Let us denote the number of vertices in N 1 by x. Since there are at most (n − − x) choices for the first or the third vertex and at most choices for the last vertex after fixing the third vertex, there are at most (n − − x) 2 + O(n 2 ) directed paths of length three. Using elementary calculus, it is simple to check that we have where the 2n term bounds the number of arcs starting at N 0 ∪ N 1 , the second term bounds the number of arcs entering N 0 and the third term bounds the number of arcs that are not incident from N 0 ∪ N 1 or incident to N 0 . So, by choosing the first vertex and the last arc and neglecting terms of order O(n 2 ), the number of paths of length three is at most f (x) := (n − − x)( 2 + (n − − x)x). We have f (x) = 4 x − 2n + 3x 2 − 4nx + n 2 , which is positive when x = 0 and is negative when x = n 2 − . Therefore the maximum of the function f (x) in the interval [0, n 2 − ] is attained at the smallest zero of f (x), which is x 0 = 2n−2 − √ n 2 −2n +4 2 3 .

Expanding and setting
= zn shows that the number of 3-paths minus n 3 /8 is bounded above by