1 Introduction

In the whole paper we will use standard graph theory notations. A 2-edge-colored graph is a pair \((G, \sigma )\) where G is a undirected graph and \(\sigma :E(G)\rightarrow \{\text {'}+\text {'},\text {'}-\text {'}\}\). For the vertex \(v\in V(G)\) by \(N^-(v)\) (resp. \(N^+(v)\)) we denote the set of neighbors of v such that the edge to v has assignment ’−’ (resp. ’\(+\)’). Similarly for a set \(S \subset V(G)\), we define \(N^{-}(S) = \bigcup _{v\in S} N^{-}(v)\) and \(N^{+}(S) = \bigcup _{v\in S} N^{+}(v)\).

A 2-edge-colored coloring of a 2-edge-colored graph G is a proper coloring \(\phi \) of V(G) such that if there exist two edges \(\{u,v\}\) and \(\{x,y\}\) with \(\phi (u) = \phi (x)\) and \(\phi (v) = \phi (y)\), then these two edges have the same sign. The 2-edge-colored chromatic number of the 2-edge-colored graph G, denoted by \(\chi _2(G)\), is the minimum number of colors needed for a 2-edge-colored coloring.

Equivalently, the 2-edge-colored chromatic number \(\chi _2(G, \sigma )\) of the 2-edge-colored graph \((G, \sigma )\) is the minimum order of the graph \((H, \lambda )\) such that \((G, \sigma )\) admits a 2-edge-colored homomorphism (preserving edges and signs) to \((H, \lambda )\). Graph \((H, \lambda )\) we call a target graph or coloring graph. The 2-edge-colored chromatic number \(\chi _2(G)\) of a graph G is defined as maximum over all 2-edge-colored of G. For a graph class \({\mathcal {F}}\), we define the 2-edge-colored chromatic number \(\chi _2({\mathcal {F}})\) as the maximum over 2-edge-colored chromatic number for any members of \({\mathcal {F}}\). For convenience, in the rest of the paper we will omit the \(\sigma \) and simply write G for a 2-edge-colored graph \((G,\sigma )\) if there is no ambiguity.

In this paper we focus on 2-edge-colored chromatic number for class of 2-dimensional grids\({\mathcal {G}}\). The grid is defined as the graph being the Cartesian product of two paths. Similarly, by \({\mathcal {G}}_k\) we denoted the grid with k columns.

The \(\chi _2({\mathcal {G}})\) was investigated in 2016 by Bensmail [1], who showed that \(7\le \chi _2({\mathcal {G}}) \le 12\). Recently, in 2019, the same author [2] improved both bounds by showing, that \(8\le \chi _2({\mathcal {G}}) \le 11\), determine the exact value \(\chi _2({\mathcal {G}}_2)=5\) and bounds \(7 \le \chi _2({\mathcal {G}}_3) \le 9\).

In Sect. 2 we define 2-edge-colored Paley graph \(SP_q\) and focus on \(SP_9\) as a target graph in 2-edge-colored homomorphisms. That graph was used in this context earlier, for example Montejano et al. [6] show that there exist 2-edge-colored homomorphism from every 2-edge-colored outerplanar graph to \(SP_9\). Some other application of that target graph we can find in [7].

In Sect. 3 we prove:

Theorem 1

For every 2-edge-colored gridGthere exists a 2-edge-colored homomorphism\(h: G \rightarrow SP_9\).

Corollary 2

\(8 \le \chi _2({\mathcal {G}}) \le 9\).

In Sect. 4 we focus on grids with 3 columns and improve upper bound given by Bensmail. More precisely we show that:

Theorem 3

For every 2-edge-colored gridGwith 3 columns there exists a 2-edge-colored homomorphism\(h: G \rightarrow SP_9{\setminus }\{0\}\).

Corollary 4

\(7 \le \chi _2({\mathcal {G}}_3) \le 8\).

2 Graph \(SP_9\)

Let q be a prime power such that \(q \equiv 1 \pmod 4\) and \({\mathbb {F}}_q\) be finite field of order q. The Paley graph\(P_q\) is undirected graph with vertex set \(V(P_q) = {\mathbb {F}}_q\) and edge set \(E(P_q) = \big \{\{x,y\} : y-x \) is a non-zero square in \({\mathbb {F}}_q\big \}\). Notice that \(-1\) is a square in \({\mathbb {F}}_q\). Hence, if \(x-y\) is a square, then \(y-x\) is a square.

