1 Introduction

The geometric concept of points in general position, the still open Dudeney’s no-three-in-line problem [6] from 1917 (see also [18, 22]), and the general position subset selection problem [8, 28] from discrete geometry all motivated the introduction of a related concept in graph theory as follows [19]. Let \(G = (V (G), E(G))\) be a graph. Then, the objective of the general position problem is to find a largest set of vertices \(S \subseteq V(G)\), called a \(\mathrm{gp}\)-set of G, such that no vertex of S lies on a geodesic between two other vertices of S. The general position number (\(\mathrm{gp}\)-number for short), \(\mathrm{gp}(G)\), of G is the cardinality of a gp-set of G. We point out that a couple of years earlier and in different terminology, the graph theory general position problem was considered in [32] and that in the special case of hypercubes the problem was much earlier studied by Körner [17].

Following the above listed seminal papers, the general position problem has been extensively investigated [1, 9, 13, 15, 16, 20, 25, 27, 29,30,31]. Let us emphasize some selected results. From [19], we recall that the general position problem is NP-complete, and that in a block graph, the set of all simplicial vertices forms a gp-set. In [1], it is proved that \(S \subseteq V(G)\) is a general position set if and only if the components of the subgraph induced by S are complete subgraphs, the vertices of which form an in-transitive, distance constant partition of S. In the same paper, a formula for the gp-number of the complement of a bipartite graph is deduced and simplified for the complements of trees, of grids, and of hypercubes. In [16], the general position problem has been studied on different product graphs and connected with strong resolving graphs. It should be added that the concept of the general position set has been recently [14] extended to d-general position sets.

The main topic of interest related to the general position problem thought was the Cartesian product operation. Let us denote by \(X^n\) the Cartesian product of n factors each isomorphic to X, and let \(P_\infty \) be the two-way infinite path. One of the main results from [19] asserts that \(\mathrm{gp}(P_\infty ^2) = 4\). In the same paper, it was also proved that \(10\le \mathrm{gp}(P_\infty ^3) \le 16\). The lower bound 10 was improved to 14 in [13]. These efforts culminated in [15] where it is proved that if \(n\in {{\mathbb {N}}}\), then \(\mathrm{gp}(P_\infty ^n) = 2^{2^{n-1}}\). The general position problem in Cartesian products has been further investigated in [13, 30, 31]. In particular, it was proved in [30] that \(\mathrm{gp}(G\,\square \,H) \le n(G ) + n(H) - 2\), where the equality holds if and only if G and H are both generalized complete graphs. Moreover, the main result of [31] asserts that the general position number is additive on Cartesian products of trees.

In this paper, the edge version of the graph theory general position problem is introduced. A set S of edges of graph G is said to be an edge general position set if no geodesic of G contains three edges of S. An edge general position set of maximum cardinality is called a \(\mathrm{gp_{e}}\)-set of the graph. An edge general position problem is to find a \(\mathrm{gp_{e}}\)-set. The cardinality of a maximum edge general position set is called the edge general position number (in short \(\mathrm{gp_{e}}\)-number) of G, to be denoted by \(\mathrm{gp_{e}}(G)\). Our results indicate that the edge general position problem is a concept that deserves to be investigated; in particular, it is intrinsically different from the general position problem.

We proceed as follows. In the next section, we give further definitions needed and prove some preliminary results. In Sect. 3, we first prove that \(\mathrm{gp_{e}}(Q_r) = 2^r\). This is in contrast with the fact that determining \(\mathrm{gp}(Q_r)\) appears to be very difficult [17]. We also prove that the leaves of a tree form an \(\mathrm{gp_{e}}\)-set of it. These two results are then used to discuss Mulder’s meta-conjecture on median graphs. In Sect. 4, we determine \(\mathrm{gp_{e}}(P_r\,\square \,P_s)\) for all \(r,s\ge 2\). Here the distinct difference between the vertex and the edge version of the general position problem is that the edge general position number of the \(n \times n\) grid is proportional to n, whereas the general position number of the \(n \times n\) grid remains constant even when n tends to infinity. Moreover, we prove that the \(\mathrm{gp_{e}}\)-set of \(P_r\,\square \,P_s\) is unique as soon as \(r,s\ge 5\), another striking difference with the vertex version.

2 Preliminaries

In this section, we first state further concepts and the notation needed. We continue with some preliminary and auxiliary results.

