1 Introduction

All graphs we consider in this paper are finite, simple and undirected. Let \(G=(V(G),E(G))\) be a graph. For \(u,v\in V(G)\), the distance between u and v is the length of the shortest path between u and v. For \(e_1, e_2\in E(G)\), the distance \(d_G(e_1,e_2)\) of \(e_1\) and \(e_2\) is the smallest value of the distance between the ends of \(e_1\) and \(e_2\). Note that adjacent edges are at distance 0. If \(e_1\), \(e_2\) and \(e_3\) form a path (in this order), then \(d_G(e_1,e_3)=1\).

An injective k-edge coloring of a graph G is a k-edge coloring \(\varphi \) of G such that \(\varphi (e_1)\ne \varphi (e_3)\) for any three consecutive edges \(e_1,e_2\) and \(e_3\) of a path or a 3-cycle. In other words, in an injective edge coloring, any two edges on a triangle or at distance exactly 1 receive distinct colors. Note that an injective edge coloring is not necessarily a proper edge coloring. The injective edge chromatic index of G, denoted by \(\chi _i'(G)\), is the minimum k such that G has an injective k-edge coloring.

The notion of injective edge coloring was introduced by Cardoso et al. [2] and independently by Axenovich et al. [1] (they called it induced star arboricity). Injective edge chromatic index is closely related to some other notions. A proper injective edge coloring is exactly a strong edge coloring [3]. The relations among injective edge chromatic index, acyclic chromatic index and star chromatic number were also explored in [3]. Cardoso et al. [2] showed that computing \(\chi _i'(G)\) of a graph G is NP-hard. Moreover, Foucaud et al. [4] showed that the injective 3-edge coloring problem and the injective 4-edge coloring problem are NP-complete even on some classes of subcubic graphs. Bounds on the injective edge chromatic index of trees, sparse graphs, graphs of given maximum degree and other important graph classes, have been recently determined in [2, 3, 5, 7, 9].

Ferdjallah et al. [3] proved that \(\chi _i'(G) \le 2(\Delta (G)-1)^2\) for any graph G, and posed the following conjecture.

Conjecture 1.1

[3] For every graph G with \(\Delta (G)\le 3\), \(\chi _i'(G)\le 6\).

Li and Chen [6] considered the injective edge chromatic index of the generalized Petersen graphs P(nk) for \(1\le k\le 2\). In this paper, we show that Conjecture 1.1 is true for some classes of the generalized Petersen graphs.

Throughout the paper, all subscripts are taken modulo n. Given integers \(n\ge 3\) and \(1\le k <\frac{n}{2}\) , the generalized Petersen graph P(nk) has 2n vertices labeled \(v_1,v_2,\ldots ,v_n,u_1,u_2,\ldots ,u_n\). The vertices labeled \(v_1,v_2,\ldots ,v_n\) are called outer vertices, while those labeled \(u_1,u_2,\ldots ,u_n\) are inner vertices. There are three types of edges in P(nk): (a) outer edges, connecting outer vertices in the form \(v_iv_{i+1}\) for each \(i\in \{1,2,\ldots ,n\}\); (b) inner edges, connecting inner vertices in the form \(u_iu_{i+k}\), for each \(i\in \{1,2,\ldots ,n\}\); and (c) spokes or edges connecting an outer vertex with an inner one, in the form \(v_iu_i\) for \(1\le i\le n\).

Our results are as follows.

Theorem 1.2

\(\chi _i'(P(n,k))\le 4\) if \(n\equiv 0(mod~4)\) and \(k\equiv 1(mod~2)\); and \(\chi _i'(P(n,k))\le 5\) if \(n\equiv 2(mod~4)\) and \(k\equiv 1(mod~2)\).

Theorem 1.3

\(\chi _i'(P(n,3))\le 5\).

Theorem 1.4

\(\chi _i'(P(3,1))\le 6\) and \(\chi _i'(P(2k+1,k))\le 5\) for \(k\ge 2\).

Theorem 1.5

\(\chi _i'(P(2k+2,k))\le 5\).

The paper is organized as follows. In Sects. 2 and 3, we prove Theorems 1.2 and 1.3, respectively. The proof of Theorem 1.4 is presented in Sect. 4, and the proof of Theorem 1.5 is completed in Sect. 5.

2 Proof of Theorem 1.2

2.1 \(\chi _i'(P(n,k))\) for \(n\equiv 0(mod~4)\) and \(k\equiv 1(mod~2)\)

For two positive integers n and k, (nk) denotes the greatest common divisor.

Lemma 2.1

[8] P(nk) is bipartite if and only if \(\frac{n}{(n,k)}\) is even and k is odd.

Lemma 2.2

[5] For every planar subcubic bipartite graph G, \(\chi '_i(G)\le 4\).

Lemma 2.3

If \(n\equiv 0\)(mod 4) and \(k\equiv 1(mod~2)\), then \(\chi '_i(P(n,k))\le 4\).

Proof

If \(k=1\), then P(nk) is planar. Note that n is even and k is odd, (nk) is odd, then \(\frac{n}{(n,k)}\) is even, and thus P(nk) is bipartite by Lemma 2.1. By Lemma 2.2, \(\chi '_i(P(n,k))\le 4\). In the following, we assume \(k\ge 3\).

Assume \(n=4q\) for some q. Let \(V_1=\{v_1,v_5,\ldots ,v_{4q-3}\}\), \(V_2=\{v_3,v_7,\ldots , v_{4q-1}\}\), \(V_3=\{u_2,u_6,\ldots ,u_{4q-2}\}\) and \(V_4=\{u_4,u_8,\ldots ,u_{4q}\}\). Note that the distance between any two vertices in \(V_i\) is at least 4 for \(1\le i\le 4\). For each edge \(e\in E(P(4q,k))\), e has exactly one end vertex x in \(V_1\cup V_2\cup V_3\cup V_4\), that is, \(x\in V_i\) for some \(1\le i\le 4\), we color e with color i. Now we get an injective 4-edge coloring of P(4qk). \(\square \)

2.2 \(\chi _i'(P(n,k))\) for \(n\equiv 2(mod~4)\) and \(k\equiv 1(mod~2)\)

Lemma 2.4

If \(n\equiv 2\)(mod 4) and \(k\equiv 1(mod~2)\), then \(\chi '_i(P(n,k))\le 5\).

Proof

If \(k=1\), then P(nk) is planar. Note that n is even and k is odd, then (nk) is odd, and \(\frac{n}{(n,k)}\) is even, and thus P(nk) is bipartite by Lemma 2.1. By Lemma 2.2, \(\chi '_i(P(n,k))\le 4\). In the following, we assume \(k\ge 3\).

Assume \(n=4q+2\) for some q. Let \(V_1=\{v_1,v_5,\ldots ,v_{4q-3}\}\) and \(V_2=\{v_3,v_7,\ldots ,v_{4q-1}\}\). We first color the vertices in \(V_1\) with color 1 and color the vertices in \(V_2\) with color 2. Denote \(S=\{u_2,u_4,u_6,\ldots ,u_{4q},u_{4q+2}\}\). We can construct a graph H with \(V(H)=S\), and two vertices in H are adjacent if and only if their distance in \(P(4q+2,k)\) is at most 3. Note that each vertex \(u_i\) of H has two neighbors \(u_{i+2k}\) and \(u_{i-2k}\). Then H is a 2-regular graph. First we show the following claim.

Claim 1

H can be properly colored with colors 3, 4 and 5. Moreover, we may assume that \(u_{4q+2}\), \(u_{4q}\), \(u_{k-1}\) and \(u_{4q+1-k}\) are not colored by color 3.

Proof of Claim 1

Since H is a 2-regular graph, H is a disjoint union of a cycles \(C_1\cup C_2\cup \ldots \cup C_a\). Then H can be properly colored with colors 3, 4 and 5. In the following, we show that \(u_{4q+2}\), \(u_{4q}\), \(u_{k-1}\) and \(u_{4q+1-k}\) can be colored with color 4 or color 5. Since \(u_{k-1}\) and \(u_{4q+1-k}\) are at distance 2 in \(P(4q+2,k)\), they are adjacent in H. Assume \(u_{k-1},u_{4q+1-k}\in V(C_1)\), \(u_{4q}\in V(C_i)\) and \(u_{4q+2}\in V(C_j)\). Color \(u_{k-1}\) with color 4 and color \(u_{4q+1-k}\) with color 5.

First we consider the case \(i\ne j\). If \(i=1\) or \(j=1\), say \(i=1\), we can color \(u_{4q}\) with color 4 and extend the coloring of \(\{u_{k-1},u_{4q+1-k},u_{4q}\}\) to a 3-coloring of \(C_1\) as \(C_1-\{u_{k-1},u_{4q+1-k},u_{4q}\}\) is a disjoint union of two paths. Then color \(u_{4q+2}\) with color 5 and extend the coloring of \(\{u_{4q+2}\}\) to a 3-coloring of \(C_j\) as \(C_j-\{u_{4q+2}\}\) is a path. If \(i\ne 1\) and \(j\ne 1\), we first extend the coloring of \(\{u_{k-1},u_{4q+1-k}\}\) to a 3-coloring of \(C_1\) as \(C_1-\{u_{k-1},u_{4q+1-k}\}\) is a path, and color \(u_{4q}\) with color 4 and extend the coloring of \(\{u_{4q}\}\) to a 3-coloring of \(C_i\) as \(C_i-\{u_{4q}\}\) is a path, then color \(u_{4q+2}\) with color 5 and extend this coloring to a 3-coloring of \(C_j\) as \(C_j-\{u_{4q+2}\}\) is a path.

Now we consider the case \(i=j\). If \(i=1\), we can color \(u_{4q}\) with color 4 and color \(u_{4q+2}\) with color 5, and extend the coloring of \(\{u_{k-1},u_{4q+1-k},u_{4q},u_{4q+2}\}\) to a 3-coloring of \(C_1\) as \(C_1-\{u_{k-1},u_{4q+1-k},u_{4q},u_{4q+2}\}\) is a disjoint union of three paths. If \(i\ne 1\), we first extend the coloring of \(\{u_{k-1},u_{4q+1-k}\}\) to a 3-coloring of \(C_1\) as \(C_1-\{u_{k-1},u_{4q+1-k}\}\) is a path, then color \(u_{4q}\) with color 4 and \(u_{4q+2}\) with color 5 and extend the coloring of \(\{u_{4q},u_{4q+2}\}\) to a 3-coloring of \(C_i\) as \(C_i-\{u_{4q},u_{4q+2}\}\) is disjoint union of two paths. \(\square \)

By Claim 1, H can be colored with colors 3, 4 and 5, and \(u_{4q+2}\), \(u_{4q}\), \(u_{k-1}\) and \(u_{4q+1-k}\) are not colored by color 3. Color \(v_{4q+1}\) with color 3. Then we get a partial 5-vertex coloring of \(P(4q+2,k)\) such that any two vertices with the same color are at distance at least 4. For any edge e of \(P(4q+2,k)\), e has exactly one end vertex x in \(V_1\cup V_2\cup S\cup \{v_{4q+1}\}\), then we can color e with the same color as that of x. Now we get an injective 5-edge coloring of \(P(4q+2,k)\). \(\square \)

3 Proof of Theorem 1.3

In this section, we show that \(\chi _i'(P(n,3))\le 5\). If n is even, we have \(\chi '_i(P(n,3))\le 4\) if \(n\equiv 0\) (mod 4) and \(\chi '_i(P(n,3))\le 5\) if \(n\equiv 2\) (mod 4) by Theorem 1.2. So in the following, we assume \(n\ge 7\) is odd. Figure 1 depicts injective 5-edge colorings of P(7, 3), P(9, 3), P(11, 3) and P(13, 3). In the following, we assume \(n\ge 15\).

If \(n\equiv 1\) \((mod~4)\), assume \(n=4q+1\) for some q. Then \(q\ge 4\). Let \(V_1=\{v_{4i-3}~|~1\le i\le q\}\), \(V_2=\{v_{4i-1}~|~1\le i\le q\}\), \(V_3=\{u_{4i-2}~|~1\le i\le q-2\}\), \(V_4=\{u_{4i}~|~1\le i\le q-2\}\), and \(V_5=\{u_{4q+1}\}\). Note that any two vertices in \(V_i\) are at distance at least 4 for \(1\le i\le 4\). For each edge e with an end vertex in \(V_i\), we color e with color i, where \(1\le i\le 5\). Then we get a partial injective 5-edge coloring of \(P(4q+1,3)\). In order to get an injective 5-edge coloring of \(P(4q+1,3)\), we only need to color those edges remain uncolored in the above coloring. Let \(E_3=\{u_{4q-6}v_{4q-6},u_{4q-6}u_{4q-9},u_{4q-2}v_{4q-2},u_{4q-2}u_{4q-5}\}\), \(E_4=\{u_{4q-4}v_{4q-4},u_{4q-4}u_{4q-7},u_{4q}v_{4q},v_{4q}v_{4q+1}\}\), \(E_5=\{u_{4q-3}u_{4q},u_{4q-3}u_{4q-6}, u_{4q-1}u_{4q-4},u_{4q-1}u_1\}\). Note that the distance of \(e\in E_3\) and f with color 3 is at least 2, then we can color each edge in \(E_3\) with color 3. By a similar argument, we can color each edge in \(E_4\) with color 4 and each edge in \(E_5\) with color 5. Now we get an injective 5-edge coloring of \(P(4q+1,3)\).

If \(n\equiv 3\) \((mod~4)\), assume that \(n=4q+3\) for some q. Then \(q\ge 3\). Let \(V_1=\{v_{4i-3}~|~1\le i\le q\}\), \(V_2=\{v_3, v_{4q+2}\}\), \(V_3=\{v_{4i-1}~|~2\le i\le q\}\), \(V_4=\{u_{4q+1},u_{4i-2}~|~1\le i\le q-1\}\), \(V_5=\{u_{4i}~|~1\le i\le q\}\). Note that any two vertices in \(V_i\) are at distance at least 4 for \(1\le i\le 5\). For each edge e with an end vertex in \(V_i\), we color e with color i. Then we get a partial injective 5-edge coloring of \(P(4q+3,3)\). In order to get an injective 5-edge coloring of \(P(4q+3,3)\), we only need to color \(v_{4q}v_{4q+1},u_{4q-1}u_{4q+2},v_{4q-2}u_{4q-2},u_{4q-2}u_{4q-5},v_{4q+3}u_{4q+3},u_{4q+3}u_{3}\). Note that the distance of \(e\in \{v_{4q}v_{4q+1},u_{4q-1}u_{4q+2}\}\) and f with color 1 is at least 2, then we can color \(v_{4q}v_{4q+1}\) and \(u_{4q-1}u_{4q+2}\) with color 1. By a similar argument, we can color \(v_{4q-2}u_{4q-2}\) and \(u_{4q-2}u_{4q-5}\) with color 2, color \(v_{4q+3}u_{4q+3}\) and \(u_{4q+3}u_{3}\) with color 3. Now we get an injective 5-edge coloring of \(P(4q+3,3)\).

Fig. 1
figure 1

The graph P(n, 3) and an injective 5-edge coloring of P(n, 3) for \(n\in \{7,9,11,13\}\)

4 Proof of Theorem 1.4

In this section, we give a proof of Theorem 1.4. It is easy to check that \(\chi _i'(P(3,1))\le 6\). In the following, we show that \(\chi _i'(P(2k+1,k))\le 5\) for \(k\ge 2\). We consider the following four cases.

Case 1. \(k\equiv 0\) (mod 4).

In this case, assume \(k=4q\) for some q. Let \(V_1=\{u_{2i-1}~|~1\le i\le 2q\}\), \(V_2=\{u_{2i}~|~1\le i\le 2q\}\), \(V_3=\{v_{4i+1}~|~q\le i\le 2q-1\}\) and \(V_4=\{v_{4i+3}~|~q\le i\le 2q-1\}\). For \(1\le i\le 4\), we note that any two vertices in \(V_i\) are at distance at least 4. For each edge e with an end vertex in \(V_i\), we color e with color i. Denote \(E_5=\{v_{4q-1}v_{4q},v_{8q}v_{8q+1},u_{8q+1}v_{8q+1},v_{8q+1}v_{1},u_{2i}v_{2i}~|~2q+1\le i\le 4q-1\}\). Note that any two edges in \(E_5\) are adjacent or at distance at least 2. Color each edge in \(E_5\) with color 5, then we get a partial injective 5-edge coloring of \(P(8q+1,4q)\).

In order to get an injective 5-edge coloring of \(P(8q+1,4q)\), we only need to color edges \(\{u_{8q}v_{8q},u_{4q+1}u_{8q+1}\}\) and the outer edges incident with \(v_{2i}\) for \(1\le i\le 2q-1\). Denote \(E_3=\{u_{8q}v_{8q}\}\cup \{e\) is an outer edge incident with \(v_{4i}~|~1\le i\le q-1\}\), and \(E_4=\{u_{4q+1}u_{8q+1}\}\cup \{e\) is an outer edge incident with \(v_{4i-2}~|~1\le i\le q\}\). Note that the distance of \(e\in E_3\) and f with color 3 is at least 2, we can color each edge in \(E_3\) with color 3. By a similar argument, we can color each edge in \(E_4\) with color 4. Now we get an injective 5-edge coloring of \(P(8q+1,4q)\).

Case 2. \(k\equiv 1\) (mod 4).

In this case, assume \(k=4q+1\) for some \(q\ge 1\). Let \(V_1=\{u_{2i-1}~|~1\le i\le 2q\}\), \(V_2=\{u_{2i}~|~1\le i\le 2q\}\), \(V_3=\{v_{4i+1}~|~q+1\le i\le 2q\}\) and \(V_4=\{v_{4i+3}~|~q\le i\le 2q\}\). For \(1\le i\le 4\), we note that any two vertices in \(V_i\) are at distance at least 4. For each edge e with an end vertex in \(V_i\), we color e with color i. Let \(E_1=\{u_{4q+1}v_{4q+1},u_{4q+1}u_{8q+2}\}\), and \(E_2=\{u_{4q+2}v_{4q+2},u_{4q+2}u_{8q+3}\}\). Since the two edges in \(E_1\) are consecutive and they are at a distance of at least 2 from other edges colored with color 1, we can color them by color 1. By the same argument, we can color these two edges in \(E_2\) by color 2. Denote \(E_5=\{v_{4q}v_{4q+1},v_{4q+1}v_{4q+2},u_{2i}v_{2i}~|~2q+2\le i\le 4q+1\}\). Note that any two edges in \(E_5\) are adjacent or at distance at least 2. Color each edge in \(E_5\) with color 5, then we get a partial injective 5-edge coloring of \(P(8q+3,4q+1)\).

In order to get an injective 5-edge coloring of \(P(8q+3,4q+1)\), we only need to color edges \(\{v_{4q-1}v_{4q},u_{4q+1}u_{8q+3}\}\) and the outer edges incident with \(v_{2i}\) for \(1\le i\le 2q-1\). Denote \(E_3=\{u_{4q+1}u_{8q+3}\}\cup \{e\) is an outer edge incident with \(v_{4i-2}~|~1\le i\le q\}\), and \(E_4=\{v_{4q-1}v_{4q}\}\cup \{e\) is an outer edge incident with \(v_{4i}~|~1\le i\le q-1\}\). Note that the distance of \(e\in E_3\) and f with color 3 is at least 2, we can color each edge in \(E_3\) with color 3. By a similar argument, we can color each edge in \(E_4\) with color 4. Now we get an injective 5-edge coloring of \(P(8q+3,4q+1)\).

Case 3. \(k\equiv 2\) (mod 4).

In this case, assume \(k=4q+2\) for some q. Let \(V_1=\{u_{2i-1}~|~1\le i\le 2q+1\}\), \(V_2=\{u_{2i}~|~1\le i\le 2q+1\}\), \(V_3=\{v_{4i-1}~|~q+1\le i\le 2q+1\}\), \(V_4=\{v_{4i+1}~|~q+1\le i\le 2q+1\}\). Note that any two vertices in \(V_i\) are at distance at least 4 for \(1\le i\le 4\). For each edge e with an end vertex in \(V_i\), we color e with color i. Denote \(E_5=\{u_{4q+3}u_{8q+5},v_{4q+1}v_{4q+2},u_{2i}v_{2i}~|~2q+2\le i\le 4q+2\}\). Note that any two edges in \(E_5\) are at distance at least 2. Color each edge in \(E_5\) with color 5, then we get a partial injective 5-edge coloring of \(P(8q+5,4q+2)\).

In order to get an injective 5-edge coloring of \(P(8q+5,4q+2)\), we only need to color the outer edges incident with \(v_{2i}\) for \(1\le i\le 2q\). Let \(E_3=\{e\) is an outer edge incident with \(v_{4i-2} ~|~1\le i\le q\}\) and \(E_4=\{e\) is an outer edge incident with \(v_{4i}~|~1\le i\le q\}\). Note that the distance of \(e\in E_3\) and f with color 3 is at least 2, we can color each edge in \(E_3\) with color 3. By a similar argument, we can color each edge in \(E_4\) with color 4. Now we get an injective 5-edge coloring of \(P(8q+5,4q+2)\).

Case 4. \(k\equiv 3\) (mod 4).

In this case, assume \(k=4q+3\) for some q. Let \(V_1=\{u_{2i-1}~|~1\le i\le 2q+1\}\), \(V_2=\{u_{2i}~|~1\le i\le 2q+1\}\), \(V_3=\{v_{4i+1}~|~q+1\le i\le 2q+1\}\), and \(V_4=\{v_{4i+3}~|~q+1\le i\le 2q+1\}\). Note that any two vertices in \(V_i\) are at distance at least 4 for \(1\le i\le 4\). For each edge e with an end vertex in \(V_i\), we color e with color i. Let \(E_1=\{u_{4q+3}v_{4q+3},u_{4q+3}u_{8q+6}\}\), and \(E_2=\{u_{4q+4}v_{4q+4},u_{4q+4}u_{8q+7}\}\). Since the two edges in \(E_1\) are consecutive and they are at a distance of at least 2 from other edges colored with color 1, we can color them by color 1. By the same argument, we can color these two edges in \(E_2\) by color 2. Denote \(E_5=\{v_{4q+2}v_{4q+3},v_{4q+3}v_{4q+4},u_{2i}v_{2i}~|~2q+3\le i\le 4q+3\}\). Note that any two edges in \(E_5\) are adjacent or at distance at least 2. Color each edge in \(E_5\) with color 5, then we get a partial injective 5-edge coloring of \(P(8q+7,4q+3)\).

In order to get an injective 5-edge coloring of \(P(8q+7,4q+3)\), we only need to color \(\{v_{4q+1}v_{4q+2},u_{4q+3}u_{8q+7}\}\) and the outer edges incident with \(v_{2i}\) for \(1\le i\le 2q\). Denote \(E_3=\{v_{4q+1}v_{4q+2},u_{4q+3}u_{8q+7}\}\cup \{e\) is an outer edge incident with \(v_{4i-2}~|~1\le i\le q\}\), and \(E_4=\{e\) is an outer edge incident with \(v_{4i}~|~1\le i\le q\}\). Note that the distance of \(e\in E_3\) and f with color 3 is at least 2, we can color each edge in \(E_3\) with color 3. By a similar argument, we can color each edge in \(E_4\) with color 4. Now we get an injective 5-edge coloring of \(P(8q+7,4q+3)\).

5 Proof of Theorem 1.5

In this section, we show that \(\chi _i'(P(2k+2,k))\le 5\). Note that \(2k+2\) is even. If k is odd, we have \(\chi '_i(P(2k+2,k))\le 4\) if \(2k+2\equiv 0\) (mod 4) and \(\chi '_i(P(2k+2,k))\le 5\) if \(2k+2\equiv 2\) (mod 4) by Theorem 1.2. So in the following, we assume k is even. We consider the following two cases.

Case 1. \(k\equiv 0\) (mod 4).

In this case, assume \(k=4q\) for some q. Let \(V_1=\{u_{4i-3}\) or \(u_{4j+2}~|~1\le i\le q,q\le j\le 2q-1\}\), \(V_2=\{u_{4i-1}\) or \(u_{4j}~|~1\le i\le q,q+1\le j\le 2q\}\), \(V_3=\{v_{4i-2}\) or \(v_{4j+3}~|~1\le i\le q,q\le j\le 2q-1\}\), \(V_4=\{v_{4i}\) or \(v_{4j+1}~|~1\le i\le q,q+1\le j\le 2q\}\). Note that any two vertices in \(V_i\) are at distance at least 4 for \(1\le i\le 4\). For each edge e with an end vertex in \(V_i\), we color e with color i. Let \(E_3=\{u_{4q}u_{8q+2},u_{4q+1}u_{8q+1}\}\). Since the two edges in \(E_3\) are at a distance of at least 2 among themselves and both are at a distance of at least 2 from other edges colored with color 3, we can color them by color 3. Denote \(E_5=\{v_{4q+1}v_{4q+2},u_{4q+1}v_{4q+1},v_{8q+2}v_{1},u_{8q+2}v_{8q+2}\}\). Note that any two edges in \(E_5\) are adjacent or at distance at least 2. Color each edge in \(E_5\) with color 5, then we get an injective 5-edge coloring of \(P(8q+2,4q)\).

Case 2. \(k\equiv 2\) (mod 4).

In this case, assume \(k=4q+2\) for some q. It is easy to check that \(\chi _i'(P(6,2))\le 5\). So in the following we assume \(q\ge 1\). Let \(V_1=\{u_{4i-3}\) or \(u_{4j}~|~1\le i\le q,q+1\le j\le 2q\}\), \(V_2=\{u_{4i-1}\) or \(u_{4j+2}~|~1\le i\le q,q+1\le j\le 2q\}\), \(V_3=\{v_{4i-2}\) or \(v_{4j+3}~|~1\le i\le q+1,q+1\le j\le 2q\}\), \(V_4=\{v_{4i}\) or \(v_{4j+1}~|~1\le i\le q,q+1\le j\le 2q+1\}\). Note that any two vertices in \(V_i\) are at distance at least 4 for \(1\le i\le 4\). For each edge e with an end vertex in \(V_i\), we color e with color i. Let \(E_1=\{u_{4q+1}v_{4q+1},u_{4q+1}u_{8q+3},u_{4q}u_{8q+4},u_{8q+4}v_{8q+4}\}\) and \(E_2=\{u_{4q+2}u_{8q+6},u_{4q+3}v_{4q+3},u_{4q+3}u_{8q+5},u_{8q+6}v_{8q+6}\}\). Since all edges in \(E_1\) are at a distance of at least 2 from other edges colored with color 1, we can color them by color 1. By the same argument, we can color all edges in \(E_2\) by color 2. Denote \(E_5=\{v_{4q+3}v_{4q+4},v_{8q+6}v_{1},u_{4q+1}u_{8q+5},u_{4q+2}u_{8q+4}\}\). Note that any two edges in \(E_5\) are at distance at least 2. Color each edge in \(E_5\) with color 5, then we get an injective 5-edge coloring of \(P(8q+6,4q+2)\).