1 Introduction

Given a family of graphs \({\mathscr {F}}\), what is the maximum number of edges in a graph on n vertices if it does not contain any member of \({\mathscr {F}}\) as a subgraph? Turán (1941), Turán (1954) determined the maximum number of edges of graphs on n vertices which do not contain a complete graph, and also determined the unique graph attaining that maximum. Most of the previous results in Turán type extremal graph theory concern undirected graphs and only a few extremal problems on digraphs have been investigated; see (Bollobás 1995; Brown et al. 1973, 1985; Brown and Harary 1970; Brown and Simonovits 2002; Huang and Lyu 2020a, b; Jacob and Meyniel 1983; Maurer et al. 1980; Scott 2000). In this paper we study an extremal problem on digraphs.

The systematic investigation of digraph extremal problem was initiated by Brown and Harary (1970). This is where the area started and it covers all the cases where the excluded subgraph has at most 4 vertices. Maurer et al. (1980) studied the extremal subgraphs of the transitive tournament which contain at most one directed path from x to y with \(x\ne y\). In this paper, we consider a problem posed in Huang and Lyu (2020a):

Problem 1.1

Let nkt be positive integers. What is the maximum number of arcs in a digraph on n vertices in which there are at most t distinct walks of length k with the same endpoints? Determine the extremal digraphs attaining the maximum number.

When \(t=1\), the above problem is the same as the unsolved problem 20 in (Zhan 2013, p.234). In Huang et al. (2019), Huang and Zhan (2011), Lyu (2020), Wu (2010) the authors solved all the cases but \(k=3\). For \(t\ge 2\), Huang and Lyu (2020a) prove that the maximum number is equal to \(n(n-1)/2\) and the extremal digraph is the transitive tournament when \(k\ge n-1\ge 6t+1\). They also discussed the maximum number for the case \(k\ge 6t+1\) and \(n\in \{k+2,k+3,k+4\}\). The most interesting case of Problem 1.1 is that n is sufficiently large and t is fixed. In this paper, under this condition we prove that the extremal digraphs are some particular k-partite transitive tournaments for \(k\ge 6t+1\), and the case that k is close to n is also solved. For the case \(k\le 6t\), the maximum number is difficult to determine and we leave it for future research. Generally speaking, t substituting 1 leads a deeper problem. We follow the similar approach with the approach in Huang et al. (2019) but different strategy to present the general results.

We consider digraphs without multiple arcs but allowing loops. We abbreviate directed walks and directed cycles as walks and cycles, respectively. The number of vertices in a digraph is called its order and the number of arcs its size. A p-cycle is a cycle of length p and a 1-cycle is a loop. Similarly, we define p-walk. Given a family of digraphs \({\mathscr {F}}\), we say a digraph D is \({\mathscr {F}}\)-free if D contains no subgraph from \({\mathscr {F}}\). Let \(ex(n,{\mathscr {F}})\) be the maximum size of \({\mathscr {F}}\)-free digraphs of order n and \(EX(n,{\mathscr {F}})\) be the set of \({\mathscr {F}}\)-free digraphs of order n with size \(ex(n,{\mathscr {F}})\). Given two positive integers kt, denote by \({\mathscr {F}}_{k,t}\) the family of digraphs consisting of t different walks of length k with the same initial vertex and the same terminal vertex. The Problem 1.1 is equivalent to the following

Problem 1.2

Given positive integers nkt, determine \(ex(n,{\mathscr {F}}_{k,t+1})\) and \(EX(n,{\mathscr {F}}_{k,t+1})\).

Given any positive integer t, we always assume \(k\ge 6t+1\) and \(t_0=\lfloor \log _2t\rfloor \). In Huang and Lyu (2020a), the authors determined \(ex(n,{\mathscr {F}}_{k,t+1})\) for \(n=k+1,\ldots ,k+4\). They also characterized \(EX(n,{\mathscr {F}}_{k,t+1})\) for \(n=k+1\). We will determine \(ex(n,{\mathscr {F}}_{k,t+1})\) for \(n\ge k+5\) and characterize \(EX(n,{\mathscr {F}}_{k,t+1})\) for \(n\ge k+2\). The rest of this paper is organized as follows. Section 2 presents our main result Theorem 2.2, which determines \(ex(n,{\mathscr {F}}_{k,t+1})\) for \(n\ge k+4+t_0\) and characterizes \(EX(n,{\mathscr {F}}_{k,t+1})\) for \(n\ge k+5+t_0\). Section 3 and Section 4 present the exact values of \(ex(n,{\mathscr {F}}_{k,t+1})\) for \(n=k+5,\ldots ,k+4+t_0\) as well as the characterization of \(EX(n,{\mathscr {F}}_{k,t+1})\) for \(n=k+2,\ldots ,k+4+t_0\). Section 5 presents the proof of Theorem 2.2.

2 Main result

In order to present our main result, we need the following notations and definitions. For a digraph \(D=({\mathcal {V}},{\mathcal {A}})\), we denote by a(D) the size of D. Given an arbitrary subset X of \({\mathcal {V}}\), the subgraphs of D induced by X and \({\mathcal {V}}\backslash X\) are denoted by D[X] and \(D-X\), respectively. For convenience, if a set \(X=\{x\}\) it will be abbreviated as x. For \(i,j\in {\mathcal {V}}\), if there is an arc from i to j, then we say j is a successor of i, and i is a predecessor of j. The notation \(i\rightarrow j\) means there is an arc from i to j; \(i\nrightarrow j\) means there exists no arc from i to j. Given \(S,T\subset {\mathcal {V}}\), the notation \(S\rightarrow T\) means there is an arc from each vertex of S to each vertex of T; \(S\nrightarrow T\) means there is no arc from S to T. If \(S=\{s\}\), we write \(s\rightarrow T\) and \(s\nrightarrow T\). Analogously, if \(T=\{t\}\), we write \(S\rightarrow t\) and \(S\nrightarrow t\).

A digraph \(D=({\mathcal {V}},{\mathcal {A}})\) is said to be transitive if for any three vertices \(x,y,z\in {\mathcal {V}}\), \(x\rightarrow y\) and \(y\rightarrow z\) indicates \(x\rightarrow z\). Recall that a tournament is an orientation of the complete graph. We denote by \(T_n\) the transitive tournament with vertex set \(\{1,2,\ldots ,n\}\) and arc set \(\{(i,j):1\le i<j\le n\}\).

For a digraph \(D=({\mathcal {V}},{\mathcal {A}})\) with \({\mathcal {V}}=\{v_1,v_2,\ldots ,v_n\}\), a blow-up of D is obtained by replacing every vertex \(v_i\) with a finite collection of copies of \(v_i\), denoted by \(V_i\), so that (xy) is an arc for \(x\in V_i\) and \(y\in V_j\) if and only if \((v_i,v_j)\in {\mathcal {A}}\). Note that each \(V_i\) is an independent set.

Suppose skt are nonnegative integers with \(t<k\). We call a digraph D of order \(sk+t\) an (skt)-transitive tournament if it is a blow-up of \(T_k\) obtained by replacing each vertex of \(T_k\) with a collection of s or \(s+1\) copies. An (skt)-transitive tournament has the following diagram (Fig. 1)

Fig. 1
figure 1

(skt)-transitive tournament

where each vertex partition \(V_i\) contains s or \(s+1\) vertices and there is an arc from vertex x to vertex y if and only if \(x\in V_i\), \(y\in V_j\) with \(i<j\). If \(|V_1|=s+1\) the (skt)-transitive tournament is initial; if \(|V_k|=s+1\) it is terminal.

In Huang and Lyu (2020a), the authors presented the following result.

Theorem 2.1

Let nkt be positive integers with \(n\ge 6t+2\) and \(k\ge n-1\). Then

$$\begin{aligned} ex(n,{\mathscr {F}}_{k,t+1})=\frac{n(n-1)}{2}, \end{aligned}$$

and \(D\in EX(n,{\mathscr {F}}_{k,t+1})\) if and only if D is a transitive tournament.

They also determined \(ex(n,{\mathscr {F}}_{k,t+1})\) for \(k\ge 6t+1\) and \(n=k+2,k+3,k+4\). Now we are ready to state our main result.