Unless stated otherwise, graphs considered in this paper are connected. Let \(G = (V(G), E(G))\) be a graph with vertex set V(G) and edge set E(G). Its order and size will be, respectively, denoted by n(G) and m(G). Let \(P_n\) denote the path on n vertices and \(C_n\) the cycle on n vertices. The distance \(d_G(u, v)\) between vertices u and v of G is the number of edges on a shortest uv-path. Shortest paths are also known as isometric paths or geodesics. The diameter \(\mathrm{diam}(G)\) of G is the maximum distance between u and v of G. A subgraph H of a graph G is isometric if \(d_H(x, y) = d_G(x, y)\) holds for every pair of vertices xy of H. A pendant vertex of a graph is a vertex of degree one, the edge incident to it is a pendant edge.

The Cartesian product \(G\,\square \,H\) of graphs G and H is defined on the vertex set \(V(G\,\square \,H) = V(G)\times V(H)\); vertices (gh) and \((g',h')\) are adjacent if either \(gg'\in E(G)\) and \(h=h'\), or \(g=g'\) and \(hh'\in E(H)\). If \(h\in V(H)\), then the subgraph of \(G\,\square \,H\) induced by the vertices (gh), \(g\in V(G)\), is a G-layer and is denoted by \(G^h\). Analogously, if \(g\in V(G)\), then the H-layer \(^g\!H\) is the subgraph of \(G\,\square \,H\) induced by the vertices (gh), \(h\in V(H)\). G-layers and H-layers are isomorphic to G and to H, respectively.

The r-dimensional hypercube \(Q_r\), \(r\ge 1\), is a graph with \(V(Q_r) = \{0, 1\}^r\), and there is an edge between two vertices if and only if they differ in exactly one coordinate. That is, if \(x = (x_1, \ldots , x_r)\) and \(y = (y_1, \ldots , y_r)\) are vertices of \(Q_r\), then \(xy\in E(Q_r)\) if and only if there exists \(j\in [r]\) such that \(x_j \ne y_j\) and \(x_i = y_i\) for every \(i\ne j\). Note that \(n(Q_r) = 2^r\) and \(m(Q_r) = r2^{r - 1}\). Note also that \(Q_r = Q_{r-1}\,\square \,K_2\) holds for \(r\ge 2\).

If \(\mathrm{diam}(G) = 2\), then a geodesic of G contains at most two edges. Hence, we have the following observation.

Lemma 2.1

If \(\mathrm{diam}(G) = 2\), then \(\mathrm{gp_{e}}(G) = m(G)\).

Lemma 2.1 in particular implies that \(\mathrm{gp_{e}}(K_n) = \left( {\begin{array}{c}n\\ 2\end{array}}\right) \) and that \(\mathrm{gp_{e}}(C_n) = n\) for \(3\le n\le 5\). If \(n \ge 6\), then it is easy to observe that \(\mathrm{gp_{e}}(C_n) = 4\).

An isometric path edge cover of a graph G is a collection \({{{\mathcal {P}}}}\) of isometric paths of G such that each edge of G lies on at least one of the paths from \({{{\mathcal {P}}}}\). The cardinality of a smallest isometric path edge cover is the isometric path edge number of G and denoted by \(\mathrm{ip_e}(G)\). The following observation will turn out to be very useful; hence, we state it as a lemma for further use.

Lemma 2.2

If G is a connected graph, then \(\mathrm{gp_{e}}(G) \le 2\cdot \mathrm{ip_e}(G)\).

Proof

Let \({{{\mathcal {P}}}}\) be an isometric path edge cover of G, where \(|{{{\mathcal {P}}}}| = \mathrm{ip_e}(G)\). Since paths from \({{{\mathcal {P}}}}\) are isometric, each of them contains at most two edges from an arbitrary edge general position set, hence the conclusion. \(\square \)

3 Hypercubes, Trees, and Mulder’s Meta-Conjecture

A graph G is a partial cube if G is an isometric subgraph of some hypercube. Partial cubes have application in many different areas ranging from interconnection networks [10], media theory [7], till mathematical chemistry, the papers [2, 4] are just a selection of many papers on the latter applications. For recent developments on the theory of partial cubes, we refer to [3, 21, 23, 26] and references therein.

A key tool in the investigation of partial cubes is the Djoković–Winkler relation \(\Theta \) [5, 33] defined as follows. Edges xy and uv of a graph G are in relation \(\Theta \) if \(d_G(x,u) + d_G(y,v) \not = d_G(x,v) + d_G(y,u)\). Winkler [33] proved that a connected graph G is a partial cube if and only if G is bipartite and \(\Theta \) is transitive. As \(\Theta \) is reflexive and symmetric and the edge set of an arbitrary graph, it partitions the edge set of a partial cube into \(\Theta \)-classes.

Lemma 3.1