The 2-edge-colored Paley graph\(SP_q\) is 2-edge-colored graph \((K_q, \sigma )\), where \(K_q\) is the complete graph on vertices \({\mathbb {F}}_q\) and \(\sigma (\{x,y\})= '+' \iff y-x\) is a non-zero square in \({\mathbb {F}}_q\). In this paper we use 2-edge-colored Paley graph \(SP_9\) build over the Galois’ field \(GF(3^2)\). Elements of this field are the polynomials of degree 1 over GF(3) with multiplication modulo \(x^2+1\). Elements \(\{0,1,2,x,2x\}\) are squares and \(\{x+1, x+2, 2x+1, 2x+2 \}\) are non squares. The graph \(P_9\) is presented on Fig. 1.

Lemma 5

[8] \(SP_q\)is isomorphic to the 2-edge-colored graph constructed by flipping signs of all edges.

The following properties of \(SP_9\) are well know:

Lemma 6

  1. 1.

    The Paley graph \(SP_9\) has 72 automorphisms.

  2. 2.

    For every non-zero square\(a\in {\mathbb {F}}_9\)and every\(b\in {\mathbb {F}}_9\), the function\(h_{a,b}(y)=ay+b\)is an automorphism in\(SP_9\).

  3. 3.

    The reflection function\(r: SP_9 \rightarrow SP_9\), which maps the polynomial\(ux+v\)to\(vx+u\)is an automorphism in\(SP_9\).

  4. 4.

    Each automorphismhin\(SP_9\)is either of the form\(h=h_{a,b}\)or is a composition\(h=r \circ h_{a,b}\)for someaandb.

Lemma 7

The Paley graph\(SP_9\)is vertex-transitive and edge-transitive. Moreover for every two induced subgraphs\(S_1\)and\(S_2\)with\(|S_1|=|S_2|=3\)and the same number of edges marked with ’−’, there is an automorphism of\(SP_9\)which maps\(S_1\)on\(S_2\).

Fig. 1
figure 1

Paley graph \(SP_9\). Solid lines represent edges signed by ’\(+\)

Lemma 8

For every vertex\(v \in V(SP_9)\), \(|N^+(v)| = 4\)and\(|N^-(v)| = 4\).

We shall call 3-elements induced subgraph \(T\subset V(SP_9)\) a triangle if all its edges are marked with the same sign. Furthermore, we shall say that set \(S \subset V(SP_9)\) is triangle free if the subgraph of \(SP_9\) induced by S does not contain a triangle.

Lemma 9

For every vertex\(v \in V(SP_9)\), the sets\(N^+(v)\)and\(N^-(v)\)are triangle free.

Proof

By Lemmas 5 and 7, it is enough to prove this lemma for vertex \(v=0\) and \(N^+(v)\). The subgraph of \(SP_9\) induced by \(N^+(0) = \{1,2,x,2x\}\) contains two disjoint edges signed ’\(+\)’ (\(\{1,2\}\) and \(\{x,2x\}\)) and the cycle \(C_4\) signed ’−’ (1, 2x, 2, x). \(\square \)

Lemma 10

Suppose that\(S \subset V(SP_9)\), \(|S|=3\)andSis triangle free, then\(|N^+(S)| = 8\)and\(|N^-(S)| = 8\).

Proof

By Lemma 5 and 7, it is sufficient to consider the triangle free set \(S=\{0,1,x\}\). Then \(N^+(S) = SP_9{\setminus } \{2x+2\}\) and \(N^-(S) = SP_9{\setminus } \{0\}\). \(\square \)

3 Proof of Theorem 1

Consider a path (uvw) with arbitrary signs on the edges \(\{u,v\}\) and \(\{v,w\}\). Suppose that we have: an arbitrary 3-elements triangle free set \(S_1 \subset V(SP_9)\) of colors available in u and an arbitrary color \(b \in V(SP_9)\) for the vertex w. Then there is a 3-elements triangle free set \(S_2 \subset V(SP_9)\) available in v. More precisely:

Lemma 11