Theorem 2.2

Let \(k,t,t_0\) be nonegative integers with \(k\ge 6t+1\) and \(t_0=\lfloor \log _2t\rfloor \). Let nsr be nonnegative integers with \(n=sk+r\) and \(r<k\). If \(n\ge k+t_0+4\), then

$$\begin{aligned} ex(n,{\mathscr {F}}_{k,t+1})= {n\atopwithdelims ()2} -{s\atopwithdelims ()2}k-sr. \end{aligned}$$
(2.1)

Moreover, if \(n\ge k+t_0+5\), \(D\in EX(n,{\mathscr {F}}_{k,t+1})\) if and only if D is an (skr)-transitive tournament.

We will also determine \(EX(n,{\mathscr {F}}_{k,t+1})\) for \(n\in \{k+2,\ldots ,k+4+t_0\}\), and \(ex(n,{\mathscr {F}}_{k,t+1})\) for \(n\in \{k+5,\ldots , k+3+t_0\}\). For the case \(k\le 6t\), our result does not always hold. We can see the example in Huang et al. (2019), which illustrates Theorem 2.2 is not true even when \(t=1\) and \(k=3\). We leave the cases \(k\le 6t\) of Problem 1.2 for future work.

Remark

(Huang et al. 2019, Theorem 1) implies Theorem 2.2 holds if \(t=1\). Hence, throughout the article we always assume \(t\ge 2\). In addition, we also assume \(k\ge 6t+1\) and \(t_0=\lfloor \log _2t\rfloor \) if no otherwise statement.

3 \(ex(n,{\mathscr {F}}_{k,t+1})\) and \(EX(n,{\mathscr {F}}_{k,t+1})\) for \(n\le k+t_0+3\)

For convenience, we always use \(\langle n\rangle =\{1,\ldots , n\}\) to denote the vertex set of a digraph D of order n unless otherwise stated. We need the following lemmas.

Lemma 3.1

(Huang et al. 2019) Let \(n \ge 3\) and p be nonnegative integers, and let D be a digraph on n vertices. Given \(q\ge 0\) such that \(p(n-1)/2+q\) is a positive integer, if

$$\begin{aligned} a(D-i)\le \frac{(n-1)(n-2)}{2}- \frac{p(n-1)}{2}-q \quad for~ all ~ i\in \langle n\rangle , \end{aligned}$$

then

$$\begin{aligned} a(D)\le \frac{n(n-1)}{2}- \frac{p(n+1)}{2}-q -1. \end{aligned}$$
(3.1)

Two distinct cycles are said to be joint if they have a common vertex.

Lemma 3.2

(Huang and Lyu 2020a) Let nt be positive integers and D be a digraph of order n. If an \(m_1\)-cycle and an \(m_2\)-cycle in D are joint or connected by an arc, then D is not \({\mathscr {F}}_{k,t+1}\)-free for all \(k\ge t L+1\), where L is the least common multiple of \(m_1\) and \(m_2\).

Given a digraph \(D=({\mathcal {V}},{\mathcal {A}})\), denote by

$$\begin{aligned} N^+(u)=\{x\in {\mathcal {V}}|(u,x)\in {\mathcal {A}}\}~~\mathrm{and~} N^-(u)=\{x\in {\mathcal {V}}|(x,u)\in {\mathcal {A}}\} \end{aligned}$$

the sets of successors and predecessors of a vertex u. The outdegree and indegree of u are \(d^+(u)\equiv |N^+(u)|\) and \(d^-(u)\equiv |N^-(u)|\), respectively. Let d(u) be the number of arcs incident with a vertex u. Then \(d(u)= a(D)-a(D-u)\) and