Let G be a partial cube, and let \(F_1\) and \(F_2\) be \(\Theta \)-classes of G. Then, \(F_1 \cup F_2\) is an edge general position set of G.

Proof

It is well known that if P is a shortest path in a graph G, then no two edges of P are in relation \(\Theta \), cf. [11, Lemma 11.1]. Let \(e, f, g\in F_1 \cup F_2\). Suppose first that \(e, f, g\in F_1\). Then, no two of these edges lie on a common geodesic. The case \(e, f, g\in F_2\) is analogous. Suppose second that, without loss of generality, \(e, f\in F_1\) and \(g \in F_2\). But then e and f are not on a common geodesic. In any case, e, f, and g are not on a common geodesic. \(\square \)

As a small example consider the partial cube G from Fig. 1. Since the partial cube has two \(\Theta \)-classes each containing four edges (marked on the figure), Lemma 3.1 implies that \(\mathrm{gp_{e}}(G) \ge 8\). On the other hand, it is not difficult to find an isometric path edge cover of G consisting of four geodesics, hence \(\mathrm{gp_{e}}(G) \le 8\) by Lemma 2.2. We conclude that \(\mathrm{gp_{e}}(G) = 8\).

Fig. 1
figure 1

A partial cube G

Theorem 3.2

If \(r\ge 2\), then \(\mathrm{gp_{e}}(Q_r) = 2^r\).

Proof

It is well known that hypercubes are partial cubes. Moreover, a \(\Theta \)-class of a hypercube is formed by the edges whose endpoints differ in the same, fixed coordinate. Hence, \(Q_r\) has r \(\Theta \)-classes, each containing \(2^{r-1}\) edges. Lemma 3.1 thus implies that \(\mathrm{gp_{e}}(Q_r) \ge 2^r\).

To prove the reverse inequality, we claim the following: if \(r\ge 2\), then there exists an isometric path edge cover \({{{\mathcal {P}}}}_r\) of \(Q_r\), where the paths from \({{{\mathcal {P}}}}_r\) can be oriented such that the endpoints of the paths form one of the bipartition sets of \(Q_r\). It is straightforward to check that the claim holds for \(r=2\), see the left-hand side of Fig. 2 where the circled \(Q_2\) is covered with two 2-paths. These two paths end in the two gray vertices which form a bipartition set of this \(Q_2\).

Fig. 2
figure 2

Covering \(Q_3\) with four shortest path. The paths are further oriented such that the endpoints of the paths form one of the bipartition sets

Let now \({{{\mathcal {P}}}}'_r\) be an isometric path edge cover of \(Q_r\), \(r\ge 2\), together with the orientation of the paths such that the endpoints of the paths form one of the bipartition sets of \(Q_r\). Let further \({{{\mathcal {P}}}}_r''\) be an isometric edge path cover of \(Q_r\), where the paths from \({{{\mathcal {P}}}}_r''\) are orientated such that the endpoints of the paths form the other bipartition set of \(Q_r\). The existence of \({{{\mathcal {P}}}}'_r\) will be guaranteed by the induction, while \({{{\mathcal {P}}}}''_r\) can be constructed from \({{{\mathcal {P}}}}'_r\) by applying the automorphism of \(Q_r\) which assigns to each vertex u the vertex \(u + 00\ldots 01\), where \(+\) stands for the component-wise summation modulo 2. (See the right-hand side of Fig. 2, where \({{{\mathcal {P}}}}_2''\) is shown with the endpoints of its two shortest paths drawn gray again.) Consider now \(Q_{r+1}\) as the Cartesian product \(Q_r\,\square \,K_2\) with layers \(Q_r^1\) and \(Q_r^2\), and respective isometric path edge covers \({{{\mathcal {P}}}}_r'\) and \({{{\mathcal {P}}}}_r''\). Then, extend each path from \({{{\mathcal {P}}}}_r'\) by the edge from its endpoint in \(Q_r^1\) to its (unique) neighbor in \(Q_r^2\) and orient the new edge in this direction. Note that the new path is a shortest path of \(Q_{r+1}\). Similarly, extend each path from \({{{\mathcal {P}}}}_r''\) by the edge from its endpoint in \(Q_r^2\) to its (unique) neighbor in \(Q_r^1\) and orient the new edge in this direction. Note that the ends of the paths obtained by extending paths from \({{{\mathcal {P}}}}_r'\) together with the ends of the paths obtained by extending paths from \({{{\mathcal {P}}}}_r''\) form a bipartition set of \(Q_{r+1}\). (See Fig. 2 again for these extensions and note that their ends form the bipartition set of \(Q_3\) drawn white.) This proves the claim.