Consider a path (uvw) with arbitrary signs on the edges\(\{u,v\}\)and\(\{v,w\}\). For every 3-elements triangle free set\(S_1 \subset V(SP_9)\)and every color\(b\in SP_9\), there exists a 3-elements triangle free set\(S_2 \subset V(SP_9)\)such that for each\(s_2 \in S_2\)there exists\(s_1 \in S_1\)and a coloring\(c: (u,v,w) \rightarrow V(SP_9)\)with\(c(u)=s_1\), \(c(v)=s_2\), \(c(w)=b\).

Proof

We will prove the lemma in case when both edges of path (uvw) are marked with ’\(+\)’. In any other case the proof is similar..

By Lemmas 10 and 8, \(|N^+(S_1)| = 8\) and \(|N^+(b)| = 4\). Hence, there exists 3-elements set \(S_2 \subset N^+(s_1) \cap N^+(b)\). By Lemma 9, the set \(S_2\) is triangle free. \(\square \)

Proof of Theorem 1

We color the 2-edge-colored grid G row by row. It is easy to color first row by \(SP_9\) (in fact, we can do it using only four colors, for example by \(N^+(0)=\{1,2,2x,2x+1\}\)). Assume now that, for \(k>1\), the first \(k-1\) rows of G have been already colored and we color k-th row.

Let us denote the vertices in the \(k-1\)-th row by \(a_1,a_2,\ldots ,a_n\) and the vertices in the k-th row by \(b_1,b_2,\ldots ,b_n\). By Lemma 8, the vertex \(b_1\) can be colored by four possible colors. By Lemma 9, any three of these colors form a triangle free set. Let us denote by \(S_1\) any of these sets. Now for each \(i=2,3,\ldots ,n\) we define set \(S_i\) as a result of applying Lemma 11 for the set \(S_{i-1}\) and the color \(h(a_i)\).

Now we can color vertices \(b_1,b_2,\ldots ,b_n\) in reverse order. First we choose any color in \(S_n\) for \(h(b_n)\). For \(h(b_{n-1})\) we set the color in \(S_{n-1}\) such that the sign of the edge \((h(b_{n-1}),h(b_n))\) in \(SP_9\) equals to the sign of the edge \((b_{n-1},b_{n})\) in the grid G. Notice that for each \(s\in S_{n-1}\), the sign of the edge \((a_{n-1},b_{n-1})\) in the grid is equals to the sign of the edge \((s,h(a_{n-1}))\) in \(SP_9\). Consecutive vertices we color in the same way. \(\square \)

4 Grids with 3 Columns

In the previous section, we show that every 2-edge-colored grid admits 2-edge-colored coloring with 9 colors. This bound can be improved when we consider grids with a small number of columns. Bensmail [2] shows that 2-edge-colored chromatic number of grids with two columns is equal to 5. From the same paper we know that \(7\le \chi _2({\mathcal {G}}_3) \le 9\). We can improve this upper bound by showing that there exists a homomorphism from every 2-edge-colored grids with 3 columns to \(SP^{-0}_9\), see Fig. 2. \(SP^{-0}_9\) is construct from \(SP_9\) by removing vertex 0. It is easy to see that this graph has 8 automorphisms. Namely, four rotations (\(f(y)=ay\) where a is a non-zero square) and four reflection. \(SP^{-0}_9\) is also isomorphic to the graph constructed by flipping signs of all edges.

Fig. 2
figure 2

2-edge-colored graph \(SP^{-0}_9\). Solid lines represent edges signed by ’\(+\)

Lemma 12

Consider a path (uvw) with arbitrary signs on the edges\(\{u,v\}\)and\(\{v,w\}\). For every color\(a \in SP^{-0}_9\)and every\(b\notin \{a, -a\}\)there exists a coloring of path\(c: (u,v,w) \rightarrow V(SP^{-0}_9)\)such that\(c(u)=a\)and\(c(w)=b\).

Proof

By automorphisms of \(SP^{-0}_9\) and the fact that it is isomorphic to the graph constructed by flipping signs of all edges, we can only consider the case when \(a=1\).

  • \(N^+(N^+(1)) = V(SP^{-0}_9) {\setminus } \{2\}\)

  • \(N^+(N^-(1)) = V(SP^{-0}_9) {\setminus } \{1\}\)

  • \(N^-(N^+(1)) = V(SP^{-0}_9) {\setminus } \{1\}\)

  • \(N^-(N^-(1)) = V(SP^{-0}_9)\)