$$\begin{aligned} d(u)=\left\{ \begin{array}{ll} d^+(u)+d^-(u)-1,&{} u\rightarrow u;\\ d^+(u)+d^-(u),&{}\text {otherwise}.\end{array}\right. \end{aligned}$$

Lemma 3.3

(Huang and Lyu 2020a) Let \(D=({\mathcal {V}},{\mathcal {A}})\) be a digraph of order n and let t be a positive integer. Suppose \(v\in {\mathcal {V}}\) is contained in a cycle. If \(D[N^+(v)]\) or \(D[N^-(v)]\) contains a transitive tournament of order \(t+2\), then D is not \({\mathscr {F}}_{k,t+1}\)-free for \(k\ge 2\).

Now we present the main result of this section.

Theorem 3.4

Let nkt be positive integers with \(k\ge 6t+1\) and let \(t_0=\lfloor \log _2t\rfloor \). If \(k+1\le n\le k+t_0+3\), we have

$$\begin{aligned} ex(n,{\mathscr {F}}_{k,t+1})=\frac{n(n-1)}{2}-n+k+1. \end{aligned}$$
(3.2)

Moreover,

  1. (1)

    If \(k+1\le n\le k+t_0+1\), \(D\in EX(n,{\mathscr {F}}_{k,t+1})\) if and only if D is a \((1,k+1,n-k-1)\)-transitive tournament;

  2. (2)

    If \(n=k+t_0+2\), \(D\in EX(n,{\mathscr {F}}_{k,t+1})\) if and only if D is an initial or a terminal \((1,k+1,t_0+1)\)-transitive tournament;

  3. (3)

    If \(n=k+t_0+3\), \(D\in EX(n,{\mathscr {F}}_{k,t+1})\) if and only if D is a \((1,k+1,t_0+2)\)-transitive tournament both initial and terminal.

Proof

We follows the strategy as follows. First we prove (3.2). Then we show that every digraph \(H\in EX(n,{\mathscr {F}}_{k,t+1})\) has an induced subgraph in \(EX(n-1,{\mathscr {F}}_{k,t+1})\), say \(H'\). By the induction hypothesis, the structure of \(H'\) is clear. At last, we add a vertex to \(H'\) to get the structure of H. Let D be an \({\mathscr {F}}_{k,t+1}\)-free digraph of order n. We use induction on the order of D. By Theorem 2.1, Theorem 3.4 holds for \(n=k+1\). Assume Theorem 3.4 holds for \(n=k+1,k+2,\ldots , k+\tau \), where \(2\le \tau \le t_0+2\). Now we consider \(n=k+\tau +1\). It is clear that \(D-i\) is \({\mathscr {F}}_{k,t+1}\)-free for each \(i\in {\mathcal {V}}\). By the induction hypothesis \(a(D-i)\le ex(n-1,{\mathscr {F}}_{k,t+1})\). Applying Lemma 3.1 we obtain

$$\begin{aligned} a(D)\le \frac{n(n-1)}{2}-\tau . \end{aligned}$$

On the other hand, when \(\tau \le t_0\), it is easily seen that all \((1,k+1,\tau )\)-transitive tournaments are \({\mathscr {F}}_{k,t+1}\)-free with size \(n(n-1)/2-\tau \). When \(\tau = t_0+1\), an initial or a terminal \((1,k+1,\tau )\)-transitive tournament is \({\mathscr {F}}_{k,t+1}\)-free with size \(n(n-1)/2-\tau \). When \(\tau = t_0+2\), a \((1,k+1,\tau )\)-transitive tournament both initial and terminal is \({\mathscr {F}}_{k,t+1}\)-free with size \(n(n-1)/2-\tau \). Thus we get (3.2) and the sufficiency parts of (1), (2), (3).

Let \(D\in EX(n,{\mathscr {F}}_{k,t+1})\). By Lemma 3.1 and (3.2), there exists \(i_0\in {\mathcal {V}}(D)\) such that

$$\begin{aligned} a(D-i_0)=\frac{(n-1)(n-2)}{2}-\tau +1. \end{aligned}$$

By the induction hypothesis, \(D-i_0\) is a \((1,k+1,\tau -1)\)-transitive tournament.

Let \(\{i_1,\ldots ,i_{\tau -1}\}\) be an arbitrary \((\tau -1)\)-subset of \( \langle k+1\rangle \). Denote by

$$\begin{aligned} V_i=\{i,i+k+1\}~\mathrm{for}~i\in \{i_1,\ldots ,i_{\tau -1}\} \end{aligned}$$

and

$$\begin{aligned} V_i=\{i\}~~\mathrm{for}~i\in \langle k+1\rangle \setminus \{i_1,\ldots ,i_{\tau -1}\}. \end{aligned}$$

Without loss of generality, we assume that D is a digraph with vertex set

$$\begin{aligned} {\mathcal {V}}=\bigcup _{i=1}^k V_i\cup \{i_0\}=\{1,2,\ldots ,k+1,i_1+k+1,\ldots ,i_{\tau -1}+k+1,i_0\} \end{aligned}$$

such that there is an arc \(x\rightarrow y\) in \(D-i_0\) if and only if \(x\in V_i\), \(y\in V_j\) with \(i<j\).

Since \(d(i_0)=n-2= k+\tau -1\), we have

$$\begin{aligned} d^+(i_0)+d^-(i_0)\ge 6t+1\ge 2t+3+2t_0. \end{aligned}$$

Then either \(i_0\) has \(t+2\) predecessors in \(\langle k+1\rangle \) or it has \(t+2\) successors in \(\langle k+1\rangle \). By Lemma 3.3, we have \(i_0\nrightarrow i_0\) and \(i_0\) is not contained in any 2-cycle. Recalling \(d(i_0)=n-2\), \(i_0\) is adjacent with all vertices in \({\mathcal {V}}\setminus \{i_0\}\) but one, say \(j_0\).

Let \(s'\in \langle k+1\rangle \) be the largest integer such that \(s'\rightarrow i_0\) and \(t'\in \langle k+1\rangle \) be the smallest integer such that \(i_0\rightarrow t'\). Here we let \(s'=0\) if \(\langle k+1\rangle \nrightarrow i_0\) and \(t'=k+2\) if \(i_0\nrightarrow \langle k+1\rangle \). By Lemma 3.3, \(t'>s'\). If \(t'=s'+1\), we have the following walk of length \(k+1\):

$$\begin{aligned} w:1\rightarrow 2\rightarrow \cdots \rightarrow s'\rightarrow i_0\rightarrow s'+1\rightarrow \cdots \rightarrow k+1. \end{aligned}$$

Note that if \(s'=0\), w begins at \(i_0\); if \(t'=k+2\), w ends at \(i_0\). We obtain \(w_i\) from w by deleting i and joining its predecessor to its successor. There exists a set \(\{u_1,u_2,\ldots ,u_{t+1}\}\subset \langle k\rangle \backslash \{1\}\) such that \(s',t'\notin \{u_1,u_2,\ldots ,u_{t+1}\}\). It is easily seen that \(w_{u_1},\ldots ,w_{u_{t+1}}\) are \(t+1\) distinct walks of length k sharing the same endpoints, a contradiction. Hence \(t'>s'+1\). Combining this with \(d(i_0)=n-2\), we obtain

$$\begin{aligned} t'=s'+2 ~\mathrm{with}~ s'\in \{0\}\cup \langle k\rangle . \end{aligned}$$
(3.3)

It follows that \(j_0=s'+1\) and

$$\begin{aligned} \{1,\ldots ,s'\}\rightarrow n\rightarrow \{t',\ldots ,k+1\}. \end{aligned}$$

Here \(s'=0\) means \(\{1,\ldots ,s'\}\) is empty and \(s'=k\) means \(\{t',\ldots ,k+1\}\) is empty.

Note that \(i_0\) is adjacent with each vertex of \(\{k+1+i_1,\ldots ,k+1+i_{\tau -1}\}\). We assert that for each \(i\in \{i_1,\ldots ,i_{\tau -1}\}\), if \(i\rightarrow i_0\) we have \(k+1+i\rightarrow i_0\). Otherwise we assume \(i_0\rightarrow k+1+i\). Replacing the role of i with \(i+k+1\) we get \(t'\ne s'+2\), contradicting (3.3). Similarly, if \(i_0\rightarrow i\) we have \(i_0\rightarrow k+1+i\) and if \(i=j_0\) there is no arc between \(i_0\) and \(i+k+1\). Recalling \(i_0\) is adjacent with each vertex of \(\{k+1+i_1,\ldots ,k+1+i_{\tau -1}\}\), we get \(j_0\notin \{i_1,\ldots ,i_{\tau -1}\}.\) Therefore, D is a \((1,k+1,\tau )\)-transitive tournament. Then we leave the following two cases to discuss.

Case 1. \(\tau =t_0+1\). We assert that D is initial or terminal. Otherwise \(\{1,k+1\}\nsubseteq \{j_0,i_1\ldots ,i_{\tau -1}\}\). There is a k-walk \(w'\) as follows.

$$\begin{aligned} 1\rightarrow 2\rightarrow \cdots \rightarrow k+1. \end{aligned}$$

For each \(i\in \{j_0,i_1\ldots ,i_{\tau -1}\}\), we could obtain new k-walks from \(w'\) by replacing i with \(k+1+i\). Note that we may replace \(j_0\) with \(i_0\). Hence there are \(2^{t_0+1}\) walks of length k with the same endpoints, a contradiction.

Case 2. \(\tau =t_0+2\). Applying the same arguments as above, we obtain that D is both initial and terminal. This completes the proof. \(\square \)

4 \(ex(n,{\mathscr {F}}_{k,t+1})\) and \(EX(n,{\mathscr {F}}_{k,t+1})\) for \(n= k+t_0+4\)

To present the main result of this section, we need the following lemmas.

Lemma 4.1

Let D be a digraph such that \(D-i_0\) is a blow-up of \(T_{k+1}\) with vertex partition

$$\begin{aligned} {\mathcal {V}}\setminus \{i_0\}=\bigcup \limits _{i=1}^{k+1}V_i, \end{aligned}$$

where \(i_0\in {\mathcal {V}}(D)\). In \(D-i_0\) we have \(x\rightarrow y\) for \(x\in V_i\), \(y\in V_j\) if and only if \(i<j\). If \(k\ge t+2\) and D is \({\mathscr {F}}_{k,t+1}\)-free, then \(V_{k+1}\nrightarrow i_0\nrightarrow V_1\).

Proof

Without loss of generality, we assume that \(i\in V_i\) for \(i\in \langle k+1\rangle \). Suppose there is \(x\in V_1\) such that \(i_0\rightarrow x\), we obtain a walk of length \(k+1\) as follows.

$$\begin{aligned} w:i_0\rightarrow x\rightarrow 2\rightarrow \cdots \rightarrow k\rightarrow k+1. \end{aligned}$$

For each \(j\in \langle k\rangle \setminus \{1\}\), we could obtain a new walk \(w_j\) of length k from w by deleting j and joining its predecessor to its successor. Since \(|\langle k\rangle \setminus \{1\}|\ge t+1\), there are \(t+1\) distinct walks of length k with the same endpoints, a contradiction. Hence \(i_0\nrightarrow V_1\). Similarly, \(V_{k+1}\nrightarrow i_0\). \(\square \)

Let k be a positive integer and let \(\alpha \) be an arbitrary subset of \(\langle k \rangle \backslash \{1\}\). Denote by \(H(k,\alpha )\) the digraph with vertex set

$$\begin{aligned} {\mathcal {V}}=\bigcup \limits _{i\in \langle k+1\rangle } V_i, \end{aligned}$$

where \(V_i=\{i,(k+1)+i\}\) for \(i\in \alpha \cup \{1,k+1\}\) and \(V_i=\{i\}\) for \(i\in \langle k\rangle \backslash (\{1\}\cup \alpha )\), such that \(x\rightarrow y\) if and only if \(x\in V_i\), \(y\in V_j\) with \(i<j\). Note that \(H(k,\alpha )\) is a \((1,k+1,|\alpha |+2)\)-transitive tournament both initial and terminal.

Now we define several new classes of digraphs. Given \(i\in \alpha \cup \{1,k+1\}\), let \(H_i(k,\alpha )\) be the digraph obtained from \(H(k,\alpha )\) by adding a vertex \(2k+2+i\), the arcs \(2k+2+i\rightarrow V_j\) for \(i<j\) and the arcs \(V_j\rightarrow 2k+2+i\) for \(i>j\); given \(i\in \langle k-2 \rangle \), let \(H_u(k,i,\alpha )\) be the digraph obtained from \(H(k,\alpha )\) by adding a vertex u, and the arcs \(V_j\rightarrow u\) for \(j\le i\), \(u\rightarrow V_j\) for \(j\ge i+3\).

Lemma 4.2

Let \(k,t,t_0\) be nonegative integers with \(t_0=\lfloor \log _2t\rfloor \), \(k\ge 6t+1\) and let \(\alpha \) be an arbitrary \(t_0\)-subset of \(\langle k\rangle \setminus \{1\}\). Let D be an \({\mathscr {F}}_{k,t+1}\)-free digraph with \(D-i_0=H(k,\alpha )\). If there exist \(i,j\in \langle k+1\rangle \) with \(x\in V_{i}, y\in V_{j}\) such that \(x\rightarrow i_0\rightarrow y\), then \(j\ge i+2\).

Proof

Suppose there exist \(x\in V_{i},y\in V_{j}\) with \(j\le i+2\) such that \(x\rightarrow i_0\rightarrow y\). Since D is \({\mathscr {F}}_{k,t+1}\)-free, by Lemma 4.1 we have \(i\le k\) and \(j\ge 2\). Without loss of generality, we let \(i\rightarrow i_0\rightarrow j\). If \(j\le i\), there is a walk of length \(k+2 \) as follows.

$$\begin{aligned} 1\rightarrow \cdots \rightarrow i\rightarrow i_0\rightarrow j\rightarrow i+1\rightarrow \cdots \rightarrow k+1. \end{aligned}$$

Note that \(k\ge 6t+1\). There are more than \(6t-3\) vertices in \(\langle k\rangle \setminus \{1,i,j\}\). We could obtain more than t walks from the walk above by deleting any pair of these vertices and adding two arcs from their predecessors to their successors respectively, a contradiction. From the above discussion, if \(i,j\in \alpha \), we have \(i+k+1\rightarrow i_0\), \(i_0\rightarrow j+k+1\).

If \(j=i+1\), there is a walk of length \(k+1 \) as follows.

$$\begin{aligned} 1\rightarrow \cdots \rightarrow i\rightarrow i_0\rightarrow i+1\rightarrow \cdots \rightarrow k+1. \end{aligned}$$

There are more than t vertices in \(\langle k\rangle \setminus \{1,i,i+1\}\). We could obtain more than t walks from the walk above by deleting any one of vertices in \(\langle k\rangle \setminus \{1,i,i+1\}\) and adding an arc from its predecessor to its successor, a contradiction. Hence, \(j\ge i+2\). \(\square \)

The girth of a digraph D with a cycle, denoted by g(D), is the length of its shortest cycle.

Lemma 4.3

Let D be a digraph of order \(n\ge 13\). If it has a cycle and

$$\begin{aligned} d(i)\ge n-2 { ~for ~} i\in {\mathcal {V}}, \end{aligned}$$

then \(g(D)\le 4\).

Proof

If D has a loop, we are done. Hence we always assume D is loopless. To the contrary suppose \(g(D)\ge 5\). Assume there is a cycle as follows.

$$\begin{aligned} 1\rightarrow 2\rightarrow 3\rightarrow 4\rightarrow \cdots \rightarrow g(D)\rightarrow 1. \end{aligned}$$

From the assumption, there is an arc between 1 and one of 3, 4. For the both cases, we can get shorter cycles, a contradiction. Therefore, \(g(D)\le 4\). \(\square \)

Now we solve the case \(n=k+t_0+4\).

Theorem 4.4

Let nkt be positive integers with \(k\ge 6t+1\) and let \(t_0=\lfloor \log _2t\rfloor \). If \( n= k+t_0+4\), then

$$\begin{aligned} ex(n,{\mathscr {F}}_{k,t+1})=\frac{n(n-1)}{2}-t_0-4. \end{aligned}$$
(4.1)

Moreover,

  1. (1)

    if \(t\ge 2^{t_0-1}\times 3\), \(D\in EX(n,{\mathscr {F}}_{k,t+1})\) if and only if D is a \((1,k,t_0+4)\)-transitive tournament or \(D\cong H\) with \(H\in \{H_i(k,\alpha ):i\in \alpha \cup \{1,k+1\}\} \cup \{H_{i_0}(k,i,\alpha ):i\in \langle k-2\rangle ~{ and} ~|V_{i+1}|=|V_{i+2}|=1\}\cup \{H(k,\alpha \cup \{i+1\})-(i+k+1,i+k+2):i\in \alpha ~{ and}~i+1\in \langle k\rangle \setminus (\{1\}\cup \alpha )\}\), where \(\alpha \) is an arbitrary \(t_0\)-subset of \(\langle k\rangle \setminus \{1\}\);

  2. (2)

    if \(t<2^{t_0-1}\times 3\), \(D\in EX(n,{\mathscr {F}}_{k,t+1})\) if and only if D is a \((1,k,t_0+4)\)-transitive tournament or \(D\cong H\) with \(H\in \{H_i(k,\alpha ):i\in \{1,k+1\}\} \cup \{H_{i_0}(k,i,\alpha ):i\in \langle k-2\rangle ~{ and} ~|V_{i+1}|=|V_{i+2}|=1\}\), where \(\alpha \) is an arbitrary \(t_0\)-subset of \(\langle k\rangle \setminus \{1\}\).

Proof

We follow the strategy as follows. First we prove (4.4). Then we characterise the extremal digraphs. We distinguish two cases according to the maximum size of the induced subgraphs of order \(n-1\). In the first case, there is an induced subgraph containing \(ex(n-1,{\mathscr {F}}_{k,t+1})\) arcs. Hence, it is easy to get the structure of the subgraph, then by adding a vertex we get the extremal digraph. In the other case, there is no induced subgraph containing \(ex(n-1,{\mathscr {F}}_{k,t+1})\) arcs. We characterise the structure by analysing the degrees of vertices.

Let \(D=({\mathcal {V}},{\mathcal {A}})\) be an \({\mathscr {F}}_{k,t+1}\)-free of order n. Combining Theorem 3.4 with Lemma 3.1 we obtain

$$\begin{aligned} a(D)\le \frac{n(n-1)}{2}-t_0-3. \end{aligned}$$
(4.2)

Suppose equality in (4.2) holds. By Lemma 3.1, there exists \(i\in {\mathcal {V}}\) such that

$$\begin{aligned} a(D-i)\ge \frac{(n-1)(n-2)}{2}-t_0-2. \end{aligned}$$

Applying Theorem 3.4 to \(D-i\), it is an initial and terminal \((1,k+1,t_0+2)\)-transitive tournament. Without loss of generality, we assume \({\mathcal {V}}(D-i)=H(k,\alpha )\), where \(\alpha \subset \langle k\rangle \setminus \{1\} \) with \(|\alpha |=t_0\).

It is clear that \(d(i)=n-2\). By Lemma 3.3, \(i\nrightarrow i\). Then by Lemma 4.1, \(V_{k+1}\nrightarrow i\nrightarrow V_1\). Hence, i has both predecessors and successors. Let \(s'\) be the largest integer such that there exists a vertex \(x\in V_{s'}\) with \(x\rightarrow i\) and let \(t'\) be the smallest integer such that there exists a vertex \(y\in V_{t'}\) with \(i\rightarrow y\). By Lemma 4.2 we get \(t'\ge s'+2\). Recalling that \(d(i)=n-2\) and \(i\nrightarrow i\), we get \(t'\le s'+2\). Hence \(t'=s'+2\) and D is a \((1,k+1,t_0+3)\)-transitive tournament. It is clear that D is not \({\mathscr {F}}_{k,t+1}\)-free.

Therefore, equality in (4.2) does not hold. It follows that

$$\begin{aligned} a(D)\le \frac{ n(n-1)}{2}-t_0-4. \end{aligned}$$

On the other hand, any \((1,k,t_0+4)\)-transitive tournament is \({\mathscr {F}}_{k,t+1}\)-free and it has the maximum number of arcs. Hence, (4.1) holds.

Suppose D is a \((1,k,t_0+4)\)-transitive tournament or \(D\cong H\) with \(H\in \{H_{1}(k,\alpha ),H_{k+1}(k,\alpha )\} \cup \{H_{i_0}(k,i,\alpha ):i\in \langle k-2\rangle ~{ and} ~|V_{i+1}|=|V_{i+2}|=1\}\), where \(\alpha \) is an arbitrary subset of \(\langle k\rangle \setminus \{1\}\) with \(|\alpha |=t_0\). Then \(a(D)=n(n-1)/2-t_0-4\). Moreover, it is easy to check that D is \({\mathscr {F}}_{k,t+1}\)-free. When \(t\ge 2^{t_0-1}\times 3\), it is clear that for any \(t_0\)-subset of \(\langle k\rangle \) and each \(i\in \alpha \), \(D\in H_i(k,\alpha )\) is \({\mathscr {F}}_{k,t+1}\)-free and has \(n(n-1)/2-t_0-4\) arcs. For \(D\in \{H(k,\alpha \cup \{i+1\})-(i+k+1,i+k+2):i\in \alpha ~{ and}~i+1\in \langle k\rangle \setminus (\{1\}\cup \alpha )\}\), it is clear that D is \({\mathscr {F}}_{k,t+1}\)-free and it has \(n(n-1)/2-t_0-4\) arcs. Therefore, \(D\in Ex(n,{\mathscr {F}}_{n-4})\) and we get the sufficiency part.

Next we prove the necessity part. Let \(D\in Ex(n,{\mathscr {F}}_{k,t+1})\). Note that all subgraphs of D are \( {\mathscr {F}}_{k,t+1}\)-free. By Theorem 3.4 we have

$$\begin{aligned} a(D-i)\le \frac{(n-1)(n-2)}{2}-t_0-2 \text {~~for all~~} i\in {\mathcal {V}}. \end{aligned}$$

We distinguish two cases.

Case 1. There exists \(i\in {\mathcal {V}}\) such that

$$\begin{aligned} a(D-i)=\frac{(n-1)(n-2)}{2}-t_0-2. \end{aligned}$$

By Theorem 3.4(iii), \(D-i\) is an initial and terminal \((1,k+1,t_0+2)\)-transitive tournament. We may assume \(D-i=H(k,\alpha )\) with \(\alpha \) is a \(t_0\)-subset of \(\langle k\rangle \setminus \{1\}\). It is clear that

$$\begin{aligned} d(i)=a(D)-a(D-i)=n-3. \end{aligned}$$
(4.3)

By Lemma 3.3, we have

$$\begin{aligned} i\nrightarrow i. \end{aligned}$$
(4.4)

By Lemma 4.1, \(V_{k+1}\nrightarrow i\nrightarrow V_1\). If \({\mathcal {V}}\nrightarrow i\), we have \(i\rightarrow {\mathcal {V}}\backslash V_1\), which implies that \(D\cong H_1(k,\alpha )\). Similarly, if \(i\nrightarrow {\mathcal {V}}\), we have \({\mathcal {V}}\backslash V_{k+1}\rightarrow i\). It follows that \(D\cong H_{k+1}(k,\alpha )\). Now assume i has both predecessors and successors. Define \(s'\) and \(t'\) as before. By (4.3) and (4.4), \(t'\le s'+3\). By Lemma 4.2, \(t'\ge s'+2\).

Suppose \(t'=s'+3\). It is clear that \(s'\in \langle k-2\rangle \). Moreover, \(|V_{s'+1}|=|V_{s'+2}|=1\) as \(d^+(i)+d^-(i)=n-3\). It follows that \(D= H_i(k,s',\alpha )\) with \(|V_{s'+1}|=|V_{s'+2}|=1\) and \(s'\in \langle k-2\rangle \). Suppose \(t'=s'+2\). By (4.3) and (4.4), \(1\le |V_{s'+1}|\le 2\). If \(|V_{s'+1}|=1\), we can conclude that \(|V_{s'}|+|V_{s'+2}|\ge 3\). Otherwise, there is a walk of length k as follows.

$$\begin{aligned} 1\rightarrow \cdots \rightarrow s'\rightarrow s'+1\rightarrow s'+2\rightarrow \cdots \rightarrow k+1. \end{aligned}$$

For each \(j\in \alpha \), in the above walk we can replace j by \(k+1+j\) to obtain a new walk. We can also replace \(s'+1\) by i since \(s'\rightarrow i\rightarrow s'+2\). So there are \(2^{t_0+1}\) walks of length k from 1 to \(k+1\), a contradiction. Hence, we get \(|V_{s'}|\ge 2\) or \(|V_{s'+2}|\ge 2\). Moreover, there is a vertex in \(V_{s'}\cup V_{s'+2}\) not adjacent with i. Without loss of generality, we assume that \(|V_{s'}|=2\) and \(s'+k+1\nrightarrow i\), i.e., \(D\cong H(k,\alpha _1)-(s'+k+1,s'+k+2)\) with \(\alpha _1=\alpha \cup \{s'+1\}\) and \(|V_{s'}|=2\). If \(|V_{s'+1}|=2\), D is isomorphic to \(H_{s'+1}(k,\alpha )\) with \(s'+1\in \alpha \setminus \{1\}\). For the both cases, when \(t<2^{t_0-1}\times 3\), D is not \({\mathscr {F}}_{k,t+1}\)-free, a contradiction; when \(t\ge 2^{t_0-1}\times 3\), D is \({\mathscr {F}}_{k,t+1}\)-free and has the maximum number of arcs.

Case 2. For all \(i\in {\mathcal {V}}\), \(a(D-i)\le (n-1)(n-2)/2-t_0-3\). Then

$$\begin{aligned} d(i)\ge n-2 \text {~~for all~~} i\in {\mathcal {V}}. \end{aligned}$$
(4.5)

By Lemma (Huang and Lyu 2020a, Lemma 2.3) we have

$$\begin{aligned} d(i)\le n \text {~~for all~~} i\in {\mathcal {V}}. \end{aligned}$$
(4.6)

Suppose \(d(i_0)=n\). If \(i_0\rightarrow i_0\), we get \(d^+(i_0)+d^-(i_0)=k+t_0+5\). Without loss of generality, we assume \(d^+(i_0)\ge 3t+3\). By Lemma 3.2, \(i_0\) is joined with every vertex by exactly one arc. Moreover, \(D-i_0\) contains no cycles of length less than 5. Combining with Lemma 4.3, \(D-i_0\) contains no cycles. It is well known (West 1996, Lemma 1.4.23) that if each vertex of a diagraph has a successor, then this digraph contains a cycle. It follows that there is a vertex \(i_1\) with no successors in \({\mathcal {V}}\setminus \{i_0\}\). (4.5) indicates \(i_1\) has at least \(n-3\) predecessors in \({\mathcal {V}}\setminus \{i_0\}\). Moreover, \(|N^+(i_0)\cap N^-(i_1)|\ge 3t-1\). Then there are more than t walks of length k in the following form.

$$\begin{aligned} i_0\rightarrow \cdots \rightarrow i_0\rightarrow x\rightarrow i_1, \end{aligned}$$

where x is any vertex in \(N^+(i_0)\cap N^-(i_1)\). We get a contradiction. Thus \(i_0\nrightarrow i_0\). Now we assume there is \(i_0'\in {\mathcal {V}}\setminus \{i_0\}\) such that \(i_0\rightarrow i_0'\rightarrow i_0\). Adopting the same technique as above, we can get a contradiction. Therefore, we obtain

$$\begin{aligned} d(i)\le n -1\text {~~for all~~} i\in {\mathcal {V}}. \end{aligned}$$
(4.7)

We assert that D is loopless. Otherwise, we let \(i_0\rightarrow i_0\). By (4.5), \(d^+(i_0)+d^-(i_0)\ge k+t_0+3\). Without loss of generality, we let \(d^+(i_0)\ge 3t+2\). By Lemma 3.2, each successor of \(i_0\) except itself cannot be contained in any 2-cycle or loop. Then each vertex in \(N^+(i_0)\) is incident with more than \(d^+(i_0)-2\) arcs in \(D[N^+(i_0)]\). By Lemma 4.3 and Lemma 3.2, \(D[N^+(i_0)]\) has only one cycle: \(i_0\rightarrow i_0\). Then there is a vertex, say \(i_1\), with no successors in \(N^+(i_0)\). Moreover, \(|N^+(i_0)\cap N^-(i_1)|\ge 3t\). Then there are more than t walks of length k in the following form.

$$\begin{aligned} i_0\rightarrow \cdots \rightarrow i_0\rightarrow x\rightarrow i_1, \end{aligned}$$

where x is any vertex in \(N^+(i_0)\cap N^-(i_1)\). We get a contradiction with D is \({\mathscr {F}}_{k,t+1}\)-free. Hence, D has no loop. Similarly, D has no 2-cycles.

Let

$$\begin{aligned} V_1=\{i\in {\mathcal {V}}:d(i)=n-1\} ~\mathrm{and}~ V_2=\{i\in {\mathcal {V}}:d(i)=n-2\}. \end{aligned}$$

Recalling (4.5) and (4.7), \({\mathcal {V}}=V_1\cup V_2\). From (4.1) we have \(|V_1|=k-t_0-4\) and \(|V_2|=2t_0+8\). It is clear \(D[V_1]\) is a tournament. Suppose \(D[V_1]\) has a cycle. By (Huang and Lyu 2020a, Lemma 2.2), \(D[V_1]\) has a 3-cycle, say, \(a\rightarrow b\rightarrow c\rightarrow a\). Without loss of generality, we assume \(N^+_{D[V_1]}(a)\ge t+2\). By Lemma  3.3, \(D[N^+_{D[V_1]}(a)]\) contains a cycle. Moreover, \(D[N^+_{D[V_1]}(a)]\) has a 3-cycle. By Lemma 3.2, \(D[V_1]\) is not \({\mathscr {F}}_{k,t+1}\)-free, a contradiction. Thus \(D[V_1]\) is a transitive tournament. For simplicity, we let \(k_1=k-t_0-4\). Without loss of generality, let \(V_1=\langle k_1\rangle \) and

$$\begin{aligned} D[V_1]=T_{k_1}. \end{aligned}$$
(4.8)

Moreover, Lemma 3.3 implies the following claim.

Claim 1

D contains no cycles.

We partition \(V_2\) into \(W_{1},W_{2},\ldots ,W_{t_0+4}\) such that each \(W_{i}\) consisting of two vertices of \(V_2\) which are not adjacent, say \(x_i\) and \(y_i\). Given \(i\in V_2\), let \(s_i\in \langle k_1\rangle \) be the largest integer such that \(s_i\rightarrow i\) and \(t_i\in \langle k_1\rangle \) be the smallest integer such that \(i\rightarrow t_i\). Here if \(i\nrightarrow \langle k_1\rangle \) let \(s_i=0\) and if \(\langle k_1\rangle \nrightarrow i\) let \(t_i=k_1+1\). For each \(i\in V_2\), it is joined with each vertex of \( \langle k_1\rangle \) by exactly one arc. By Claim 1 we have

$$\begin{aligned} t_i=s_i+1~\text { for~ all~} i\in V_2, \end{aligned}$$
(4.9)

which implies

$$\begin{aligned} \{1,\ldots ,s_i\}\rightarrow i\rightarrow \{s_i+1,\ldots ,k_1\}. \end{aligned}$$
(4.10)

Moreover, for \(i,j\in V_2\),

$$\begin{aligned} \mathrm{if}~ i\rightarrow j,~ \mathrm{then}~ s_i\le s_j. \end{aligned}$$
(4.11)

Given any \(\alpha \subset V_2\), there are \(n(\alpha )\) distinct neighborhoods in \(\langle k_1\rangle \) for the vertices in \(\alpha \). We partition \(\alpha \) into \(\bigcup \limits _{i=1}^{n(\alpha )}U_i(\alpha )\) such that for each pair jl, \(s_{j}=s_{l}\) if and only if \(j,l\in U_i\) with \(i\in n(\alpha )\). We abbreviate \(U_i(\alpha )\) as \(U_i\) if no confusion arises. Define \(s(U_i)=s_j\) with \(j\in U_i\) for \(i=1,\ldots ,n(\alpha )\). We may assume \(s({U_1})< s({U_2})<\cdots <s({U_{n(\alpha )}})\). \(\alpha \) is said to be insertable if \(D[U_i]\) contains a path of length \(|U_i|-1\) for \(i\in \{1,\ldots ,n(\alpha )\}\). There is a path of length \(k_1-1\) as follows.

$$\begin{aligned} p:1\rightarrow 2\rightarrow \cdots \rightarrow k_1. \end{aligned}$$

If \(\alpha \subseteq V_2\) is insertable, we can obtain a new walk by inserting the vertices of \(\alpha \) into p following the strategy below.

$$\begin{aligned} 1\rightarrow \cdots \rightarrow s(U_1)\xrightarrow {P_1}s(U_1)+1\rightarrow \cdots \rightarrow s(U_{n(\alpha )})\xrightarrow {P_{n(\alpha )}}s(U_{n(\alpha )})+1\rightarrow \cdots \rightarrow k_1, \end{aligned}$$

where \(P_i\) is the path made up of all vertices of \(U_i\). Note that if \(s(U_1)=0\), \(P_1\) precedes 1; and if \(s(U_{n(\alpha )})=k_1\), \(k_1\) precedes \(P_{n(\alpha )}\) and the new path ends at \(P_{n(\alpha )}\). Hence, we could obtain a new path of length \(k_1-1+|\alpha |\) from inserting vertices of \(\alpha \) into p. In the remainder of this proof, our discussion is based on this fact: every tournament has a path containing all its vertices (Harary and Moser 1966, Theorem 4).

Claim 2

\(s_{x_i}=s_{y_i}\) for \(i\in \{1,\ldots ,t_0+4\}\).

Otherwise, there is \(b\in \{1,\ldots ,t_0+4\}\) such that \(s_{x_{b}}<s_{y_b}\). Let

$$\begin{aligned} \alpha _1=\{y_b\}\cup \{x_i:i\in \langle t_0+4\rangle \}. \end{aligned}$$

It is clear that if \(D[U_i]\) is a transitive tournament for \(i=1,\ldots ,n(\alpha )\), then \(\alpha _1\) is insertable. Without loss of generality, we assume \(x_b\in U_{j_1}\) and \(y_d\in U_{j_2}\) with \(j_1<j_2\).

Suppose for any distinct pair \(\{i,j\}\subseteq \langle t_0+4\rangle \setminus \{b\}\), \(W_{i}\rightarrow W_{j}\) or \(W_{j}\rightarrow W_{i}\). We obtain a walk w of length k by inserting the vertices of \(\alpha _1\) into p. Assume x is its initial vertex and y its terminal vertex. Without loss of generality, we assume \(x\in W_{c}\) and \(y\in W_{d}\) with bcd three distinct integers. Let \(\beta =\langle t_0+4\rangle \setminus \{b,c,d\}\). For each \(i\in \beta \), we have two choices, i.e., we can replace \(x_i\) with \(y_i\) in \(\alpha _1\) to obtain a new insertable set. Then there are \(2^{t_0+1}\) walks of length k with initial vertex x and terminal vertex y, a contradiction.

Now assume without loss of generality there are \(c,d\in \langle t_0+4\rangle \setminus \{b\}\) such that \(x_{c}\rightarrow x_{d}\rightarrow y_{c}\). Let

$$\begin{aligned} \alpha =\{y_b,y_c\}\cup \{x_i:i\in \langle t_0+4\rangle \}. \end{aligned}$$

If \(s_{x_c}\ne s_{y_c}\), then \(D[U_i]\) is a tournament for \(i=1,\ldots ,n(\alpha )\). It follows that \(\alpha \) is insertable, so there is a walk of length \(k+1\) obtained by inserting \(\alpha \) into p. We can obtain a new walk of length k by deleting any vertex in \(\langle k_1\rangle \setminus \{1,k_1,s_{x_b}+1,\min (s_{x_c},s_{y_c})+1\}\) and joining its predecessor to its successor. There are more than t walks of length k with the same endpoints, a contradiction. Now we assume \(s_{x_c}= s_{y_c}\). Then there is \(j\in \{1,2,\ldots ,n(\alpha )\}\) such that \(x_c,x_d,y_c\) are contained in \(U_j\). By Claim 1, we can partition \(U_j\setminus \{x_c,x_d,y_c\}\) into \(N_{U_j}^+(y_c)\), \(N_{U_j}^+(x_d)\cap N_{U_j}^-(y_c)\), \(N_{U_j}^+(x_c)\cap N_{U_j}^-(x_d)\) and \(N_{U_j}^-(x_c)\), where \(N^+_{V}(x)\) (\(N^-_{V}(x)\)) denotes the set of successors (predecessors) of x in the vertex set V. The vertices of each set make up a path. Then there is a path containing all vertices in \(U_j\). Moreover, \(\alpha \) is insertable.

By inserting \(\alpha \) into p, we can obtain a walk \(w_1\) of length \(k+1\) with the initial vertex x and the terminal vertex y. Then new walks of length k with the same endpoints xy could be obtained from \(w_1\) by deleting any vertex of \(\{2,\ldots ,k_1-1\}\setminus \{s_{x_b}+1\}\) and joining its predecessor to its successor. Note \(t\ge 2\). Then there are more than t walks of length k with the same endpoints, a contradiction. Hence, we get Claim 2.

Claim 3

For distinct pair \(i,j\in \langle t_0+4\rangle \), either \(W_{i}\rightarrow W_{j}\) or \(W_{j}\rightarrow W_{i}\).

Recalling (4.11), it is sufficient to consider the case \(s_{x_i}=s_{x_j}\). Suppose there are \(c,d\in \langle t_0+4\rangle \) such that \(x_{c}\rightarrow x_{d}\rightarrow y_{c}\). If \(y_d\rightarrow x_c\), we let

$$\begin{aligned} \alpha =\{y_c,y_d\}\cup \{x_i:i\in \langle t_0+4\rangle \}. \end{aligned}$$

Applying the same analysis as in the proof of Claim 2, \(\alpha \) is insertable. Then we can obtain a walk of length \(k+1\) with endpoints xy by inserting \(\alpha \) into p, say, \(w_1\). We obtain walks of length k with endpoints xy from the above walk by deleting one of vertex of \(\langle k_1\rangle \setminus \{1,k_1\}\) and joining its predecessor to its successor. Then there are more than t walks of length k with the same endpoints, a contradiction. If \(x_d\rightarrow y_d\), using the same analysis we get a contradiction.

Now assume \(x_{c}\rightarrow y_{d}\rightarrow y_{c}\). Without loss of generality, we assume \(x_j\in W_{j}\) and \(x_l\in W_{l}\) such that \(x_j\) has no predecessor in \(V_2\) and \(x_l\) has no successor in \(V_2\). We let

$$\begin{aligned} \alpha =W_{c}\cup \{x_j,x_l\}\cup \{z_i:i\in \langle t_0+4\rangle \setminus \{c,j,l\}\}, \end{aligned}$$

where \(z_i\in W_{i}\) for \(i\in \langle t_0+4\rangle \). It is clear that \(\alpha \) is insertable.

By inserting \(\alpha \) into w we obtain walks of length k with the same endpoints. For \(i\in \langle t_0+4\rangle \setminus \{c,j,l\}\), we have two choices for \(z_i\). Then there are \(2^{t_0+1}\) walks of length k with the same endpoints, a contradiction. Therefore, we get Claim 3.

Combining with (4.8), (4.10), (4.11), Claim 2 and Claim 3, D is a \((1,k,t_0+4)\)-transitive tournament. This completes the proof. \(\square \)

5 Proof of theorem 2.2

In this section, we give the proof of Theorem 2.2.

Proof of theorem 2.2

To complete the proof, we follow the strategy as follows. First we prove (2.1). The sufficiency of the second part is clear. It is sufficient to prove the necessity. Next we show that Theorem 2.2 holds for \(n=k+t_0+5\) (Claim 1). Taking this fact as the inductional base, we use induction to complete the proof.

We first use induction on n to prove (2.1). By Theorem 4.4 we know (2.1) holds for \(n=k+4+t_0\). Assume (2.1) holds for \(n=k+5+t_0,\ldots ,sk+r\), where \(0\le r<k\) and \(s>0\) are integers. Now consider the case \(n=sk+r+1.\) Let uv be integers such that \(v<k\) and \( n=uk+v\). Then \(u=s\), \(v=r+1\) when \(r<k-1\), and \(u=s+1\), \(v=0\) when \(r=k-1\).

Given any \( {\mathscr {F}}_{k,t+1}\)-free digraph D of order n. For any \( i\in {\mathcal {V}}\), since the digraph \(D-i\) is \({\mathscr {F}}_{k,t+1}\)-free, by the induction hypothesis we have

$$\begin{aligned} a(D-i)\le & {} ex(n-1,{\mathscr {F}}_{k})\nonumber \\= & {} {n-1 \atopwithdelims ()2} -{s\atopwithdelims ()2}k-sr\nonumber \\= & {} \frac{(n-1)(n-2)}{2}-\frac{(s-1)(n-1)}{2}-\frac{(s+1)r}{2}. \end{aligned}$$
(5.1)

Applying Lemma 3.1 we have

$$\begin{aligned} a(D)\le & {} \frac{n(n-1)}{2}-\frac{(s-1)(n-1)}{2}-\frac{(s+1)r}{2}-s\\= & {} \frac{n(n-1)}{2}-\frac{(s-1)n}{2}-\frac{(s+1)(r+1)}{2}\\= & {} \frac{n(n-1)}{2}-\frac{(u-1)n}{2}-\frac{(u+1)v}{2}. \end{aligned}$$

Hence,

$$\begin{aligned} ex(n,{\mathscr {F}}_{k})\le \frac{n(n-1)}{2}-\frac{(u-1)n}{2}-\frac{(u+1)v}{2}. \end{aligned}$$

On the other hand, if D is a (ukv)-transitive tournament, then D is \({\mathscr {F}}_{k,t+1}\)-free since it has no walk of length k. Moreover, the size of D is

$$\begin{aligned} a(D)=\frac{n(n-1)}{2}-\frac{(u-1)n}{2}-\frac{(u+1)v}{2}. \end{aligned}$$

Hence, (2.1) holds.

Now we prove the second part. It is sufficient to prove the necessity since the sufficiency is clear. Next we prove that Theorem 2.2 holds for \(n=k+t_0+5\) \(\square \)

Claim 1

The second part of Theorem 2.2 holds when \(n=k+t_0+5\).

Let \(D\in EX(k+t_0+5,{\mathscr {F}}_{k,t})\). By (2.1), we have

$$\begin{aligned} d(i)\ge n-2 ~{ for ~all~}i\in {\mathcal {V}}. \end{aligned}$$
(5.2)

By Lemma 3.1, there exists some \(i_0\) such that

$$\begin{aligned} a(D-i_0)=\frac{(n-1)(n-2)}{2}-t_0-4. \end{aligned}$$

According to Theorem 4.4 we distinguish four cases.

Case 1. \(D-i_0\cong H_i(k,\alpha )\), where \(\alpha \) is a \(t_0\)-subset of \(\langle k\rangle \setminus \{1\}\) and \(i\in \alpha \cup \{1,k+1\}\). Without loss of generality, we let \(D-i_0= H_i(k,\alpha )\), where \(\alpha \) is a \(t_0\)-subset of \(\langle k\rangle \setminus \{1\}\). By (5.2) we get \(i\leftrightarrow i_0\) and \(i+k+1\leftrightarrow i_0\). By Lemma 3.2, D is not \({\mathscr {F}}_{k,t+1}\)-free, a contradiction.

Case 2. \(D-i_0\cong H_u(k,i,\alpha )\) with \(\alpha \) is a \(t_0\)-subset of \(\langle k\rangle \setminus \{1\}\), \(i\in \langle k-2\rangle \) and \(|V_{i+1}|=|V_{i+2}|=1\). Without loss of generality, we assume \(D-i_0= H_u(k,i,\alpha )\). Since u is incident with \(n-4\) arcs in \(D-i_0\). Combining with (5.2), we obtain

$$\begin{aligned} u\rightarrow i_0\rightarrow u. \end{aligned}$$
(5.3)

Since two 2-cycles cannot be joint, there is at most one arc between \(i_0\) and 1. It follows that \(d(1)\le n-2\). Recalling (5.2), we obtain \(d(1)= n-2\), which implies \(D-1\in EX(k+t_0+4,{\mathscr {F}}_{k,t+1})\). From Theorem 4.4\(D-1\) contains no cycle, which contradicts (5.3).

Case 3. \(D-i_0\cong H(k,\alpha \cup \{i+1\})-(i+k+1,i+k+2)\), where \(\alpha \) is a \(t_0\)-subset of \(\langle k\rangle \setminus \{1\}\), \(i\in \alpha ~{ and}~i+1\in \langle k\rangle \setminus (\{1\}\cup \alpha )\). Without loss of generality, we let \(D-i_0=H(k,\alpha \cup \{i+1\})-(i+k+1,i+k+2)\). Applying the same arguments as in Case 2 we can get a contradiction.

Case 4. \(D-i_0\) is a \((1,k,t_0+4)\)-transitive tournament. Given \(\alpha =\{j_1,j_2,\ldots ,j_{t_0+4}\}\subset \langle k\rangle \), denote by

$$\begin{aligned} V_i=\{i,i+k\}~ \mathrm{for~} i\in \alpha ,~ V_i=\{i\}~\mathrm{for~} i\in \langle k\rangle \backslash \alpha . \end{aligned}$$

Without loss of generality, we let D be a digraph with vertex set

$$\begin{aligned} {\mathcal {V}}=\bigcup \limits _{i=1}^{k} V_i\cup \{i_0\} \end{aligned}$$

such that there is an arc (xy) in \(D-i_0\) if and only if \(x\in V_i\), \(y\in V_j\) with \(i<j\). It is clear that

$$\begin{aligned} d(i_0)=a(D)-a(D-i_0)=n-2. \end{aligned}$$
(5.4)

Now we assert that

$$\begin{aligned} i_0\nrightarrow i_0. \end{aligned}$$
(5.5)

Otherwise, \(i_0\rightarrow i_0\). By (5.4), \(d^+(i_0)+d^-(i_0)= k+t_0+4\ge 6t+5\). Without loss of generality, we assume \(i_0\) has at least 3t successors in \({\mathcal {V}}\backslash (\{i_0\}\cup V_k)\). For each vertex \(i\in N^+(i_0)\backslash (\{i_0\}\cup V_k)\), there is a walk of length k with the initial vertex \(i_0\) and the terminal vertex k in the following form.

$$\begin{aligned} \cdots \rightarrow i_0\rightarrow i_0\rightarrow i\rightarrow k. \end{aligned}$$

We get a contradiction. Thus, (5.5) holds.

Let \(s'\in \langle k\rangle \) be the largest integer such that there is a vertex \(x\in V_{s'}\) with \(x\rightarrow i_0\) and let \(t'\in \langle k\rangle \) be the smallest integer such that there is a vertex \(y\in V_{t'}\) with \(i_0\rightarrow y\). Here we let \(s'=0\) if \({\mathcal {V}}\nrightarrow i_0\) and let \(t'=k+1\) if \(i_0\nrightarrow {\mathcal {V}}\). Without loss of generality, we let \(s'\rightarrow i_0\) and \(i_0\rightarrow t'\).