It follows from the above proved claim that \(Q_r\) admits an isometric path edge cover \({{{\mathcal {P}}}}_r\) together with an orientation which reveals that \(|{{{\mathcal {P}}}}_r|\) is the size of a bipartition set of \(Q_r\), that is, \(|{{{\mathcal {P}}}}_r| = 2^{r-1}\). By Lemma 2.2, we conclude that \(\mathrm{gp_{e}}(Q_r) \le 2^r\). \(\square \)

Another fundamental class of partial cubes is the class of trees for which we have the following.

Theorem 3.3

If L is the set of pendant edges of a tree T, then \(\mathrm{gp_{e}}(T) = |L|\).

Proof

We first prove that \(\mathrm{gp_{e}}(T) \le |L|\). Let S be an edge general position set of T and suppose that a non-pendant edge, say e, belongs to S. Let \(T_1\) and \(T_2\) be the components of \(T - e\). Then, \(E(T_1) \cap S = \emptyset \) or \(E(T_2) \cap S = \emptyset \). Indeed, if there would be edges \(e'\in E(T_1) \cap S\) and \(e''\in E(T_2) \cap S\), then the edges e, \(e'\), and \(e''\) would lie on a common geodesic. We may thus without loss of generality assume that \(E(T_2 ) \cap S = \emptyset \). Let f be a pendant edge of \(T_2\) that is at largest possible distance from e. (Here an arbitrary pendant edge of \(T_2\) would actually do the job, except maybe a pendant edge adjacent to e.) Then, it is straightforward to see that \((S \setminus \{e\}) \cup \{f\}\) is an edge general position set of T. Inductively continuing this process, we end up with an edge general position set of T which contains only pendant edges and has the same cardinality as S. We conclude that \(\mathrm{gp_{e}}(T) \le |L|\).

To see that \(\mathrm{gp_{e}}(T) \ge |L|\) holds, observe that the set of pendant edges of a tree form an edge general position set because a geodesic of T can pass through at most two pendant edges. \(\square \)

Trees and hypercubes are fundamental building blocks of the class of median graphs, cf. [12], which is in turn (probably) the most important subclass of partial cubes. In 1990, Mulder proposed the following meta-conjecture: Any (sensible) property that is shared by trees and hypercubes is shared by all median graphs, see [24]. Theorems 3.2 and 3.3 do not share some obvious common property, that is, for hypercubes \(\mathrm{gp_{e}}\)-sets constructed are the union of two \(\Theta \)-classes, while for trees their \(\mathrm{gp_{e}}\)-sets are the sets of their leaves. Hence, it is yet to be seen whether Mulder’s meta-conjecture applies to the edge general position number of median graphs. We will further comment on this at the end of the next section.

4 Grid Networks

In this section, we determine the \(\mathrm{gp_{e}}\)-number of Cartesian products of two paths, known also as grid networks. We will always assume that \(V(P_r) = [r] = \{1,\ldots , r\}\). The \(P_r\)-layers of \(P_r \,\square \,P_s\) are thus denoted by \(P_r^i\), \(i\in [s]\), and the \(P_s\)-layers by \(^j\!P_s\), \(j\in [r]\). An edge \(e = uv\) of \(P_r \,\square \,P_s\) is called a boundary edge if \(\{d(u), d(v)\} = \{2, 3\}\) or \(\{d(u), d(v)\} = \{3\}\), it is a semi-boundary edge if \(\{d(u), d(v)\} = \{3, 4\}\), otherwise e is an internal edge; that is, e is internal if \(\{d(u), d(v)\} = \{4\}\).

The main result of this section reads as follows. By the commutativity of the Cartesian product operation, the result covers all non-trivial grid networks, that is, we may without loss of generality assume that \(r\ge s\).

Theorem 4.1

If \(r\ge s\ge 2\), then

