1 Introduction

Let G be a simple connected graph with colored edges. A path P in G is proper if no two consecutive edges of P have the same color. An edge coloring of G (not neccessarily proper in the usual sense) is called a proper connected coloring if every pair of distinct vertices is joined by at least one proper path. The least number of colors needed for such a coloring of a graph G is denoted by \({{\,\textrm{pc}\,}}(G)\).

In the proper edge coloring of a graph, in a traditional sense, each pair of edges with a common vertex is colored differently, so every path is proper. Hence, by the well-known theorem of Vizing [20],

$$\begin{aligned} {{\,\textrm{pc}\,}}(G)\le \chi '(G) \le \Delta (G)+1. \end{aligned}$$

It is also easy to see that for every tree T, we have \({{\,\textrm{pc}\,}}(T)=\chi '(T)=\Delta (T)\). However, if G is a 2-connected graph,Footnote 1 then we already have \({{\,\textrm{pc}\,}}(G)\le 3\), and this is tight. This somewhat surprising fact was proved by Borozan, Fujita, Gerek, Magnant, Manoussakis, Montero, and Tuza in [3] (see also [14]), where the proper connected coloring was introduced, in analogy to the well-studied topic of rainbow connected coloring, invented by Chartrand, Johns, McKeon, and Zhang in [6] (see [15]). In the later concept, as you can imagine, the point is that each pair of vertices should be connected by a rainbow path, i.e., one in which no two edges have the same color. In a similar way, one may investigate a variety of coloring concepts involving various restrictions on color patterns allowable on connecting paths (see [4, 5, 7]).

In the present paper, we consider a new variant of connected coloring, inspired by the concept of strong edge coloring of graphs, invented by Fouquet and Joliviet [10], and, independently, by Erdős and Nešetřil [9]. In the strong edge coloring of a graph G, every color class should form an induced matching, which means that not only every pair of adjacent edges is colored differently, but also every pair of edges adjacent to some other common edge should be differently colored (see [8] for a recent survey on this topic). In particular, in a strong edge coloring of a path, any sub-path with at most three edges must be rainbow. We will call such paths strongly proper. Analogously, an edge-colored graph is called strongly proper connected if any two vertices are connected by at least one strongly proper path. The least number of colors needed for such a coloring of a graph G is denoted by \({{\,\textrm{spc}\,}}(G)\) and referred to as the strong proper connection number of G.

In much the same way as for the traditional edge coloring, we have the trivial bound \({{\,\textrm{spc}\,}}(G)\le \chi '_s(G)\), where \(\chi '_s(G)\) is the strong chromatic index of G, defined naturally as the least number of colors needed for a strong edge coloring of G. However, this parameter is more mysterious than its classical archetype \(\chi '(G)\). In particular, a long-standing conjecture by Erdős and Nešetřil [9] states that \(\chi '_s(G)\le \frac{5}{4}\Delta (G)^2\). This bound is tight (if true), as is demonstrated by the family of blowups of \(C_5\). Currently best general result, obtained by Hurley, de Joannis de Verclos, and Kang [11], states that the bound \(\chi '_s(G)\le 1.772\Delta (G)^2\) holds for sufficiently large \(\Delta (G)\) (see [8] for a survey of many other results toward the Erdős-Nešetřil conjecture).

In this paper, we prove a finite upper bound on \({{\,\textrm{spc}\,}}(G)\) for 2-connected graphs. Our main result reads as follows.

Theorem 1

Every 2-connected graph G satisfies \({{\,\textrm{spc}\,}}(G) \le 5\).

We do not know if this upper bound is tight. Clearly, \({{\,\textrm{spc}\,}}(G)\ge 3\) for any graph of diameter at least 3. Curiously, it is not so easy to produce examples of 2-connected graphs demanding four colors. However, we provide a general construction of a family of graphs with \({{\,\textrm{spc}\,}}(G)=4\) and arbitrarily large girth. Moreover, this family contains infinitely many bipartite graphs.

Theorem 2

For every \(d\ge 3\), there exists a 2-connected graph \(G_d\) with girth at least d, such that \({{\,\textrm{spc}\,}}(G_d) \ge 4\).

We complement these results by proving that graphs with all cycle lengths divisible by 3 are 3-colorable in a strongly proper connected sense.

Theorem 3

Let G be a 2-connected graph. If the length of every cycle in G is divisible by 3, then \({{\,\textrm{spc}\,}}(G) \le 3\).

The proof of this result is simple, but it provides a good illustration of the main idea used in the proof Theorem 1. The main tool is based on the ear decomposition of graphs. Recall that an open ear decomposition of a graph G is a sequence \(P_1,\ldots ,P_h\) of subgraphs of G that partition the set of edges of G, where \(P_1\) is a cycle and every \(P_i\), with \(2\le i\le h\), is a path that intersects \(P_1\cup \cdots \cup P_{i-1}\) in exactly its endpoints. Each \(P_i\) is called an ear. We will make use of following well-known result of Whitney [21].

Theorem 4

(Whitney, 1932) A graph G with at least two edges is 2-connected if and only if it has an open ear decomposition.

A paradigm of colorful connectedness can be studied for other types of colorings as well. As postulated by Brause, Jendrol’, and Schiermeyer [4], one may fix any property \({\mathcal {P}}\) of words (sequences), and then investigate the corresponding \({\mathcal {P}}\)-connected coloring, defined by the condition that every pair of vertices is joined by a path whose color sequence has the property \({\mathcal {P}}\). Consider for example the following, particularly intriguing property of sequences, which is close (in some sense) to the one stemming from the strong edge coloring of graphs.

A sequence of the form \(c_1c_2\cdots c_nc_1c_2\cdots c_n\) is called a repetition. An edge-colored path is nonrepetitive if its color sequence does not contain a repetition as a block, i.e., a subsequence of consecutive terms. An edge-colored graph G is nonrepetitively connected if every pair of distinct vertices is joined by at least one nonrepetitive path. Denote by \({{\,\textrm{nrc}\,}}(G)\) the least number of colors needed for such a coloring of G.

Is it true that \({{\,\textrm{nrc}\,}}(G)\) is finitely bounded for 2-connected graphs? Notice that it is not at all obvious that \({{\,\textrm{nrc}\,}}(P)\) is finite for every path P. However, by a 1906 result of Thue [18], every path can be nonrepetitively colored using just three colors. Therefore, there is a chance for a finite bound and we prove that this is indeed true.

Theorem 5

Every 2-connected graph G satisfies \({{\,\textrm{nrc}\,}}(G)\le 15\) and every 4-connected graph G satisfies \({{\,\textrm{nrc}\,}}(G)\le 6\).

Let us mention that the notion of nonrepetitive coloring of graphs, as introduced by Alon, Hałuszczak, Grytczuk, and Riordan in [1], can be considered more generally, in a way similar to the usual proper coloring of graphs (in both, edge or vertex version). A recent survey by Wood [22] collects many interesting results on this topic.

The proof of Theorem 5 is based on known results on spanning trees in k-connected graphs. It can be easily extended to more general scenarios involving fairly universal properties of words. We discuss these issues in the final section of the paper, where we state a general conjecture on \({\mathcal {P}}\)-connected coloring of graphs. Proofs of all our results are collected in the next section.

2 Proofs of the Results

2.1 2-Connected Graphs with Cycle Lengths Divisible by 3

We start with a simple proof that 2-connected graphs whose all cycle lengths are divisible by 3 satisfy \({{\,\textrm{spc}\,}}(G)\le 3\).

Proof of Theorem 3

Let G be a 2-connected graph. By Theorem 4, G has an open ear decomposition, which we denote as \(ED = (P_1,\ldots , P_h)\). Let \(G_i\) be the subgraph of G consisting of the first i ears of ED, that is, \(G_i=P_1 \cup \cdots \cup P_i\). For each ear \(P_{i}\), let \(s_{i}\) and \(t_{i}\) be the endpoints of \(P_{i}\). First, we present a claim concerning the lengths of \(P_i\) and some other paths in \(G_i\).

Claim 1

Let \(P_i\) be an ear from ED. Then, the length of \(P_i\) and the lengths of all paths between \(s_i\) and \(t_i\) in the graph \(G_{i-1}\) are divisible by 3 (see Fig. 1).

Proof

The statement is obvious for \(i=1\), so assume that \(i > 1\). The graph \(G_{i-1}\) is 2-connected, so there exist two paths, Q and R, from \(s_i\) to \(t_i\), such that \(Q \cap R = \{s_i, t_i\}\). Let q and r be the lengths of Q and R, respectively, and let p be the length of \(P_i\). The paths Q and R form a cycle in \(G_{i-1}\), so \(q + r\) must be divisible by 3. Moreover, Q and \(P_i\), as well as R and \(P_i\), form a cycle in \(G_i\). Therefore, we have

$$\begin{aligned} q + r = q + p = r + p\equiv 0\pmod 3. \end{aligned}$$

This implies that \(q+r+p=0\pmod 3\), and therefore, \( q=r=p=0\pmod 3\), which completes the proof of the claim. \(\square \)

Fig. 1
figure 1

An exemplary ear decomposition \(ED = \{P_1, P_2, P_3, P_4\}\) of some graph with cycles of length divisible by 3 (\(P_1\) is a cycle with 12 edges, \(P_2\) is a path with 6 edges, \(P_3\) and \(P_4\) are paths with 3 edges)

Let us define a sequence of oriented graphs \(D_0,D_1,\ldots ,D_{h}\), such that \(D_0\) is empty and for each \(i>0\), \(D_i\) is obtained from \(D_{i-1}\) by adding the path \(P_i\), oriented from \(s_i\) to \(t_i\). Let D be the last oriented graph in this sequence, i.e., \(D:=D_{h}\). Now, we will color the edges of D with 3 colors. In this coloring, every directed path will be strongly proper. It is easy to see that the digraph D is strongly connected (there is a directed path between any ordered pair of vertices in D), so our coloring will give us even more than the required edge coloring of G.

Let C be a 3-coloring of the edges of D by colors \(\{1,2,3\}\), and let P be a directed path in D. We say that P has a canonical pattern if the sequence of colors of P forms a block (subsequences of consecutive terms) in the infinite periodic sequence \((1, 2, 3, 1, 2, 3, 1, 2, 3,\ldots )\). Note that a path P has a canonical pattern if and only if P is strongly proper.

Claim 2

There exists a 3-coloring C of the edges of D, such that for every restriction \(C_i\) of C to the subgraph \(D_i\), \(1\le i\le h\), the following properties hold:

  1. (i)

    For every \(v\in V(D_i)\), all edges going out of v have the same color.

  2. (ii)

    For every \(v\in V(D_i)\), all edges going into v have the same color.

  3. (iii)

    Every path in \(D_i\) has a canonical pattern.

  4. (iv)

    Every digraph \(D_i\) is strongly connected.

Proof

We will construct the coloring C by inductively defining \(C_i\), for \(i = 1, 2,\ldots , h\). The base case is when \(D_1\) is a directed cycle of length divisible by 3. We color the edges of \(D_1\) consecutively with colors 1, 2, 3, obtaining thereby the coloring \(C_1\). The properties (i)–(iv) are obviously satisfied.

Let \(2\le i \le h\) be fixed and suppose that we have the coloring \(C_{i-1}\) of the edges of \(D_{i-1}\) satisfying properties (i)–(iv). Recall that \(D_i\) is obtained from \(D_{i-1}\) by adding the path \(P_i\) from \(s_i\) to \(t_i\). We will construct the coloring \(C_i\) from \(C_{i-1}\) by coloring the edges of \(P_i\) as follows (see Fig. 2):

  1. (a)

    the first edge of \(P_i\) has the same color as the edges going out of \(s_i\) in \(D_{i-1}\),

  2. (b)

    the remaining edges of \(P_i\) are colored in such a way that \(P_i\) has a canonical pattern (for example, if the first edge has color 2, then the second one has color 3, the third one 1, the fourth one 2, and so on). We will prove that \(C_i\) satisfies properties (i)–(iv).

Fig. 2
figure 2

A coloring of \(P_i\) (a fragment of the graph \(D_{i-1}\) is dashed, the path \(P_i\) is drawn by normal lines, and the numbers 1, 2, 3 mean colors of edges)

Properties (i) and (ii) remain obviously satisfied for vertices from \(V(D_i) {\setminus } V(P_i)\). They are also satisfied for all internal vertices of \(P_i\) (all vertices of the path excluding the two end vertices), as they have both indegree and outdegree equal to 1 in \(D_i\), and for \(s_i\) by (a). For \(t_i\), property (i) is of course still satisfied, but to see that property (ii) holds, let us take a closer look at paths from \(s_i\) to \(t_i\). We know that all edges going out of \(s_i\) in \(D_i\) have the same color [by (i)], that all paths from \(s_i\) to \(t_i\) in \(D_i\) have a canonical pattern [for paths from \(D_{i-1}\) from (iii), for \(P_i\) from (b)] and that the lengths of \(P_i\) and of every path from \(s_i\) to \(t_i\) in \(D_{i-1}\) are divisible by 3 (from Claim 1). Therefore, both \(P_i\) and all other paths from \(s_i\) to \(t_i\) in \(D_i\) end with the same color, so all edges going into \(t_i\) have the same color and property (ii) is satisfied also for \(t_i\).

Now, consider the property (iii). It remains clearly satisfied for paths which do not contain edges from \(P_i\).

Now, consider some path R from u to v, where \(u, v \in V(D_i)\), which contain all edges from \(P_i\) (see Fig. 3a). It means that R consists of some path \(R_1\) from u to \(s_i\) (maybe empty), the path \(P_i\) and some path \(R_2\) from \(t_i\) to v (maybe empty). Let Q be a path from \(s_i\) to \(t_i\) in the graph \(D_{i-1}\). From (iii), we have that the path: \(R_1 \cup Q \cup R_2\) has a canonical pattern, from (i) that the first edge of \(P_i\) has the same color as the first edge of Q and from Claim 1 that the lengths of \(P_i\) and Q are divisible by 3. Therefore, R has a canonical pattern and property (iii) remains satisfied in this case.

Fig. 3
figure 3

The property (iii)—every path R from \(D_i\) has a canonical pattern

Next, let us consider a path R from u to v, where both u and v are internal vertices of \(P_i\) (see Fig. 3b). First, assume that R is contained in \(P_i\) (that is, the order of the vertices on the path \(P_i\) is as follows: \(s_i\), u, v, \(t_i\)). Then, R has a canonical pattern from (b). Therefore, let us assume the opposite; it means that the order of the vertices on the path \(P_i\) is: \(s_i\), v, u, \(t_i\). Let us call the parts of R as follows: let \(R_1\) be a part of R from u to \(t_i\), let \(R_2\) be a part of R from \(t_i\) to \(s_i\), and let \(R_3\) be a part of R from \(s_i\) to v. Note that \(R_1\) and \(R_3\) are parts of \(P_i\) and \(R_2\) is a path from \(t_i\) to \(s_i\) in \(D_{i-1}\). Let W be some path from \(s_i\) to \(t_i\) in \(D_{i-1}\). Let \(w_1\) be a vertex from W, such that the distance from \(w_1\) to \(t_i\) on W is congruent to the same value modulo 3 as the distance from u to \(t_i\) on \(R_i\). Let \(W_1\) be a part of W from \(w_1\) to \(t_i\). Because \(P_i\) has a canonical pattern [from (b)], and also, W and \(W_1 \cup R_2 \) have canonical patterns [from (iii)], and \(R_1\) ends with the same color as \(W_1\) [from (ii)], we have that the path \(R_1 \cup R_2\) has a canonical pattern. Similarly, considering \(w_2\) as any vertex from \(V(D_{i-1})\) such that \(w_2\) belongs to some path from \(s_i\) to \(t_i\) and the distance from \(s_i\) to \(w_2\) is congruent to the same value modulo 3 as the distance from \(s_i\) to v, we get that the path \(R_2 \cup R_3\) has a canonical pattern. Therefore, the whole path R has a canonical pattern and property (iii) remains satisfied also in this case.

The last case is when one endpoint of a path is from \(V(D_{i-1})\) and the second one is an internal vertex of P. Carrying out analogous considerations as in the previous case, we get that the property (iii) is fulfilled here as well, which completes the proof of (iii).

For property (iv), it suffices to notice that adding a directed ear to a strongly connected digraph \(D_{i-1}\) preserves strong connectivity for \(D_i\).

Therefore, the proof of the claim is complete by induction. \(\square \)

We constructed the coloring C of the edges of D, such that every path in D has a canonical pattern. It means that every path of D is strongly proper. Therefore, G with coloring C is strongly proper connected. The proof of Theorem 3 is complete. \(\square \)

2.2 2-Connected Graphs Satisfy \({{\,\textrm{spc}\,}}(G)\le 5\)

Proof of Theorem 1

Recall that a graph H is called minimally 2-connected if it is 2-connected, but it looses this property if we remove any single edge. Let H be a minimally 2-connected spanning subgraph of G. We will construct an edge coloring of H with at most 5 colors that makes H strongly proper connected. Note that it suffices to get the assertion of the theorem, as the remaining edges from \(E(G) {\setminus } E(H)\) can be colored arbitrarily without affecting validity of the coloring.

From Theorem 4, we know that H has an open ear decomposition. Similarly to the proof of Theorem 3, we will color the graph while adding ears, but, this time, the order of adding ears will be important. Let \(ED = (P_1,\ldots , P_h)\) be an open ear decomposition of H in which, in every step, we add the longest possible ear (see Fig. 4). Let \(H_i\) be the subgraph of H consisting of the first i ears of ED, that is, \(H_i=P_1\cup \cdots \cup P_i\). For an ear \(P_{i}\), let \(s_{i}\) and \(t_{i}\) be the endpoints of \(P_{i}\).

Fig. 4
figure 4

An exemplary ear decomposition \(ED = \{P_1, P_2, P_3, P_4\}\) of some graph, where the thickest lines depict \(P_1\) and the thinnest lines depict \(P_4\) (\(P_1\) is a cycle with 10 edges, \(P_2\) is a path with 4 edges, \(P_3\) is a path with 3 edges, and \(P_4\) is a path with 2 edges)

First, we present some claims concerning the properties of the ears from ED. Claim 3 shows that we will process ears from the longest to the shortest.

Claim 3

The ears of ED are in the opposite order to the number of their edges.

Proof

Let us assume the opposite. Let \(P_i \in ED\) be an ear with the smallest possible index, such that \(P_i\) has more edges than \(P_{i-1}\). Note that \(i > 1\). From the definition of ED, we know that both endpoints of \(P_i\) are internal vertices of some ears with smaller indices (maybe two different). We consider three cases.

Case 1: None of \(s_i\) and \(t_i\) are internal vertices of \(P_{i-1}\). Therefore, both \(s_i\) and \(t_i\) belong to some ears with indices smaller than \(i-1\). It means that we could add a longer ear \(P_i\) to the graph \(H_{i-2}\) instead of \(P_{i-1}\), which contradicts the definition of ED.

Case 2: Both \(s_i\) and \(t_i\) are internal vertices of \(P_{i-1}\). It means that instead of \(P_{i-1}\), we could add to the graph \(H_{i-2}\) a longer ear composed of the part of \(P_{i-1}\) from one endpoint to \(s_i\), the path \(P_i\), and the part of \(P_{i-1}\) from \(t_i\) to the second endpoint of \(P_{i-1}\), which again contradicts the definition of ED.

Case 3: Exactly, one endpoint of \(P_i\) is an internal vertex of \(P_{i-1}\). Assume that it is \(s_i\). Therefore, \(t_i\) belongs to some ear with index smaller than \(i-1\). It means that to the graph \(H_{i-2}\), we could add an ear composed of the part of \(P_{i-1}\) from one endpoint to \(s_i\) and the path \(P_i\), which has more edges than \(P_{i-1}\). It contradicts the definition of ED again.

The proof of the claim is complete. \(\square \)

Let us recall that H is minimally 2-connected, so every \(P_{i}\) has at least one internal vertex (no \(P_i\) may be a single edge). From the definition of ED, we know that \(\{s_{i}, t_{i}\} =P_{i} \cap H_{i-1}\). Claim 4 shows that for every ear \(P_{i}\), its endpoints cannot be adjacent in the graph \(H_{i-1}\).

Claim 4

Vertices \(s_i\) and \(t_i\) are not adjacent in the graph \(H_{i-1}\).

Proof

Let us assume the opposite. There is an edge \(e=s_i t_i\) in \(H_{i-1}\). Therefore, there is some ear \(P_j \in ED\), where \(j < i\), containing e. According to the ordering of ears in ED, in every step, we added the longest possible ear to our graph. But instead of \(P_j\), we could add a longer ear \((P_j {\setminus } e) \cup P_i\), which contradicts the definition of ED. \(\square \)

Claims 5 and 6 show the relationship between positions of the endpoints of ears with two or three edges.

Claim 5

Let \(P_i\) and \(P_j\) be ears from ED, such that both have two edges or both have three edges, where \(j < i\). Then, no endpoint of \(P_i\) can be an internal vertex of \(P_j\).

Proof

Let us assume the opposite. From Claim 4, we know that the endpoints of any ear cannot be adjacent in H. Therefore, the only possibility here is that exactly one endpoint of \(P_i\), say \(s_i\), is an internal vertex of \(P_j\). Without loosing the generality of our consideration, we can assume that \(s_i\) is adjacent to \(t_j\) in H. Let r be some vertex from \(H_{j-1}\) different than \(s_j\). Let R be the shortest path between \(t_i\) and r in the graph \(H_{i-1}\) which contains edges only from \(E(H_{i-1}) {\setminus } E(H_j)\) (see Fig. 5). Notice that R may be an empty path (if \(t_i \in V(H_{j-1})\)); otherwise, it has at least one edge. Now, consider the ear \((P_j {\setminus } (s_it_j)) \cup P_i \cup R\). It has more edges than \(P_j\) and has both endpoints in \(V(H_{j-1})\), so it could be added to the graph \(H_{j-1}\). This means that in the jth step, we did not add the longest possible ear, which contradicts the definition of ED. \(\square \)

Fig. 5
figure 5

An example of an impossible case, where one endpoint of an ear \(P_i\) with 3 edges is an internal vertex of some other ear \(P_j\) with 3 edges (\(H_{j-1}\) is dashed, thick lines depict \(P_j\), normal lines depict \(P_i\), and dotted lines depict R)

Claim 6

Let \(P_i\) and \(P_j\) be ears from ED, such that \(j < i\), \(P_i\) has two edges, \(P_j\) has three edges, and one endpoint of \(P_i\), say \(s_i\), is an internal vertex of \(P_j\). Then, \(t_i\) (the second endpoint of \(P_i\)) must be an endpoint of \(P_j\) not adjacent to \(s_i\) in \(H_{j}\).

Proof

Without loosing the generality of our consideration, we can assume that \(s_j\) is adjacent to \(s_i\) in \(H_{j}\). Note that if \(t_i\) is the same as \(t_j\), then our assumptions about the order of the ears in ED are satisfied; see Fig. 6. Therefore, it remains to show that \(t_i\) cannot be different from \(t_j\). There are two cases to consider. If \(t_i\) were a vertex of \(P_j\) different from \(t_j\), then vertices \(s_i\) and \(t_i\) would be adjacent in the graph \(H_{i-1}\), which contradicts Claim 4. If \(t_i\) were from \(H_{i-1} {\setminus } P_j\), it would mean that we added the ear \(P_j\) to \(H_{j-1}\) when we could add a longer ear. To construct this ear, we could take the shortest path between \(t_i\) and some vertex from \(H_{j-1}\) different than \(t_j\) which contains edges only from \(E(H_{i-1}) {\setminus } E(H_j)\) and append to it \((P_i \cup P_j {\setminus } (s_is_j)))\) (the construction is analogous as in the proof of Claim 5). This contradicts the definition of ED. Therefore, the proof of the claim is complete. \(\square \)

Fig. 6
figure 6

Ears \(P_i, P_j \in ED\), such that \(P_i\) has 2 edges, \(P_j\) has 3 edges (\(H_{j-1}\) is dashed, thick lines depict \(P_j\), and normal lines depict \(P_i\))

Let \(i^*\) be a number defined, such that \(P_{i^*}\) is the last ear in ED with at least three edges. Let us define a sequence of oriented graphs \(D_0, D_1, \ldots , D_{i^*}\), such that \(D_0\) is empty and for each \(i>0\), \(D_i\) is obtained from \(D_{i-1}\) by adding the path \(P_i\), oriented from \(s_i\) to \(t_i\). Take D to be the last oriented graph in this sequence, i.e., \(D:=D_{i^*}\).

Now, we will color the edges of D with 5 colors, such that for every two vertices u, v, there is a strongly proper directed path from u to v, which is a strengthening of the property required from edge coloring of H. In the following, claim (iii) is the crucial part, while (i), (ii), and (iv) are invariants needed in an inductive proof.

Claim 7

There exists a coloring C, such that for every \(i\le i^*\), the restriction of \(C_i\) to the edges of \(D_i\) satisfies the following properties:

  1. (i)

    For every \(v\in V(D_i)\), all edges going out of v have the same color.

  2. (ii)

    For every \(v\in V(D_i)\), all edges going into v have the same color, other than the color of edges going out of v.

  3. (iii)

    For every two vertices \(u,v\in V(D_i)\), there exists a strongly proper path from u to v and from v to u.

  4. (iv)

    For every edge \(uv\in E(D_i)\), such that u and v are not internal vertices of the same ear with 3 edges, and for every two directed edges \(xu, vy \in E(D_i)\), we have \(C_i(xu) \ne C_i(vy)\).

Proof

We will construct the coloring C by inductively defining \(C_i\) for \(i=1, 2, \ldots i^*\).

The base case of the induction is when \(D_1\) is a directed cycle. It suffices to color the edges of \(D_1\) greedily, making sure that each edge is colored differently than the two preceding and the two following edges.

Now, consider any \(i \le i^*\) and suppose that we already have the coloring \(C_{i-1}\) which satisfies properties (i)–(iv) (for \(i-1\)). For convenience, let us consider a directed path \(P'_i\) obtained from \(P_i\) by directing it from \(s_i\) to \(t_i\) and adding two edges \(ws_i\) and \(t_ix\) from \(D_{i-1}\), where w is any vertex incoming to \(s_i\) and x is any vertex outgoing from \(t_i\) in the digraph \(D_{i-1}\) (such vertices must exist in \(D_{i-1}\) because of property (iii), see Fig. 7).

Fig. 7
figure 7

Constructing a path \(P'_i\) for a given directed graph \(D_{i-1}\) and a path \(P_i\)

Now, we will construct \(C_i\) from \(C_{i-1}\) by coloring the internal edges of \(P'_i\), such that

  1. (a)

    the second edge of \(P'_i\) has the same color as the edges going out of \(s_i\) in \(D_{i-1}\),

  2. (b)

    the penultimate edge of \(P'_i\) has the same color as the edges going into \(t_i\) in \(D_{i-1}\),

  3. (c)

    the remaining edges of \(P'_i\) are colored with a different color than the two preceding and the two following edges on \(P'_i\) (note that it is possible, as we have five colors in use).

We will prove that \(C_i\) satisfies properties (i)–(iv).

It is clear that properties (i) and (ii) remain satisfied for vertices from \(V(D_{i}) {\setminus } V(P_i)\). They are also satisfied for \(s_i\) and \(t_i\) by (a) and (b), and for the other vertices of \(P_i\), as they have indegree and outdegree 1 in \(D_i\).

Now, consider the property (iii). It remains satisfied if \(u, v\in V(D_{i-1})\). If both u and v are internal vertices of \(P_i\), then (iii) holds by (c).

Now, consider the case when \(u\in V(D_{i-1})\) and v is an internal vertex of \(P_i\). The required \(u-v\) path is obtained by composing a strongly proper path Q from u to \(s_i\) in \(D_{i-1}\) [note that Q exists by (iii) applied for \(i-1\)] with a fragment of \(P_i\) from \(s_i\) to v. We will show that this path is strongly proper. Since both Q and a fragment of \(P_i\) are strongly proper, we only need to exclude color conflicts between fourFootnote 2 edges around \(s_i\). First edge of \(P_i\) has different color than the last edge of Q by (a) and (ii). Second edge of \(P_i\) is colored differently than the last edge of Q by (c). For the remaining pair note that from Claim 5, we know that \(s_i\) is not an internal vertex of any ear \(P_j\) with 3 edges, where \(j < i\). It follows that (iv) holds for the last edge of Q in the coloring \(C_{i-1}\). It follows that last but one edge of Q is colored differently than edges going out of \(s_i\) in \(D_{i-1}\), and hence, by (a), there is no conflict with the first edge of \(P_i\).

In the remaining case, when u is an internal vertex of \(P_i\) and \(v\in V(D_{i-1})\), the argument is analogous (the required path is obtained by composing a fragment of \(P_i\) from u to \(t_i\) and a strongly proper path from \(t_i\) to v). Therefore, the proof of (iii) is complete.

Now, consider the property (iv) that involves three edges xu, uv, and vy. It remains satisfied if both u and v are in \(V(D_i){\setminus } V(P_i)\). If both u and v are internal vertices of \(P_i\), we only need to consider the case when \(P_i\) has at least 4 edges; in this case, (iv) follows directly from (c). If \(u = s_i\) or \(v = t_i\), the property (iv) follows directly from (c) again. Now, consider the case \(v=s_i\) or \(u=t_i\). Let \(y'\) be an out-neighbor of v in \(D_{i-1}\) and \(x'\) be an in-neighbor of u in \(D_{i-1}\) (note an easy case when \(x'=x\) and \(y'=y\)). By the induction assumption (iv), it holds that \(C_{i-1}(x'u)\ne C_{i-1}(vy')\), and by (a) and (b), it follows that \(C_i(vy)=C_{i-1}(vy')\) and \(C_i(xu)=C_{i-1}(x'u)\), which completes the proof of (iv).

Therefore, the proof of the claim is complete by induction. \(\square \)

An internal edge of a path is any edge whose endpoints are internal vertices of the path. Before coloring the edges of H, we need to orient ears with two edges. Let \(P_i\) be an ear with two edges. We pick \(s_i'\) and \(t_i'\) from \(\lbrace s_i, t_i\rbrace \), such that no edge going into \(s_i'\) is an internal edge of an ear with three edges and no edge going out of \(t_i'\) is an internal edge of an ear with three edges. Such a choice is possible, because by Claim 6 if one of the vertices from \(\lbrace s_i, t_i\rbrace \) is an internal vertex of some ear \(P_j\) with 3 edges, then the other one is an endpoint of \(P_j\), and hence, by Claim 5, it is not an internal vertex of any other ear with 3 edges. We will think of the ear \(P_i\) as oriented from \(s_i'\) to \(t_i'\).

Now, let C be a 5-coloring of edges of D given by Claim 7. Define a 5-coloring \(C'\) of edges of H, such that \(C'(uv)=C(uv)\) for every edge \(uv\in E(D)\) and for every vertex v, such that v is an internal vertex of an ear \(P_i\) with two edges, let \(C'(s_i'v)\) be the color of edges going out of \(s_i'\) in C and \(C'(vt_i')\) be the color of edges going into \(t_i'\) in C. Note that this definition is correct, since, by Claim 5, \(s_i'\) and \(t_i'\) are vertices of D, and it is unambiguous by Claim 7 (i) and (ii). We will show that \(C'\) is the desired coloring of H.

Consider any two vertices \(u,v\in V(H)\). We need to find a strongly proper path between u and v. If both u and v are in V(D), such a path exists by Claim 7 (iii). If \(u,v\notin V(D)\), pick i and j, such that u is an internal vertex of the ear \(P_i\) and v is an internal vertex of \(P_j\) (where \(P_i\) and \(P_j\) have two edges). In this case, the desired path between u and v is obtained by taking a strongly proper path from \(t_i'\) to \(s_j'\) in D (which exists by Claim 7 (iii)) and appending to it the edge \(ut_i'\) at the start and the edge \(s_j'v\) at the end; let us denote the constructed path by P. We will show that P is strongly proper. If P has less than three edges, it follows directly from Claim 7 (ii), so we assume otherwise. By Claim 7 (ii) the first and second edge have different colors, and last and last but one edge on P also have different colors. By the choice of \(t_i'\), the second edge of P is not an internal edge of any ear with 3 edges, so by Claim 7 (iv) the first and third edge on P have different colors. Similarly, by the choice of \(s_j'\), the last but one edge on the constructed path is not an internal edge of any ear with 3 edges, so P is strongly proper by Claim 7 (iv).

Note that the same argument applies when \(u\notin V(D)\) and \(v\in V(D)\) or \(u\in V(D)\) and \(v\notin V(D)\), except that only one end of P needs to be considered. This proves that H, together with the constructed coloring \(C'\), is strongly proper connected, so the proof of Theorem 1 is complete. \(\square \)

Fig. 8
figure 8

A graph \(G_d\) with strong proper connection number equal to 4

2.3 Proof of the Lower Bound \({{\,\textrm{spc}\,}}(G_d)\ge 4\)

Proof of Theorem 2

Let \(d\ge 3\) and let \(a,b\ge \max \{3,d/3\}\) be fixed integers. Consider a graph \(G_d\) consisting of three edges, \(x_1w_1\), \(x_2w_2\), \(x_3w_3\), and six paths \(P_1, P_2, \ldots , P_6\), such that \(P_1\) and \(P_2\) go from \(w_1\) to \(x_2\), \(P_3\), and \(P_4\) go from \(w_2\) to \(x_3\), \(P_5\) and \(P_6\) go from \(w_3\) to \(x_1\). Moreover, \(P_1, P_3, P_5\) have length \(3a+1\) and \(P_2, P_4, P_6\) have length 3b (see Fig. 8).

Suppose for the contrary that \({{\,\textrm{spc}\,}}(G_d)\le 3\) and fix an edge coloring of \(G_d\) with colors 1, 2 and 3 that makes it strongly proper connected. Choose vertices \(v_1, v_2, \ldots , v_6\) such that for each i, \(v_i\) is a vertex from \(P_i\) at distance at least 2 from both ends of \(P_i\), and the path with four edges closest to \(v_i\) is strongly proper. Note that such a choice is possible, since the edge-colored graph is strongly proper connected, e.g., for each i choose a vertex \(z_i\) that is at distance at least 4 from both ends of \(P_i\) and take \(v_i\) to be the third vertex on a strongly proper path from \(z_i\) to \(x_1\).

Now define a directed graph D on vertices \(v_1, \ldots , v_6\), such that there is an arc \(v_iv_j\) if and only if there exists a strongly proper path from \(v_i\) to \(v_j\) in \(G_d\) with the canonical color pattern (a block of the sequence \((1,2,3,1,2,3,\ldots )\)). Note that each strongly proper path that uses three colors must exhibit this canonical pattern in one of two possible directions. Since the edge-colored graph G is strongly proper, it follows that D contains a tournament as a directed subgraph. Now, consider two cases.

Case 1: (D is acyclic) Note that, in this case, the vertices of D can be reordered as \(u_1, u_2, \ldots , u_6\), so that for \(i\in \lbrace 1, 2, \ldots , 5\rbrace \), there exists a strongly proper path from \(u_i\) to \(u_{i+1}\) with the canonical color pattern. Let W be the walk obtained by joining all those paths (in order from \(u_1\) to \(u_6\)). Note that no edge on W appears two times in a row, because if the last edge on the path from \(u_{i-1}\) to \(u_i\) was the same as the first edge on the path from \(u_i\) to \(u_{i+1}\), then by the choice of \(v_i\)’s the last but one and the second edge of those paths would also be the same, which contradicts the fact that both those paths have canonical color pattern; it also follows that W is strongly edge-colored. Moreover, each vertex from \(\lbrace v_1, v_2, \ldots , v_6 \rbrace \) appears on W exactly once, as, otherwise, there would be a cycle in D. This is a contradiction with the structure of \(G_d\), i.e., there is no walk in \(G_d\) that visits each vertex from \(\lbrace v_1, v_2, \ldots , v_6 \rbrace \) exactly once and does not contain two consecutive occurrences of some edge.

Case 2: (D contains a directed cycle \(u_1u_2\ldots u_k\)). Consider a closed walk W obtained by joining strongly proper paths with the canonical color pattern that go from \(u_1\) to \(u_2\), from \(u_2\) to \(u_3\), and so on, up to a path from \(u_k\) to \(u_1\). Note that, like in the previous case, W is strongly edge-colored and no edge of \(G_d\) appears on W two times in a row.

Let \(S=\lbrace x_1, w_1, x_2, w_2, x_3, w_3\rbrace \) and consider consecutive occurrences of vertices from S on W. Note that up to natural symmetries (i.e., renaming \(x_i\) to \(w_i\) and vice versa or rotating names, so that \(x_i, w_i\) become \(x_{i+1}\) and \(w_{i+1}\)) there are two cases: either (2a) at some point \(w_1\) is followed by \(x_2\), followed again by \(w_1\) or (2b) \(x_i\) is always followed by \(w_i\), and \(w_1\) is followed by \(x_2\), \(w_2\) by \(x_3\) and \(w_3\) by \(x_1\).

In case (2a), note that the first occurrence of \(w_1\) must be preceded by \(x_1\) and the second occurrence of \(w_1\)—followed by \(x_1\) (because otherwise \(P_1\) and \(P_2\) would form a cycle with the canonical color pattern, which is impossible as their total length is not divisible by 3). However, it implies that the edge \(x_1w_1\) occurs on W twice at distance exactly \(3a+3b+2\), which is a contradiction, because colors on W must repeat every three edges.

In the remaining case (2b) a part of W from the first occurrence of the edge \(x_1w_1\) to its second occurrence must be a strongly edge-colored cycle; denote it by C. Since the length of C must be divisible by 3, it contains either vertices \(\lbrace v_1, v_3, v_5 \rbrace \) or \(\lbrace v_2, v_4, v_6 \rbrace \). Let \(u_1, u_2, u_3\) be vertices from \(\lbrace v_1, v_2, \ldots , v_6 \rbrace \) outside C.

Note that \(u_i\) may not be incident to both incoming and outgoing arcs in D. Indeed, if that was the case, then a part of C, together with paths from C to \(u_i\) and from \(u_i\) to C with canonical color pattern, would form a strongly 3-edge-colored cycle with length not divisible by 3, which is a contradiction. However, this implies that D does not contain an arc between two of the vertices from \(\lbrace u_1, u_2, u_3\rbrace \) (i.e., there can be no arc between two vertices with outdegree 0), which contradicts the fact that D contains a tournament. Therefore, the proof is complete. \(\square \)

2.4 Nonrepetitive Connected Coloring of Graphs

In this subsection, we prove that 4-connected graphs satisfy \({{\,\textrm{nrc}\,}}(G)\le 6\) and 2-connected graphs satisfy \({{\,\textrm{nrc}\,}}(G)\le 15\). Actually, we will derive these bounds as simple consequences of more general results.

Theorem 6

Let G be a graph containing two edge-disjoint spanning trees. Then, \({{\,\textrm{nrc}\,}}(G)\le 6\).

Proof

Let \(T_1\) and \(T_2\) be two spanning trees of G, such that \(E(T_1)\cap E(T_2)=\emptyset \). Let r be a common root of these trees. Let \(E_i(T_1)\) be the set of edges at distance i from the root r. Therefore, \(E_0(T_1)\) consists of the edges of \(T_1\) incident to r, \(E_1(T_1)\) contains the edges of \(T_1\) incident to the neighbors of r, and so on. By the theorem of Thue [18], there exists a nonrepetitive sequence \(a_0a_1a_2\cdots \) of arbitrary length, such that \(a_i\in \{1,2,3\}\). We may color the edges of the tree \(T_1\) using this sequence, so that each edge in the set \(E_i(T_1)\) gets color \(a_i\). The same construction may be applied to the tree \(T_2\), with similarly defined sets \(E_i(T_2)\), and sufficiently long nonrepetitive sequence \(b_0b_1b_2\cdots \), with \(b_i\in \{4,5,6\}\). All other edges of G may be colored arbitrarily.

We claim that this coloring satisfies the desired property. Indeed, let uv be any two vertices of G. Denote by \(P_j(x,y)\), \(j=1,2\), the unique path from x to y in the tree \(T_j\). Consider the path \(P_1(u,r)\). Clearly, it is nonrepetitive by the construction of the coloring. If v lies on \(P_1(u,r)\), then the sub-path \(P_1(u,v)\) is nonrepetitive, too, and we are done. Therefore, assume that v lies outside \(P_1(u,r)\) and consider the path \(P_2(r,v)\). If the only common vertex of these two paths is r, then we may glue them together into a longer path \(P_1(u,r)P_2(r,v)\), which is clearly nonrepetitive, as the sets of colors on both fragments are disjoint.

Finally, suppose that the two paths, \(P_1(u,r)\) and \(P_2(r,v)\), have some common vertices other than the root r and let x be the one with the largest distance from r (in the tree \(T_1\), say). Then, the two sub-paths \(P_1(u,x)\) and \(P_2(x,v)\) intersect in only one vertex x and, as before, we may glue them together to get the nonrepetitive path \(P_1(u,x)P_2(x,v)\). This completes the proof. \(\square \)

To get the second assertion of Theorem 5, it suffices to apply the following simple fact following easily from the celebrated theorem of Nash–Williams [16] (see Corollary 44 in [17]).

Theorem 7

(Nash–Williams [16]). Every 2k-edge-connected graph contains k edge-disjoint spanning trees.

Indeed, it is enough to take \(k=2\) and notice that a 4-edge-connected graph is all the more 4-(vertex)-connected.

For the second bound for 2-connected graphs, we apply a similar approach with a slightly weaker property based on edge-independent trees. Recall that two spanning trees in a graph G, \(T_1\) and \(T_2\), having the same root r, are edge-independent if, for every vertex v, the unique paths \(P_1(v,r)\) in \(T_1\) and \(P_2(v,r)\) in \(T_2\) are edge disjoint.

Theorem 8

Let G be a graph containing two edge-independent spanning trees. Then, \({{\,\textrm{nrc}\,}}(G)\le 15\).

Proof

Let \(T_1\) and \(T_2\) be two edge-independent spanning trees of G. We will construct a similar coloring as in the proof of Theorem 6, but notice that this time the sets of edges \(E(T_1)\) and \(E(T_2)\) need not be disjoint. Therefore, we will color the edges of G by ordered pairs of colors whose first coordinates are controlled by an appropriate coloring of \(T_1\), while second coordinates are determined by an analogous coloring of \(T_2\).

Therefore, let r be a common root of trees \(T_1\) and \(T_2\). Let \(E_i(T_1)\) be the set of edges at distance i from the root r. Therefore, \(E_0(T_1)\) consists of the edges of \(T_1\) incident to r, \(E_1(T_1)\) contains the edges of \(T_1\) incident to the neighbors of r, and so on. By Thue’s theorem [18], there exist nonrepetitive sequences, \(a_0a_1a_2\cdots \) and \(b_0b_1b_2\cdots \), of arbitrary length, such that \(a_i\in \{1,2,3\}\) and \(b_i\in \{4,5,6\}\). We may color the edges of trees \(T_1\) and \(T_2\) using these sequences, so that each edge in the set \(E_i(T_1)\) gets color \(a_i\) and each edge in \(E_i(T_2)\) gets color \(b_i\). Now, if an edge e belongs to both trees, then its final color is an ordered pair of colors \((a_i,b_j)\). In this way, we get a partial coloring of G using at most \(9+6=15\) colors. The rest of the edges of G, not belonging to trees \(T_i\), may be colored by these colors arbitrarily.

We claim that this coloring satisfies the desired property. Indeed, let uv be any two vertices of G. Denote by \(P_j(x,y)\), \(j=1,2\), the unique path from x to y in the tree \(T_j\). Consider the path \(P_1(u,r)\). Clearly, it is nonrepetitive by the construction of the coloring. If v lies on \(P_1(u,r)\), then the sub-path \(P_1(u,v)\) is nonrepetitive, too, and we are done. Therefore, assume that v lies outside \(P_1(u,r)\) and consider the path \(P_2(v,r)\). Let \(x_1\) be the first vertex on the path \(P_1(u,r)\) traversed from u to r belonging to \(P_2(v,r)\). Let \(e_u=yx_1\) be the last edge on the sub-path \(P_1(u,x_1)\). Similarly, let \(x_2\) be the first vertex on the path \(P_2(v,r)\) traversed from v to r belonging to \(P_1(u,r)\). Let \(e_v=zx_2\) be the last edge on the sub-path \(P_2(v,x_2)\). Now, it is not hard to verify that, by the assumption of the edge-independence of trees \(T_j\), each of these two edges belong to only one tree, namely, \(e_u\) to \(T_1\) and \(e_v\) to \(T_2\). Consequently, the color of \(e_u\), which is some \(a_i\), cannot occur on the path \(P_2(v,x_2)\). It follows that the path \(P_1(u,x_2)P_2(x_2,v)\) is nonrepetitive. This completes the proof. \(\square \)

It is conjectured that every k-edge-connected graph contains k edge-independent spanning trees with an arbitrarily choosen common root r (see [17]). To get the first part of Theorem 5, it suffices to invoke the results of Itai and Rodeh [12] and Khuller and Scheiber [13] confirming this conjecture for \(k=2\) (see [17]).

3 Final Remarks

Let us conclude the paper with some natural open problems. The first one is very concrete and asks for the optimum value of the strongly proper connection number \({{\,\textrm{spc}\,}}(G)\) in the class of 2-connected graphs.

Problem 9

Determine the least possible number k, such that every 2-connected graph G satisfies \({{\,\textrm{spc}\,}}(G)\le k\).

We know that \(k=4\) or 5, but which is the correct value? It would be also nice to know what happens for graphs with higher connectivity. For instance, it is known (see [3, 14]) that \({{\,\textrm{pc}\,}}(G)=2\) holds already for 3-connected graphs. Also, our graphs \(G_d\) from the proof of Theorem 2 are not 3-connected. This prompts us to formulate the following conjecture.

Conjecture 10

Every 3-connected graph G satisfies \({{\,\textrm{spc}\,}}(G)\le 3\).

Let us stress, however, that we do not even know if the above inequality holds for graphs with any sufficiently high connectivity.

It would be also nice to know more on nonrepetitive connected coloring and the corresponding parameter \({{\,\textrm{nrc}\,}}(G)\).

Problem 11

Determine the least possible number t, such that every 2-connected graph G satisfies \({{\,\textrm{nrc}\,}}(G)\le t\).

By Theorem 8, we know that \(t\in \{3,4,\ldots , 15\}\). The problem seems challenging even if restricted to some classes of graphs. Consider, for instance, nonrepetitive connected coloring of planar graphs. Barnette [2] proved that every 3-connected planar graph contains a spanning tree of maximum degree at most three (see [17]). Using a general upper bound form [1], one gets that for such graphs, we have \({{\,\textrm{nrc}\,}}(G)\le 8\). Also, since 4-connected planar graphs are Hamiltonian, as proved by Tutte [19], they satisfy the best possible bound \({{\,\textrm{nrc}\,}}(G)\le 3\).

As mentioned in the introduction, one may consider fairly general \({\mathcal {P}}\)-connected colorings, where \({\mathcal {P}}\) is any property of sequences. The minimum number of colors needed for such a coloring of G, with fixed property \({\mathcal {P}}\), is denoted by \({{\,\mathrm{{\mathcal {P}}-c}\,}}(G)\). A property \({\mathcal {P}}\) is called honest if it possess the following basic features:

  1. (i)

    If a sequence S has property \({\mathcal {P}}\), then each nonempty block of S also satisfies \({\mathcal {P}}\).

  2. (ii)

    If S and T are two sequences over disjoint alphabets (color sets) satisfying \({\mathcal {P}}\), then their concatenation ST also satisfies \({\mathcal {P}}\).

  3. (iii)

    There exist arbitrarily long sequences over some finite alphabet satisfying property \({\mathcal {P}}\).

Let us denote by \(m({\mathcal {P}})\) the least possible constant in condition (iii). For instance, if \({\mathcal {P}}\) corresponds to strong coloring or nonrepetitive coloring, then \(m({\mathcal {P}})=3\), while if \({\mathcal {P}}\) stems from the usual proper coloring, then \(m({\mathcal {P}})=2\).

It is now easy to see that repeating the proof of Theorem 5 gives the following general result.

Theorem 12

Let \({\mathcal {P}}\) be any honest property of sequences. If G is a graph containing two edges disjoint spanning trees, then \({{\,\mathrm{{\mathcal {P}}-c}\,}}(G)\le 2\,m({\mathcal {P}})\). In particular, every 4-connected graph G satisfies \({{\,\mathrm{{\mathcal {P}}-c}\,}}(G)\le 2m({\mathcal {P}})\).

One naturally wonders if the above statement could be true for 2-connected graphs (or at least for 3-connected graphs), possibly with some larger upper bound.

Conjecture 13

Let \({\mathcal {P}}\) be any honest property of sequences. Then, there exists a constant \(t({\mathcal {P}})\), such that every 2-connected graph G satisfies \({{\,\mathrm{{\mathcal {P}}-c}\,}}(G)\le t({\mathcal {P}})\).

One also naturally wonders if the minimum possible number of colors in a \({\mathcal {P}}\)-connected coloring can be achieved at the expense of increasing connectivity.

Conjecture 14

Let \({\mathcal {P}}\) be any honest property of sequences. Then, there exists a constant \(c({\mathcal {P}})\), such that every \(c({\mathcal {P}})\)-connected graph G satisfies \({{\,\mathrm{{\mathcal {P}}-c}\,}}(G)\le m({\mathcal {P}})\).