LATIN 2018: LATIN 2018: Theoretical Informatics pp 427-436

# Constructive Ramsey Numbers for Loose Hyperpaths

• Andrzej Dudek
• Andrzej Ruciński
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10807)

## Abstract

For positive integers k and $$\ell$$, a k-uniform hypergraph is called a loose path of length $$\ell$$, and denoted by $$P_\ell ^{(k)}$$, if its vertex set is $$\{v_1, v_2, \ldots , v_{(k-1)\ell +1}\}$$ and the edge set is $$\{e_i = \{ v_{(i-1)(k-1)+q} : 1 \le q \le k \},\ i=1,\dots ,\ell \}$$, that is, each pair of consecutive edges intersects on a single vertex. Let $$R(P_\ell ^{(k)};r)$$ be the multicolor Ramsey number of a loose path that is the minimum n such that every r-edge-coloring of the complete k-uniform hypergraph $$K_n^{(k)}$$ yields a monochromatic copy of $$P_\ell ^{(k)}$$. In this note we are interested in constructive upper bounds on $$R(P_\ell ^{(k)};r)$$ which means that on the cost of possibly enlarging the order of the complete hypergraph, we would like to efficiently find a monochromatic copy of $$P_\ell ^{(k)}$$ in every coloring. In particular, we show that there is a constant $$c>0$$ such that for all $$k\ge 2$$, $$\ell \ge 3$$, $$2\le r\le k-1$$, and $$n\ge k(\ell +1)r(1+\ln (r))$$, there is an algorithm such that for every r-edge-coloring of the edges of $$K_n^{(k)}$$, it finds a monochromatic copy of $$P_\ell ^{(k)}$$ in time at most $$cn^k$$.

## 1 Introduction

For positive integers $$k\ge 2$$ and $$\ell \ge 0$$, a k-uniform hypergraph is called a loose path of length $$\ell$$, and denoted by $$P_\ell ^{(k)}$$, if its vertex set is $$\{v_1, v_2, \ldots , v_{(k-1)\ell +1}\}$$ and the edge set is $$\{e_i = \{ v_{(i-1)(k-1)+q} : 1 \le q \le k \},\ i=1,\dots ,\ell \}$$, that is, for $$\ell \ge 2$$, each pair of consecutive edges intersects on a single vertex (see Fig. 1), while for $$\ell =0$$ and $$\ell =1$$ it is, respectively, a single vertex and an edge. For $$k=2$$ the loose path $$P_{\ell }^{(2)}$$ is just a (graph) path on $$\ell +1$$ vertices.

Let H be a k-uniform hypergraph and $$r\ge 2$$ be an integer. The multicolor Ramsey number R(Hr) is the minimum n such that every r-edge-coloring of the complete k-uniform hypergraph $$K_n^{(k)}$$ yields a monochromatic copy of H.