$$\begin{aligned} \mathrm{gp_{e}}(P_r \,\square \,P_s) = {\left\{ \begin{array}{ll} r + {2}; &{} s = 2,\\ 2r; &{} s = 3,\\ 2r + 2s - 8; &{} s \ge 4\,. \end{array}\right. } \end{aligned}$$

Proof

Suppose first that \(s\ge 6\). Construct an isometric path edge cover of \(P_r\,\square \,P_s\) as follows. Select first four paths that cover all the edges from the \(P_s\)-layers \(^2\!P_s\), \(^3\!P_s\), \(^{r-2}\!P_s\), \(^{r-1}\!P_s\), as well as all the edges from the \(P_r\)-layers \(P_r^1\) and \(P_r^s\). See Fig. 3 where such four paths are drawn for the case \(r=10\) and \(s=7\).

Fig. 3
figure 3

Part of an isometric path edge cover of \(P_{10}\,\square \,P_7\)

By symmetry, select additional four paths that cover all the edges from the \(P_r\)-layers \(P_r^2\), \(P_r^{3}\), \(P_r^{s-2}\), \(P_r^{s-1}\), as well as all the edges from the \(P_s\)-layers \(^1P_s\) and \(^rP_s\). Note that the eight paths selected so far cover all the edges from six \(P_r\)-layers and all the edges from six \(P_s\)-layers. Hence, we may easily complete the path edge cover by adding \(r-6\) paths that cover the edges not yet covered in the \(P_s\)-layers and \(s-6\) paths that cover the edges not yet covered in the \(P_r\)-layers. The constructed path edge cover contains \(8 + (r-6) + (s-6) = r+s-4\) paths. Lemma 2.2 implies that \(\mathrm{gp_{e}}(P_r\,\square \,P_s) \le 2r + 2s - 8\). On the other hand, the set of the semi-boundary edges of \(P_r\,\square \,P_s\) is an edge general position set of cardinality \(2r+2s-8\). We conclude that it is a \(\mathrm{gp_{e}}\)-set, that is, \(\mathrm{gp_{e}}(P_r\,\square \,P_s) = 2r + 2s - 8\) when \(r\ge s\ge 6\).

Suppose next that \(s=5\). Let F be an arbitrary edge general position set of \(P_r \,\square \,P_5\) and distinguish two cases.

Case 1. \(|F\cap E(^iP_5)| \le 1\) for each \(i\in [r]\).

Suppose first that \(|F\cap E(\bigcup _i{^iP_5})| = r-x\), where \(x\ge 3\). This means that there are exactly x \(P_s\)-layers with no edges from F and \(r-x\) \(P_s\)-layers with exactly one edge from F. Since every of the five \(P_r\)-layers contains at most two edges from F, it follows that \(|F| \le (r-x) + 10\). We wish to show that \((r-x) + 10 \le 2r+2\) which is equivalent that \(r+x\ge 8\) holds. Since \(r\ge 5\) and \(x\ge 3\), this is indeed the case.

Suppose second that \(|F\cap E(\bigcup _i{^iP_5})| = r-x\), where \(x\in \{0,1,2\}\). If each \(P_r\)-layer contains at most one edge from F, then \(|F| \le (r-x) + 5\). We wish to show that \(r-x+5 \le 2r + 2\), which is equivalent to \(r+x\ge 3\), the latter being clearly true. Hence, suppose that at least one \(P_r\)-layer shares two edges with F. In this case, we claim that there are at least two \(P_5\)-layers that have no edge in F. To demonstrate this claim, suppose that the edges \(e = (i,j)(i+1,j)\) and \(e' = (i',j)(i'+1,j)\) lie in F for some \(j\in [5]\). We may without loss of generality assume that \(i < i'\). Then, no edge f from the layer \(^iP_5\) lies in F because f lies on a common shortest path with e and \(e'\). From the same reason, no edge from the layer \(^{i'+1}P_5\) lies in F. It follows that \(|F| \le (r-2) + 10\) and we wish that \((r-2) + 10\le 2r + 2\), that is, \(r\ge 6\). This settles Case 1 in all possibilities except when \(r=5\).