We assert that \(t'=s'+2\). By (5.4) and (5.5), we obtain \(t'\le s'+2\). To the contrary suppose \(t'\le s'+1\). If \(s'=0\), we get \(t'=1\), i.e., \(i_0\rightarrow 1\). Then there is a walk of length k as follows.

$$\begin{aligned} i_0\rightarrow 1\rightarrow 2\rightarrow \cdots \rightarrow k. \end{aligned}$$

For each \(i \in \alpha \backslash \{1,k\}\), we can replace i with \(i+k\) in the above walk to obtain a new one. Hence, there are at least \(2^{t_0+2}\) walks from \(i_0\) to k with length k, a contradiction. If \(s'=k\), applying the same arguments as above, we get a contradiction.

Now we assume \(s'\in \{1,\ldots ,k-1\}\). If \(t'=s'+1\), there is a walk of length k as follows.

$$\begin{aligned} 1\rightarrow 2\rightarrow \cdots \rightarrow s'\rightarrow i_0\rightarrow s'+1\rightarrow \cdots \rightarrow k. \end{aligned}$$

Recalling (5.4) and (5.5), either \(V_{s'}\rightarrow i_0\) or \(i_0\rightarrow V_{t'}\). Without loss of generality, we assume \(V_{s'}\rightarrow i_0\). For each \(i \in \alpha \backslash \{1,s'+1,k\}\), we can replace i with \(i+k\) in the walk above. Hence, there are at least \(2^{t_0+1}\) walks from 1 to k with length k, a contradiction.

Now we assume \(t'\le s'\). Then there is a walk of length \(k+1\) as follows.

$$\begin{aligned} 1\rightarrow 2\rightarrow \cdots \rightarrow s'\rightarrow i_0\rightarrow t'\rightarrow s'+1\rightarrow \cdots \rightarrow k. \end{aligned}$$

For each \(i\in \langle k\rangle \setminus \{1,s',t',k\}\), we can obtain a walk from the above walk by deleting i and joining its predecessor to its successor. Since \(k\ge 6t+1\), we have \(|\langle k\rangle \setminus \{1,s',t',k\}|\ge t+1\). Then there are more than t walks of length k with the same endpoints, a contradiction.

Therefore, we obtain \(t'=s'+2\). It follows that \(V_i\rightarrow i_0\) for \(i\le s'\) and \(i_0\rightarrow V_i\) for \(i\ge s'+2\), where \(s'\in \langle k-1\rangle \). Moreover, \(|V_{s'+1}|=1\). Hence, we get D is a \((1,k,t_0+5)\)-transitive tournament. We get Claim 1.

We use induction on n to prove the second part of Theorem 2.2. Assume for \(n\le sk+r\) and \(0\le r<k\), \(D\in EX(n,{\mathscr {F}}_{k,t+1})\) if and only if D is a (skr)-transitive tournament. Now consider the case \(n=sk+r+1.\) Let uv be integers such that \(v<k\) and \( n=uk+v\). Then \(u=s\), \(v=r+1\) when \(t<k-1\), and \(u=s+1\), \(v=0\) when \(r=k-1\).

Suppose \(D\in Ex(u,k,v)\). Applying Lemma 3.1 to D, by (2.1) we know there is some \(i_0\in {\mathcal {V}}\) such that equality in (5.1) holds. By the induction hypothesis we may assume \(D-i_0\) is an (skr)-transitive tournament.

Let \(\{j_1,\ldots ,j_r\}\) be an arbitrary r-subset of \(\{1,\ldots ,k\}\). Denote by

$$\begin{aligned} V_i=\{i,k+i,\ldots ,(s-1)k+i,sk+i\} \mathrm{~ for~} i\in \{j_1,\ldots ,j_r\} \end{aligned}$$

and

$$\begin{aligned} V_i=\{i,k+i,\ldots ,(s-1)k+i\} \mathrm{~for~} i\in \{1,\ldots ,k\}\backslash \{j_1,\ldots ,j_r\}. \end{aligned}$$

Without loss of generality, we let D be a digraph with vertex set

$$\begin{aligned} {\mathcal {V}}=\bigcup \limits _{i=1}^{k} V_i\cup \{i_0\} \end{aligned}$$

such that there is an arc (xy) in \(D-i_0\) if and only if \(x\in V_i\), \(y\in V_j\) with \(i<j\).

Applying the same arguments as in Case 4 of Claim 1, we obtain D is a (ukv)-transitive tournament. This completes the proof. \(\Box \)