For graphs, determining the Ramsey number $$R(P_\ell ^{(2)},r)$$ is a well-known problem that attracted a lot of attention. It was shown by Gerencsér and Gyárfás [6] that
\begin{aligned} R(P_\ell ^{(2)},2) = \left\lfloor \frac{3\ell +1}{2} \right\rfloor . \end{aligned}
(1)
For three colors Figaj and Łuczak [5] proved that $$R(P_\ell ^{(2)},3)\approx 2\ell$$. Soon after, Gyárfás et al. [7, 8] determined this number exactly, showing that for all sufficiently large $$\ell$$
\begin{aligned} R(P_\ell ^{(2)},3) = {\left\{ \begin{array}{ll} 2\ell +1 &{} \text { for even } \ell ,\\ 2\ell &{} \text { for odd } \ell , \end{array}\right. } \end{aligned}
(2)
as conjectured earlier by Faudree and Schelp [4]. For $$r\ge 4$$ much less is known. A celebrated Turán-type result of Erdős and Gallai [3] implies that
\begin{aligned} R(P^{(2)}_\ell ,r) \le r\ell . \end{aligned}
(3)
Recently, this was slightly improved by Sárközy [9] and, subsequently, by Davies et al. [1] who showed that for all sufficiently large $$\ell$$,
\begin{aligned} R(P_\ell ^{(2)};r) \le (r-1/4)(\ell +1). \end{aligned}
(4)
In this note we are mostly interested in constructive bounds which means that on the cost of possibly enlarging the order of the complete hypergraph, we would like to efficiently find a monochromatic copy of a target hypergraph F in every coloring. Clearly, by examining all copies of F in $$K^{(k)}_n$$ for $$n\ge R(F;r)$$, we can always find a monochromatic one in time $$O(n^{|V(F)|})$$. Hence, we are interested in complexity not depending on F, preferably $$O(n^k)$$. Given a k-graph F, a constant $$c>0$$ and integers r and n, we say that a property $$\mathcal {R}(F,r,c,n)$$ holds if there is an algorithm such that for every r-edge-coloring of the edges of $$K_n^{(k)}$$, it finds a monochromatic copy of F in time at most $$cn^k$$. For graphs, a constructive result of this type can be deduced from the proof of Lemma 3.5 in Dudek and Prałat [2].

### Theorem 1

([2]) . There is a constant $$c>0$$ such that for all $$\ell \ge 3$$, $$r\ge 2$$, and $$n\ge 2^{r+1} \ell$$, property $$\mathcal {R}(P_\ell ^{(2)},r,c,n)$$ holds.

Our goal is to obtain similar constructive results for loose hyperpaths. However, to have a reference point we first state, without proof, a general (nonconstructive) upper bound, obtained iteratively for all $$k\ge 2$$, starting from the Erdős-Gallai bound (3).

### Theorem 2

For all $$k\ge 2$$, $$\ell \ge 3$$, and $$r\ge 2$$ we have $$R(P_\ell ^{(k)};r) \le (k-1)\ell r$$.

One can show that Theorem 2 can be improved for $$r=2$$ or for large $$\ell$$. For $$r=2$$, using (1) instead of (3) at the base step, one gets, for $$k\ge 3$$,
\begin{aligned} R(P_\ell ^{(k)};2) \le (2k-5/2)\ell . \end{aligned}
(5)
For large $$\ell$$, using (2) instead of (3), we obtain for $$r=3$$ that
$$R(P_\ell ^{(k)};3) \le (3k-4)\ell ,$$
and for $$r\ge 4$$, by (4),
$$R(P_\ell ^{(k)};r) \le (k-1)\ell r - \ell /4.$$
By replacing the Erdős-Gallai bound (3) with the assumption on n given in Theorem 1, the proof of Theorem 2 can be adapted to yield a constructive result.

### Theorem 3

There is a constant $$c>0$$ such that for all $$k\ge 2$$, $$\ell \ge 3$$, $$r\ge 2$$, and $$n\ge 2^{r+1}\ell + (k-2)\ell r$$, property $$\mathcal {R}(P_\ell ^{(k)},r,c,n)$$ holds.

Our main constructive bound (valid only for $$r\le k$$) utilizes a more sophisticated algorithm.

### Theorem 4

There is a constant $$c>0$$ such that for all $$k\ge 2$$, $$\ell \ge 3$$, $$2\le r\le k$$, and $$n\ge k(\ell +1)r\left( 1+\frac{1}{k-r+1}+\ln \left( 1+\frac{r-2}{k-r+1}\right) \right)$$, property $$\mathcal {R}(P_\ell ^{(k)},r,c,n)$$ holds. For $$r=2$$, the bound on n can be improved to $$n\ge (2k-2)\ell +k$$.

Note that for $$r=2$$ the lower bound on n in Theorem 4 is very close to that in (5). For $$r=k\ge 3$$ the bound assumes a simple form
$$n\ge k^2(\ell +1)(2+\ln (k-1)).$$
Furthermore, for $$r\le k-1$$, one can show that
\begin{aligned} \frac{1}{k-r+1}+\ln \left( 1+\frac{r-2}{k-r+1}\right) \le \ln \left( 1+\frac{r-1}{k-r}\right) \end{aligned}
which yields the following corollary.

### Corollary 1

There is a constant $$c>0$$ such that for all $$k\ge 3$$, $$\ell \ge 3$$, $$3\le r\le k-1$$, and $$n\ge k(\ell +1)r\left( 1+\ln \left( 1+\frac{r-1}{k-r}\right) \right)$$, property $$\mathcal {R}(P_\ell ^{(k)},r,c,n)$$ holds.

We can further replace the lower bound on n by (slightly weaker but simpler) $$n\ge k(\ell +1)r(1+\ln r)$$.

Observe that in several instances the lower bound on n in Theorem 4 (and also in Corollary 1) is significantly better (that means smaller) than the one in Theorem 3 (for example for large k and $$k/2 \le r \le k$$). On the other hand, for some instances the bounds in Theorems 3 and 4 are basically the same. For example, for fixed r, large k and $$\ell \ge k$$ the lower bound is $$k\ell r + o(k\ell )$$. This also matches asymptotically the bound in Theorem 2.

In this note we only present the proof of Theorem 4.

## 2 Proof of Theorem 4

Given integers k and $$2\le m\le k$$, and disjoint sets of vertices $$W_1,\dots , W_{m-1}$$, $$V_m$$, an m-partite complete k-graph $$K^{(k)}(W_1,\dots , W_{m-1},V_m)$$ consists of all k-tuples of vertices with exactly one element in each $$W_i$$, $$i=1,\dots ,m-1$$, and $$k-m+1$$ elements in $$V_m$$. Note that if $$|W_i|\ge \ell$$, $$i=1,\dots ,m-1$$, and $$|V_m|\ge \ell (k-m)+1$$ for $$m\le k-1$$ (or $$|V_m|\ge \ell$$ for $$m=k$$), then $$K^{(k)}(W_1,\dots , W_{m-1},V_m)$$ contains $$P_\ell ^{(k)}$$.

We now give a description of the algorithm. As an input there is an r-coloring of the edges of the complete k-graph $$K_n^{(k)}$$. The algorithm consists of $$r-1$$ implementations of the depth first search (DFS) subroutine, each round exploring the edges of one color only and either finding a monochromatic copy of $$P_\ell ^{(k)}$$ or decreasing the number of colors present on a large subset of vertices, until after the $$(r-1)$$st round we end up with a monochromatic complete r-partite subgraph, large enough to contain a copy of $$P_\ell ^{(k)}$$.

During the ith round, while trying to build a copy of the path $$P_\ell ^{(k)}$$ in the ith color, the algorithm selects a subset $$W_{i,i}$$ from a set of still available vertices $$V_i\subseteq V$$ and, by the end of the round, creates trash bins $$S_i$$ and $$T_i$$. The search for $$P_\ell ^{(k)}$$ is realized by a DFS process which maintains a working path P (in the form of a sequence of vertices) whose endpoints are either extended to a longer path or otherwise put into $$W_{i,i}$$. The round is terminated whenever P becomes a copy of $$P_\ell ^{(k)}$$ or the size of $$W_{i,i}$$ reaches certain threshold, whatever comes first. In the latter case we set $$S_i=V(P)$$.

To better depict the extension process, we introduce the following terminology. An edge of $$P_\ell ^{(k)}$$ is called pendant if it contains at most one vertex of degree two. The vertices of degree one, belonging to the pendant edges of $$P_\ell ^{(k)}$$ are called pendant. In particular, in $$P_1^{(k)}$$ all its k vertices are pendant. For convenience, the unique vertex of the path $$P_0^{(k)}$$ is also considered to be pendant. Observe that for $$t\ge 0$$, to extend a copy P of $$P_t^{(k)}$$ to a copy of $$P_{t+1}^{(k)}$$ one needs to add a new edge which shares exactly one vertex with P and that vertex has to be pendant in P. Our algorithm may also come across a situation when $$P=\emptyset$$, that is, P has no vertices at all. Then by an extension of P we mean any edge whatsoever.

The sets $$W_{i,i}$$ have a double subscript, because they are updated in the later rounds to $$W_{i,i+1}$$, $$W_{i,i+2}$$, and so on, until at the end of the $$(r-1)$$st round (unless a monochromatic $$P_\ell ^{(k)}$$ has been found) one obtains sets $$W_i:= W_{i,r-1}$$, $$i=1,\dots , r-1$$, a final trash set $$T = \bigcup _{i=1}^{r-1} T_{i} \cup \bigcup _{i=1}^{r-1} S_{i}$$ and the remainder set $$V_r=V\setminus (\bigcup _{i=1}^{r-1} W_i\cup T)$$ such that all k-tuples of vertices in $$K^{(k)}(W_1,\dots ,W_{r-1},V_r)$$ are of color r. As an input of the ith round we take sets $$W_{j,i-1}$$, $$j=1,\dots , i-1$$, and $$V_{i-1}$$, inherited from the previous round, and rename them to $$W_{j,i}$$, $$j=1,\dots , i-1$$, and $$V_{i}$$. We also set $$T_i=\emptyset$$ and $$P=\emptyset$$, and update all these sets dynamically until the round ends.

Now come the details. For $$1\le i\le r-1$$, let
\begin{aligned} \tau _i = {\left\{ \begin{array}{ll} (i-1)\left( \frac{\ell }{k-r+1} + \frac{\ell +1}{k-r+2} + \dots + \frac{\ell +1}{k-i} \right) &{} \text { if } 1\le i \le r-2,\\[4pt] (r-2)\frac{\ell }{k-r+1} &{} \text { if } i=r-1, \end{array}\right. } \end{aligned}
(6)
and
$$t_i = \tau _i + 2(i-1).$$
Note that $$\tau _i$$ is generally not an integer. It can be easily shown that for all $$2\le r\le k$$ and $$1\le i\le r-1$$
\begin{aligned} \tau _i \le (i-1)(\ell +1) \left( \frac{1}{k-r+1}+\ln \left( 1+\frac{r-2}{k-r+1}\right) \right) . \end{aligned}
(7)
Before giving a general description of the ith round, we deal separately with the 1st and 2nd round.

Round 1. Set $$V_1=V$$, $$W_{1,1}=\emptyset$$, and $$P=\emptyset$$. Select an arbitrary edge e of color one (say, red), add its vertices to P (in any order), reset $$V_1:=V_1$$ $$\setminus e$$, and try to extend P to a red copy of $$P_2^{(k)}$$. If successful, we appropriately enlarge P, diminish $$V_1$$, and try to further extend P to a red copy of $$P_3^{(k)}$$. This procedure is repeated until finally we either find a red copy of $$P_\ell ^{(k)}$$ or, otherwise, end up with a red copy P of $$P_t^{(k)}$$, for some $$1\le t\le \ell -1$$, which cannot be extended any more. In the latter case we shorten P by moving all its pendant vertices to $$W_{1,1}$$ and try to extend the remaining red path again. When $$t\ge 2$$, the new path has $$t-2$$ edges. If $$t=2$$, P becomes a single vertex path $$P_0^{(k)}$$, while if $$t=1$$, it becomes empty.

Let us first consider the simplest but instructive case $$r=2$$ in which only one round is performed. If at some point $$P=\emptyset$$ and cannot be extended (which means there are no red edges within $$V_1$$), then we move $$\ell -|W_{1,1}|$$ arbitrary vertices from $$V_1=V$$ $$\setminus W_{1,1}$$ to $$W_{1,1}$$ and stop. Otherwise, we terminate Round 1 as soon as
\begin{aligned} |W_{1,1}|\ge \ell . \end{aligned}
At that moment, no edge of $$K^{(k)}(W_{1,1},V_1)$$ is red (so, all of them must be, say, blue). Moreover, since the size of $$W_{1,1}$$ increases by increments of at most $$2(k-1)$$, we have
$$\ell \le |W_{1,1}| \le \ell + 2(k-1)-1,$$
and, consequently,
$$|V_1|=n-|W_{1,1}|-|V(P)|\ge n-\ell - 2(k-1)+1-|V(P_{\ell -1}^{(k)})|\ge \ell (k-2)+1$$
by our bound on n. This means that the completely blue copy of $$K^{(k)}(W_{1,1},V_1)$$ is large enough to contain a copy of $$P_\ell ^{(k)}$$.
When $$r\ge 3$$, there are still more rounds ahead during which the set $$W_{1,1}$$ will be cut down, so we need to ensure it is large enough to survive the entire process. To this end we alter the stopping rule as follows. If at some point $$P=\emptyset$$ and cannot be extended, we move $$\lceil (k-1)\tau _2\rceil +\ell +1-|W_{1,1}|$$ arbitrary vertices from $$V_1=V$$ $$\setminus W_{1,1}$$ to $$W_{1,1}$$ and stop. Otherwise, we terminate Round 1 as soon as
\begin{aligned} |W_{1,1}|\ge (k-1) \tau _2 +\ell +1 . \end{aligned}
(8)
Since the size of $$W_{1,1}$$ increases by increments of at most $$2(k-1)$$ and the R-H-S of (8) is not necessarily integer, we also have
\begin{aligned} |W_{1,1}| \le (k-1) \tau _2 +\ell +1+ 2(k-1). \end{aligned}
(9)
Finally, we set $$S_1:=P$$, $$T_1 = \emptyset$$ for mere convenience, and $$V_1:=V\setminus (W_{1,1}\cup S_1 \cup T_1)$$. Note that $$|S_1|\le |V(P_{\ell -1}^{(k)})|=(\ell -1)(k-1)+1$$. Also, it is important to realize that no edge of $$K^{(k)}(W_{1,1}, V_1)$$ is colored red.

Round 2. We begin with resetting $$W_{1,2}:=W_{1,1}$$ and $$V_2 := V_1$$, and setting $$P:=\emptyset$$, $$W_{2,2}=\emptyset$$, and $$T_2 := \emptyset$$. In this round only the edges of color two (say, blue) belonging to $$K^{(k)}(W_{1,2}, V_2)$$ are considered. Let us denote the set of these edges by $$E_2$$. We choose an arbitrary edge $$e\in E_2$$, set $$P=e$$, and try to extend P to a copy of $$P_2^{(k)}$$ in $$E_2$$ but only in such a way that the vertex of e belonging to $$W_{1,2}$$ remains of degree one on the path. Then, we try to extend P to a copy of $$P_3^{(k)}$$ in $$E_2$$, etc., always making sure that the vertices in $$W_{1,2}$$ are of degree one. Eventually, either we find a blue copy of $$P_\ell ^{(k)}$$ or end up with a blue copy P of $$P_t^{(k)}$$, for some $$1\le t\le \ell -1$$, which cannot be further extended. We move the pendant vertices of P belonging to $$W_{1,2}$$ to the trash set $$T_2$$, while the remaining pendant vertices of P go to $$W_{2,2}$$. Then we try to extend the shortened path again.

We terminate Round 2 as soon as $$P=\emptyset$$ cannot be extended or
$$|W_{2,2}| \ge (k-2)\tau _{2}.$$
In the former case we move $$\lceil (k-2) \tau _{2}\rceil -|W_{2,2}|$$ arbitrary vertices from $$V_2$$ to $$W_{2,2}$$. Note that at the end of this round
\begin{aligned} |W_{2,2}| \le (k-2) \tau _{2} + 2(k-2). \end{aligned}
(10)
We set $$S_2:=V(P)$$ and $$V_2:=V$$ $$\setminus (W_{1,2}\cup W_{2,2} \cup S_2 \cup T_2)$$. Observe that no edge of $$K^{(k)}(W_{1,2},W_{2,2},V_2)$$ is red or blue. We will now show that
\begin{aligned} |T_2| \le t_2\qquad \text{ and } \qquad |W_{1,2}| \ge (k-2) \tau _{2}. \end{aligned}
(11)
First observe that
\begin{aligned} |W_{1,1}| \le |W_{1,2}| + |T_{2}| + \ell - 1. \end{aligned}
(12)
Indeed, at the end of this round $$W_{1,1}$$ is the union of $$W_{1,2} \cup T_2$$ and the vertices in $$V(P)\cap W_{1,2}$$ that were moved to $$S_2$$. Since $$|V(P)\cap W_{1,2}| \le \ell -1$$, (12) holds.
Also note that each vertex in $$T_2$$ can be matched with a set of $$k-2$$ or $$k-1$$ vertices in $$W_{2,2}$$, and all these sets are disjoint. Consequently,
\begin{aligned} |W_{2,2}|\ge (k-2) |T_2|. \end{aligned}
(13)
Inequality (13) immediately implies that
$$|T_2| {\mathop {\le }\limits ^{(13)}} \frac{1}{k-2} |W_{2,2}| {\mathop {\le }\limits ^{(10)}} \tau _2 + 2 = t_2.$$
Furthermore,
$$(k-1) \tau _2 +\ell +1 {\mathop {\le }\limits ^{(8)}} |W_{1,1}| {\mathop {\le }\limits ^{(12)}} |W_{1,2}| + |T_{2}| + \ell - 1 \le |W_{1,2}| + \tau _2 +\ell +1,$$
completing the proof of (11).
From now on we proceed inductively. Assume that $$i\ge 3$$ and we have just finished round $$i-1$$ constructing so far, for each $$1\le j\le i-1$$, sets $$S_j$$, $$T_j$$, and $$W_{j,i-1}$$, satisfying
\begin{aligned} |W_{j,i-1}|\ge \frac{k-i+1}{i-2} \tau _{i-1}, \end{aligned}
(14)
$$|S_{i-1}| \le |V(P_{\ell -1}^{(k)})|$$, and $$|T_{i-1}| \le t_{i-1}$$, and the residual set
$$V_{i-1} = V\setminus \bigcup _{j=1}^{i-1} (W_{j,i-1} \cup S_j \cup T_j )$$
such that $$K^{(k)}(W_{1,i-1},\dots , W_{i-1,i-1},V_{i-1})$$ contains no edge of color $$1,2,\dots ,$$ or $$i-1$$.
Round i, $$3\le i\le r-1$$. We begin the ith round by resetting $$W_{1,i}:=W_{1,i-1},\dots ,W_{i-1,i}:=W_{i-1,i-1}$$, and $$V_i:=V_{i-1}$$, and setting $$P:=\emptyset$$, $$W_{i,i}:=\emptyset$$, and $$T_i:=\emptyset$$. We consider only edges of color i in $$K^{(k)}(W_{1,i},\dots , W_{i-1,i},V_{i})$$. Let us denote the set of such edges by $$E_i$$.
As in the previous steps we are trying to extend the current path P using the edges of $$E_i$$, but only in such a way that the vertices of degree two in P belong to $$V_i$$. When an extension is no longer possible and $$P\ne \emptyset$$, we move the pendant vertices of P belonging to $$\bigcup _{j=1}^{i-1}W_{j,i}$$ to the trash set $$T_i$$, while the remaining pendant vertices of P go to $$W_{i,i}$$ (see Fig. 2). Then we try to extend the shortened path. We terminate the ith round as soon as $$P=\emptyset$$ cannot be extended or
$$|W_{i,i}|\ge \frac{k-i}{i-1} \tau _{i}.$$
In the former case we move $$\lceil \frac{k-i}{i-1} \tau _{i}\rceil -|W_{i,i}|$$ vertices from $$V_i$$ to $$W_{i,i}$$. In the latter case, set $$S_i:=V(P)$$. This yields that
\begin{aligned} |W_{i,i}| \le \frac{k-i}{i-1} \tau _{i}+2(k-i). \end{aligned}
(15)
Similarly as in (12) and (13) notice that for all $$1\le j\le i-1$$
\begin{aligned} |W_{j,i-1}| \le |W_{j,i}| + \frac{|T_{i}|}{i-1} + \ell - 1 \end{aligned}
(16)
and
\begin{aligned} |T_i| \le \frac{i-1}{k-i} |W_{i,i}| \le \tau _i + 2(i-1) = t_i. \end{aligned}
(17)
Thus,
$$\frac{k-i+1}{i-2} \tau _{i-1} {\mathop {\le }\limits ^{(14)}} |W_{j,i-1}| {\mathop {\le }\limits ^{(16),(17)}} |W_{j,i}| + \frac{\tau _i}{i-1} + 2 + \ell -1 = |W_{j,i}| + \frac{\tau _i}{i-1} + \ell +1$$
and, since also
$$\frac{k-i+1}{i-2} \tau _{i-1} {\mathop {=}\limits ^{(6)}} \frac{k-i+1}{i-1} \tau _i + \ell +1,$$
we get
\begin{aligned} |W_{j,i}|\ge \frac{k-i}{i-1} \tau _i. \end{aligned}
(18)
Consequently, when the ith round ends, we have (18) for all $$1\le j\le i$$. We also have $$|S_{i}| \le |V(P_{\ell -1}^{(k)})|$$, $$|T_{i}| \le t_{i}$$, and $$V_{i} = V \setminus \bigcup _{j=1}^{i} (W_{j,i} \cup S_j \cup T_j )$$ such that $$K^{(k)}(W_{1,i},\dots , W_{i-1,i},W_{i,i},V_{i})$$ has no edges of color $$1,2,\dots ,$$ or i.
In particular, when the $$(r-1)$$st round is finished, we have, for each $$1\le j\le r-1$$,
\begin{aligned} |W_{j,r-1}| \ge \frac{k-r+1}{r-2} \tau _{r-1}, \end{aligned}
(19)
$$|S_{r-1}| \le |V(P_{\ell -1}^{(k)})|$$ and $$|T_{r-1}| \le t_{r-1}$$. Set $$W_j := W_{j,r-1}$$, $$j=1,\dots ,r-1$$, and $$V_r := V\setminus \bigcup _{j=1}^{r-1} (W_{j} \cup S_j \cup T_j )$$ and observe that $$K^{(k)}(W_{1},\dots , W_{r-1},V_{r})$$ has only edges of color r.
By (19), for each $$1\le j\le r-1$$
$$|W_{j}| {\mathop {\ge }\limits ^{(19)}} \frac{k-r+1}{r-2} \tau _{r-1} {\mathop {=}\limits ^{(6)}} \ell .$$
Now we are going to show that $$|V_r| \ge \ell (k-r+1)$$ which will complete the proof as this bound yields a monochromatic copy of $$P_\ell ^{(k)}$$ inside $$K^{(k)}(W_{1},\dots , W_{r-1},V_{r})$$. (Actually for $$r\le k-1$$ it suffices to show that $$|V_r| \ge \ell (k-r)+1$$.)
First observe that
\begin{aligned} |W_{1,1}| + \dots + |W_{r-2,r-2}| \ge |W_{1}|+\dots +|W_{r-2}| + |T_1| + \dots + |T_{r-1}|. \end{aligned}
(20)
This is easy to see, since during the process
$$W_{i,i} \supseteq W_{i,r-1} \cup \left( W_{i,i}\cap (T_{i+1}\cup \dots \cup T_{r-1})\right) .$$
Also,
\begin{aligned} |W_{1,1}|&{\mathop {\le }\limits ^{(9)}}\ (k-1)\tau _2+ 2(k-1) + \ell +1\\&{\mathop {\le }\limits ^{(7)}} (k-1)(\ell +1)\left( \frac{1}{k-r+1}+\ln \left( 1+\frac{r-2}{k-r+1}\right) \right) + 2(k-1) + \ell +1 \end{aligned}
and, for $$2\le i\le r-1$$,
\begin{aligned} |W_{i,i}|&{\mathop {\le }\limits ^{(15)}} \frac{k-i}{i-1} \tau _{i}+2(k-i)\\&{\mathop {\le }\limits ^{(7)}}\ (k-i)(\ell +1)\left( \frac{1}{k-r+1}+\ln \left( 1+\frac{r-2}{k-r+1}\right) \right) + 2(k-i). \end{aligned}
Since
$$\sum _{i=1}^{r-1} (k-i) = (k-r/2)(r-1),$$
we have by (20) that
\begin{aligned} |W_{1}|+\dots&+|W_{r-1}| + |T_2| + \dots + |T_{r-1}|\\&\le (\ell +1)\left( \frac{1}{k-r+1}+\ln \left( 1+\frac{r-2}{k-r+1}\right) \right) (k-r/2)(r-1)\\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \quad + (2k-r)(r-1) + \ell +1\\&\le k(\ell +1)r\left( \frac{1}{k-r+1}+\ln \left( 1+\frac{r-2}{k-r+1}\right) \right) \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \quad + (2k-r)(r-1) + \ell +1. \end{aligned}
As also $$|S_i| \le |V(P_{\ell -1}^{(k)})| =(k-1)(\ell -1)+1$$ for each $$1\le i \le r-1$$ and
$$|V_r|=|V|-\sum _{i=1}^{r-1}(|W_i|+|T_i|+|S_i|),$$
we finally obtain, using the lower bound on $$n=|V|$$, that
\begin{aligned} |V_r|&\ge k(\ell +1)r - (2k-r)(r-1) - \ell - 1- (r-1)\left[ (k-1)(\ell -1)+1\right] \\&= \ell (2r-3) + (r-1)(r-2) + (k-1) + \ell (k-r+1) \ge \ell (k-r+1), \end{aligned}
since the first three terms in the last line are nonnegative.

To prove the $$O(n^k)$$ complexity time, observe that in the worst-case scenario we need to go over all edges colored by the first $$r-1$$ colors and no edge is visited more than once.

## References

1. 1.
Davies, E., Jenssen, M., Roberts, B.: Multicolour Ramsey numbers of paths and even cycles. Eur. J. Comb. 63, 124–133 (2017)
2. 2.
Dudek, A., Prałat, P.: On some multicolor Ramsey properties of random graphs. SIAM J. Discrete Math. 31(3), 2079–2092 (2017)
3. 3.
Erdős, P., Gallai, T.: On maximal paths and circuits of graphs. Acta Math. Acad. Sci. Hungar 10, 337–356 (1959)
4. 4.
Faudree, R.J., Schelp, R.H.: Path Ramsey numbers in multicolorings. J. Comb. Theory Ser. B 19(2), 150–160 (1975)
5. 5.
Figaj, A., Łuczak, T.: The Ramsey number for a triple of long even cycles. J. Comb. Theory Ser. B 97(4), 584–596 (2007)
6. 6.
Gerencsér, L., Gyárfás, A.: On Ramsey-type problems. Ann. Univ. Sci. Budapest. Eötvös Sect. Math. 10, 167–170 (1967)
7. 7.
Gyárfás, A., Ruszinkó, M., Sárközy, G., Szemerédi, E.: Three-color Ramsey numbers for paths. Combinatorica 27(1), 35–69 (2007)
8. 8.
Gyárfás, A., Ruszinkó, M., Sárközy, G., Szemerédi, E.: Corrigendum: three-color Ramsey numbers for paths. Combinatorica 28(4), 499–502 (2008)
9. 9.
Sárközy, G.N.: On the multi-colored Ramsey numbers of paths and even cycles. Electron. J. Comb. 23(3), 3–53 (2016)