It remains to consider \(P_5\,\square \,P_5\). The theorem asserts that \(\mathrm{gp_{e}}(P_5\,\square \,P_5) = 12\). The 12 semi-boundary edges imply that \(\mathrm{gp_{e}}(P_5\,\square \,P_5) \ge 12\). Here it remains to prove that \(\mathrm{gp_{e}}(P_5\,\square \,P_5) \le 12\) under the assumption of Case 1. This is clearly the case if each \(P_r = P_5\)-layer contains at most one edge from F. Hence, assume that some \(P_r = P_5\)-layer contains two edges from F. Then, we see similarly as above that the \(P_s\)-layers (\(s=5\) of course) contain at most 3 edges from F. Hence, the only possibility to get more than 13 edges in F is that each \(P_r = P_5\)-layer contains exactly two edges from F. In this case, we claim that these 10 edges must project to exactly two edges of the \(P_r = P_5\) factor. Suppose on the contrary that there exist edges \(e = (i,j)(i+1,j)\), \(e' = (i',j')(i'+1,j')\), and \(e'' = (i'',j'')(i''+1,j'')\) from F such that \(i< i' < i''\), that is, such that they project to three edges of \(P_r = P_5\). If \(j\le j'\le j''\) or \(j\ge j'\ge j''\), then \(e,e',e''\) lie on a common geodesic, which is not possible. So assume without loss of generality that \(j< j'' < j'\). Consider now the second edge from the layer in which \(e'\) lies, let it be \(f = (k,j')(k+1,j')\). If \(k < i'\), then f, \(e'\), and \(e''\) lie on a common geodesic. And if \(k > i'\), then f, \(e'\) and e lie on a common geodesic. In any case, we have a contradiction which proves that the 10 edges project to exactly two edges of the \(P_r = P_5\) factor. But then it is clear that there are no more edges in F.

Case 2. There exists an \(i\in [r]\) such that \(|F\cap E(^iP_5)| = 2\).

Suppose first that this i is unique. Since this \(P_5\)-layer has two edges from F, we see that at least two of the \(P_r\)-layers have no edges in F. Since the other have at most two such edges, we conclude that \(|F| \le 2 + (r-1) + 3\cdot 2\) holds in this subcase. We wish to show that \(2 + (r-1) + 6 \le 2r + 2\), which is equivalent to \(r\ge 5\). So we are done in this subcase.

Suppose second that there are at least two \(P_5\)-layers with exactly two edges from F. Then, we infer again that the projection of these edges on the factor \(P_5\) contain exactly two edges. But then we easily obtain that in each case \(|F|\le 2r + 2\). For instance, if each of the \(P_5\) layers contains exactly two edges from F, then actually none of the edges from the \(P_r\)-layers lie in F. This settles Case 2, and hence, the theorem is proved for the case \(s=5\).

Suppose next that \(s=4\), that is, \(P_s = P_4\). Let F be an arbitrary edge general position set of \(P_r \,\square \,P_4\).

Case 1. \(|F \cap E(^iP_4)|\le 1\) for each \(i \in [r]\).

Suppose first that \(|F \cap E(\bigcup _i {^iP_4}) | = r-x\) where \(x \ge 4\). This means that there are exactly x \(P_s\)-layers with no edges from F. Since each of the four \(P_r\)-layers contains at most two edges from F, it follows that \(|F| \le (r-x)+8\). We wish to show that \((r-x)+8 \le 2r\) which is equivalent to \(r+x\ge 8\). Since \(r\ge 4\) and \(x\ge 4\), this is indeed the case.

Suppose second that \(|F\cap E(\bigcup _i {^iP_4})| = r-x\) where \(x \in \{0, 1, 2, 3\}\). If each \(P_r\)-layer contains at most one edge from F, then \(|F|\le (r-x)+4\). We wish to show that \(r-x+4\le 2r\) which is equivalent to \(r+x\ge 4\), the latter being clearly true. Hence, suppose that at least one \(P_r\)-layer shares two edges with F. In this case, we infer that there are at least two \(P_4\)-layers that have no edge in F. It follows that \(|F| \le (r-2)+8\). Since we would like to see that \((r-2)+8\le 2r\), that is \(r\ge 6\), this settles Case 1 in all possibilities except when \(r\in \{4,5\}\).

Consider \(P_4\,\square \,P_4\). The theorem asserts that \(\mathrm{gp_{e}}(P_4\,\square \,P_4)=8\) and the eight semi-boundary edges imply that \(\mathrm{gp_{e}}(P_4\,\square \,P_4)\ge 8\). Hence, it remains to prove that \(\mathrm{gp_{e}}(P_4\,\square \,P_4)\le \ 8\) (under the assumption of Case 1). This is clearly the case if each \(P_r = P_4\)-layer contains at most one edge from F. Hence, assume that some \(P_r = P_4\)-layer contains two edges from F. Then, there exist at least two \(P_s = P_4\)-layers that have no edge in F. Hence, under the assumption of Case 1, the \(P_s\)-layers together contain at most two edges from F. Hence, the only possibility to get more than eight edges in F is that at least three among the \(P_r = P_4\)-layers must contain exactly two edges from F. But then the \(P_s\)-layers can contain at most one edge from F and we easily conclude that \(|F|\le 8\).

Consider \(P_5\,\square \,P_4\). The theorem asserts that \(\mathrm{gp_{e}}(P_5\,\square \,P_4) = 10\). The ten semi-boundary edges imply that \(\mathrm{gp_{e}}(P_5\,\square \,P_4)\ge 10\). It remains to prove that \(\mathrm{gp_{e}}(P_5\,\square \,P_4)\le 10\) under the assumption of Case 1. If each \(P_r = P_5\)-layer contains at most one edge from F, then there is nothing to prove. Hence, assume that some \(P_r = P_5\)-layer contains two edges from F. Then, we claim that the \(P_s = P_4\)-layers together contain at most three edges from F. Assume, hence, that \((i,j)(i+1,j)\) and \((i',j)(i'+1,j)\) are two edges from \(E(P_5^j) \cap F\). Then, \(E(^kP_4) \cap F = \emptyset \) for each \(k\le i\) and for each \(k\ge i'+1\). Hence, at most three \(P_4\)-layers can have edges from F, and thus, the case assumption implies that the \(P_s = P_4\)-layers together contain at most three edges from F. Hence, the only possibility to get more than ten edges in F is that at all four \(P_5\)-layers contain exactly two edges from F. But in that case, no \(P_4\)-layer can share an edge with F.

Case 2. There exists an \(i \in [r]\) such that \(|F \cap E(^iP_4)| =2\).

Suppose first that this i is unique. Since this \(P_4\)-layer has two edges from F, we see that at least two of the \(P_r\)-layers have no edges in F. Since the other \(P_r\)-layers have at most two such edges, we conclude that \(|F| \le 2+(r-1) +2\cdot 2\) holds in the subcase. We wish to show that \(2 + (r-1) +4 \le 2r\) which is equivalent to \(r\ge 5\). This settles Case 2 in all possibilities except when \(r= 4\). For \(P_4\,\square \,P_4\), we can use a parallel argument as we gave in Case 1.

Suppose second that there are at least two \(P_4\)-layers with exactly two edges from F. Then, we infer that the projection of these edges on the factor \(P_4\) contains exactly two edges. But then we can verify easily that in each case, \(|F|\le 2r\). For instance, if each of the \(P_s = P_4\)-layers contains exactly two edges from F, then actually none of the edges from the \(P_r\)-layers lie in F. This settles Case 2 and hence the theorem for \(s=4\).

Next, let \(s=3\). Note that the theorem asserts that \(\mathrm{gp_{e}}(P_r\,\square \,P_4) = \mathrm{gp_{e}}(P_r\,\square \,P_3) = 2r\). As we have already proved that \(\mathrm{gp_{e}}(P_r\,\square \,P_4) = 2r\) and \(P_r\,\square \,P_3\) is an isometric subgraph of \(P_r\,\square \,P_4\), it follows that \(\mathrm{gp_{e}}(P_r\,\square \,P_3) \le \mathrm{gp_{e}}(P_r\,\square \,P_4)\). On the other hand, a set of 2r edges that is a \(\mathrm{gp_{e}}\)-set of \(P_r\,\square \,P_4\) can also be used as an edge general position set of \(P_r\,\square \,P_3\), that is, a \(\mathrm{gp_{e}}\)-set of \(P_r\,\square \,P_3\).

Finally, let \(s=2\). If each of the two \(P_r\)-layers intersects F in at most one edge, then clearly \(|F| \le r + 2\). On the other hand, if one of the two \(P_r\)-layers contains two edges from F, then at least two edges of the \(P_2\)-layers are not in F. Hence, again \(|F| \le 2 + 2 + (r-2) = r + 2\). On the other hand, the union of two \(\Theta \)-classes, one with r edges, and the other with 2 edges, is an edge general position set by Lemma 3.1. \(\square \)

We next supplement Theorem 4.1 by the following information.

Theorem 4.2

If \(r,s\ge 5\), then the \(\mathrm{gp_{e}}\)-set of \(P_r \,\square \,P_s\) is unique.

Proof

By Theorem 4.1, we know that the set S of semi-boundary edges of \(P_r \,\square \,P_s\) form a \(\mathrm{gp_{e}}\)-set of \(P_r \,\square \,P_s\). We need to prove that there is no other \(\mathrm{gp_{e}}\)-set. For this sake, assume that T is an arbitrary edge general position set different from S. Our goal is to show that \(|T| < 2r + 2s - 8\). Since \(T\ne S\), we see that T contains a boundary or an internal edge and distinguish our considerations accordingly.

Suppose first that T contains a boundary edge e. By the commutativity of \(P_r\,\square \,P_s\) and by the symmetry between the layers \(^1\!P_s\) and \(^r\!P_s\), we may without loss of generality assume that \(e \in E(^1\!P_s)\).

Case 1. \(T\cap E(P_r^1) \ne \emptyset \) or \(T\cap E(P_r^s) \ne \emptyset \).

In this case, we infer that \(|T\cap E(P_r^i)| \le 1\) for \(i \in [s]\) and that \(|T\cap E(^j\!P_s)| \le 1\) for \(j\in [r]\). Then, clearly, \(|T| \le r + s\) and we wish to show that \(r + s < 2r + 2s - 8\). We are done because \(r + s > 8\) holds.

In the rest of the argument, we may hence assume that \(T\cap E(P_r^1) = \emptyset \) and \(T\cap E(P_r^s) = \emptyset \).

Case 2. \(|T \cap E(^1\!P_s)| = 1\) and \(|T\cap E(^r\!P_s)| \in \{0,1\}\). In this case, \(|T\cap E(P_r^i)| \le 1\) holds for every \(2\le i \le s-1\). This in turn implies that \(|T| \le 2(r - 2) + 2 + s - 2 = 2r + s - 4\). We wish to show that \(2r + s - 4 < 2r +2s - 8\), and this indeed holds since \(s > 4\).

Case 3. \(|T \cap E(^1\!P_s)| = 2\) and \(T\cap E(^r\!P_s) = \emptyset \).

Then clearly \(T\cap E(P_r^1) = T\cap E(P_r^s) = \emptyset \) which implies \(|T| \le 2(r - 1) + s - 2\). We wish that \(2(r - 1) + s - 2 < 2r + 2s - 8\) which implies \(s > 4\) which is indeed the case.

Case 4. \(|T \cap E(^1\!P_s)| = 2\) and \(|T\cap E(^r\!P_s)| \in \{1,2\}\).

In this case, there exists at least three \(P_r\)-layers that contribute no edges to T. Hence, \(|T| \le 2(r - 1) + 1 + s - 3 = 2r +s - 4\). Now \(2r + s - 4 < 2r +2s - 8\) implies \(s > 4\) which is indeed true.

Suppose second that T contains an internal edge. We may further assume that T contains no boundary edge as we have already dealt with this situation. Without loss of generality, suppose there exists a \(P_s\)-layer, say \(^k\!P_s\), such that \(T \cap E(^k\!P_s) = \{e_1, e_2\}\), where at least one of \(e_1\) and \(e_2\) is an internal edge. Now observe that at least three \(P_r\)-layers (including two layers \(P_r^1\) and \(P_r^s\)) contribute no edges to T. Hence, \(|T| \le 2(r - 2) + 2(s - 3) < |S|\). \(\square \)

Note that Theorem 4.2 does not hold for the grids \(P_4 \,\square \,P_4\) and \(P_5 \,\square \,P_4\). Indeed, the sets of semi-boundary edges of them contain 8 and 10 edges, respectively. On the other hand, each \(\Theta \)-class of \(P_4 \,\square \,P_4\) has four edges, so the union of arbitrary two \(\Theta \)-classes is also a \(\mathrm{gp_{e}}\)-set of \(P_4 \,\square \,P_4\). In \(P_5 \,\square \,P_4\), there are three \(\Theta \)-classes with five edges each; hence, also the union of any two of them is a \(\mathrm{gp_{e}}\)-set of \(P_5 \,\square \,P_4\).

Let us return to the Mulder’s meta-conjecture. In the previous section, we found out that unions of two \(\Theta \)-classes are \(\mathrm{gp_{e}}\)-sets of hypercubes and that the unique \(\mathrm{gp_{e}}\)-set of a tree is the set of its pendant edges. Since each edge of a tree forms a \(\Theta \)-class, one could say that a (weak) common property of hypercubes and trees is that \(\mathrm{gp_{e}}\)-sets are unions of \(\Theta \)-classes. But this does not extend to all median graphs. Since the Cartesian product of two median graphs is again median, we see that \(P_r\,\square \,P_s\) is a median graph. However, we have just seen that in \(P_r\,\square \,P_s\), where \(r\ge s\ge 5\), the set of its semi-boundary edges forms a unique \(\mathrm{gp_{e}}\)-set. Clearly, this set is not a union of \(\Theta \)-classes of \(P_r\,\square \,P_s\).

5 Conclusions

In this paper, the edge general position problem is completely solved for hypercubes and two-dimensional grids. A notable contribution of this paper is the discussion of Mulder’s meta-conjecture on median graphs from the perspectives of the edge general position problem. This problem may be studied for other classes of graphs such as Cayley graphs, perfect graphs, bipartite graphs, etc.

It would also be pertinent to view this problem in generalized perspectives. For instance, for a given integer \(k\ge 3\), one may call a set S of edges of a graph G an edge k-general position set if no k edges of S lie on a common geodesic. An edge k-general position set S of maximum cardinality is an k-\(\mathrm{gp_{e}}\)-set of G, and its cardinality is the edge k-general position number (in short, k-\(\mathrm{gp_{e}}\)-number) of G and is denoted by k-\(\mathrm{gp_{e}}(G)\). When \(k = 3\), this problem becomes an edge general position problem. The complexity status of edge k-general position problems is not known. Enthusiastic graph theory students will find the “edge k-general position problem" an interesting topic for further research.