\(\square \)

This observation leads to partition of \(SP^{-0}_9\) into four sets: \(\{1,2\}\), \(\{x,2x\}\), \(\{x+1,2x+2\}\) and \(\{x+2,2x+1\}\). Regardless of the signs of the edges of the path (uvw), if endpoints are colored using colors from two different sets, then we can color the middle point of the path.

Proof of Theorem 3

Let us consider the partition of \(V(SP^{-0}_9)\) into four sets: \(\{1,2\}\), \(\{x,2x\}\), \(\{x+1,2x+2\}\) and \(\{x+2,2x+1\}\). Observe that each set contains a pair \(\{a,-a\}\) and that for every vertex \(v\in SP^{-0}_9\), both \(N^+(v)\) and \(N^-(v)\) contain an element in at least three sets. We color the grid row by row. Three vertices in the first row we can easily color with \(SP^{-0}_9\). Assume now that, for \(k>1\), the first \(k-1\) rows of G have been already colored and we color k-th row. Let us denote the vertices in the \(k-1\)-th row by \(a_1,a_2,a_3\) and the vertices in the k-th row by \(b_1,b_2,b_3\). Now color vertices \(b_1,b_2,b_3\) starting from \(b_2\). Depending on sign of the edge \(\{a_2,b_2\}\), for \(c(b_2)\) use color in \(N^+(c(a_2))\) or \(N^-(c(a_2))\) which does not belong to the pairs: \(\{ c(a_1), -c(a_1) \}\) and \(\{ c(a_3), -c(a_3) \}\). By Lemma 12, we can extend this coloring to vertex \(b_1\) (using path \((a_1, b_1, b_2)\)) and to \(b_3\) (using \((b_2, b_3, a_3)\)). \(\square \)

5 Discussion

In this article, we show that \(SP_9\) colors all 2-edge-colored grids and that \(SP^{-0}_9\) colors all 2-edge-colored grids with 3 columns. Combining this with known lower bounds we have \(8 \le \chi _2({\mathcal {G}}) \le 9\) and \(7 \le \chi _2({\mathcal {G}}_3) \le 8\). In our opinion, \(SP^{-0}_9\) is the best candidate to lower the upper bound for \(\chi _2({\mathcal {G}})\). However, we do not know whether \(SP^{-0}_9\) colors all grids, and even whether it colors all grids with 4 columns. On the other hand, to increase lower bound for \(\chi _2({\mathcal {G}})\) we have to prove that there exists a 2-edge-colored grid G such that there is no homomorphism \(G \rightarrow SP^{-0}_9\). Finding such a grid also seems to be difficult.

Many authors investigate the relations between 2-edge-coloring and oriented coloring. Oriented coloring (see [9] for a short survey) of an oriented graph G is a homomorphism from G to a tournament H. The oriented chromatic number \(\chi _o(G)\) for oriented graph and for undirected graph are define analogously to 2-edge-colored case. A lot of research on 2-edge-colored and oriented coloring used the same techniques and get similar results. For example, in both cases, authors often use Paley graphs (or Paley tournaments) for the target graph. These may result from the similarity of the definitions: in both cases, edges are in one of two states (one of two signs or one of two directions). Despite these similarities, it is known that \(\chi _o(G)-\chi _2(G)\) and \(\chi _2(G)-\chi _o(G)\) can be arbitrarily large [3].

For grids, these two colorings seems to behave very similar. For example, for grids with 2 columns, we know that: \(\chi _2({\mathcal {G}}_2) = 5\) [2] and \(\chi _o({\mathcal {G}}_2) = 6\) [5]. For grids with 3 columns, we have \(7 \le \chi _2({\mathcal {G}}_3) \le 8\) and \(\chi _o({\mathcal {G}}_3) = 7\) [10]. The difference between these two chromatic number is very small. Therefore one can hope that also for the class of grids, they are close to each other. We know that oriented chromatic number for grids lies between 8 and 11 [4, 5]. Upper bound has not been improved since the first paper on the topic.