1 Introduction

The degree sequence of a graph or hypergraph provides useful information about its geometrical and topological properties. When a graph or hypergraph has been constructed for a given degree sequence, we say that it has been reconstructed. A longstanding problem concerns the use of degree sequences for the reconstruction of the related graphs or hypergraphs. In 1960, in a milestone paper, Erdös and Gallai [7] characterized the degree sequences of simple graphs and set the basis for the successive definition of fast reconstruction algorithms. These results can not be easily generalized to hypergraphs, even in the simplest form of the k-uniform ones, with \(k>2\). In recent years, many different reconstruction strategies have been considered, most of them relying on a general result of Dewdney in [4], concerning relevant sub-classes of k-uniform hypergraphs (see [1, 3, 9, 10]). Recently, Deza et al. proved the NP-completeness of the reconstruction problem of 3-uniform hypergraphs from their degree sequences [5]. So, the study of the classes of hypergraphs whose reconstruction can be performed in polynomial time becomes more relevant, as does the characteristics of the solutions related to a single degree sequence. As an example, in [12], the authors defined a general operator to move among all the 3-hypergraphs sharing the same degree sequence and they introduced the notion of null-labelling obtained as the symmetric difference of the edges of any two 3-hypergraphs. In [8], this notion, restricted to 3-hypergraphs, is studied through their intersection graph and a sufficient condition for its existence was provided. Finally, in [6], it was shown that as the number of edges of the related 3-hypergraph increases, the usefulness of the intersection graph decreases, and the stronger notion of 2-intersection graph was introduced. In particular, the presence of a Hamiltonian cycle in the 2-intersection graph guarantees the existence of, and allows one to compute, the null labelling of the related 3-hypergraph.

Our study relies on these results and aims to deepen the knowledge of the structural properties of 2-intersection graphs. In particular, we are concerned with the following

Question Given a graph G, is it possible to decide in polynomial time whether there exists a 3-hypergraph H such that \(G\cong I_2(H)\)?

If it is possible, we say that G is reconstructible or equivalently, it has the 2-intersection property. Here, we prove that the reconstruction problem is NP-complete.

2 Definitions and Preliminary Results

Let us recall some basic definitions for graph and hypergraphs, borrowing the notation from [2]. A graph G is defined as a pair \(G=(V,E)\) such that \(V=\{v_1,\dots ,v_n\}\) is the set of vertices and E is a subset of pairs of vertices called edges. The notion of graph admits a natural generalization to hypergraph by removing the constraint on the cardinality of the edges: \(H=(V,E)\) is a hypergraph with \(V=\{v_1,\dots ,v_n\}\) the set of vertices and E a collection of subsets of vertices called hyperedges, or briefly edges, when no misunderstanding may arise. We also choose to abbreviate the vertex notation \(v_i\) with its only index i, when possible. In the sequel, we will consider only graphs and hypergraphs that are simple, i.e., they do not allow singleton (hyper)edges or (hyper)edges that are contained in or equal to other edges. The degree of a vertex \(v\in V\) is the number of (hyper)edges containing v. The degree sequence \(d=(d_1,d_2,\ldots ,d_n)\) of a (hyper)graph is the list of its vertex degrees usually arranged in non-increasing order. We focus on a remarkable class of hypergraphs, i.e., k-uniform hypergraphs or simply k-hypergraphs, whose hyperedges have a fixed cardinality k. In particular we are going to consider 3-hypergraphs.

Given a (hyper)graph, we can assign a \(+1\) or \(-1\) label to each (hyper)edge, resulting in positive and negative degrees of the vertices. An assignment of \(\pm 1\) to the (hyper)edges of a (hyper)graph is a null labelling if, for each vertex v, the sum d(v) of the labels of its incident edges equals 0. A (hyper)graph that admits a null labelling is said to be a null (hyper)graph. Note that an obvious necessary condition for a (hyper)graph to have a null labelling is that each vertex must have even degree, i.e., it is an even (hyper)graph.

The study of null (hyper)graphs is strictly related to their reconstruction from the degree sequences. Let \(H_1=(V,E_1)\) and \(H_2=(V,E_2)\) be two (hyper)graphs with the same vertex set V, and the same degree sequence \((d_1, d_2, \ldots , d_n)\). Assign \(+1\) to the (hyper)edges of \(H_1\) and \(-1\) to the (hyper)edges of \(H_2\). Such an assignment turns out to be a null labelling of the (hyper)graph \(H=H_1\oplus H_2=(V,(E_1\cup E_2){\setminus } (E_1\cap E_2))\). This raises the question of whether there is a characterization of null (hyper)graphs. From a computational perspective, the null labelling problems on k-hypergraphs turns out to be NP-hard when \(k\ge 3\), as proved in [8].

In the sequel, the study focuses on 3-hypergraphs. In [6] the notion of 2-intersection graph was introduced to study the null label problem. The 2-intersection graph of a 3-hypergraph H is denoted \(I_2(H)=(V_{2H},E_{2H})\). Its vertices \(V_{2H}=\{v_{e_1},\dots ,v_{e_m}\}\) represent the hyperedges \(E=\{e_1,\dots ,e_m\}\) of H. Two vertices \(v_{e_i}, v_{e_j}\in V_{2H}\) are adjacent, i.e., \(\{v_{e_i}, v_{e_j}\}\in E_{2H}\), if the related hyperedges \(e_i\) and \(e_j\) share exactly two vertices in H. In the sequel, we label the edge \(\{v_{e_i},v_{e_j}\}\in E_{2H}\) with the indices of the vertices that are shared by \(e_i\) and \(e_j\), if needed.

The following results holds.

Proposition 1

[6] Let H be a 3-hypergraph. If the 2-intersection graph \(I_2(H)\) is Hamiltonian, then H admits a null labelling.

We observe that, provided an even graph G with n connected components and such that each component has an even number of edges, we can find a null labelling of G by considering, for each component, an Eulerian cycle and assigning alternatively \(\pm 1\) to its edges. Note that this corresponds to have an intersection graph I(G) with n components, each having a Hamiltonian cycle, where we can alternately assign \(\pm 1\) to the vertices of each Hamiltonian cycle to obtain a null labelling in the same fashion. Therefore, it holds the following

Proposition 2

Let H be a 3-hypergraph whose 2-intersection graph \(G=I_2(H)\) has n connected components \(G_1, \dots ,G_n\). If each connected component \(G_i\), with \(1\le i \le n\), is Hamiltonian, and the sub-3-hypergraph \(H_i \subset H\) such that \(G_i=I_2(H_i)\) is even, then H admits a null labelling.

Proof

Since each \(G_i\) is Hamiltonian and it is the 2-intersection graph of an even sub-3-hypergraph \(H_i\), then we can apply Theorem 1 to it, obtaining a null labelling for \(H_i\). The null labelling of H is obtained by the union of the null labellings of these sub-hypergraphs. \(\square \)

Note that H may also be a connected 3-hypergraph, but the requirement of the previous theorem asks that \(I_2 (H)\) has to be disconnected. Furthermore, each of its components comes from an even sub\(-3\)-hypergraph of H.

Due to the connections with the null labelling problem, our main focus in this paper is to study the structural properties of the 2-intersection graph. The following property is straightforward, but it is fundamental for the next sections.

Property 1

[6] The edges of a 3-hypergraph H sharing the same pair of vertices determine a clique in the 2-intersection graph \(I_2(H)\).

In the sequel, we extend the common label of the edges of a clique of a 2-intersection graph to label the clique itself. In the next section, we study the structure of 2-intersection graphs.

3 Structural Properties of 2-Intersection Graphs

In this section we provide some structural properties of 2-intersection graphs that are related to 3-hypergraphs, with the aim of characterizing them and determining the computational complexity of this problem. Recall that a graph G has the 2-intersection property if it is the 2-intersection graph of a 3-hypergraph H. So, we approach the problem of the existence of a 3-hypergraph H whose 2-intersection graph is G, i.e., \(G\cong I_2(H)\), by first observing that Property 1 does not characterize the cliques of \(I_2(H)\). In fact, there may appear triangles (\(K_3\) cliques) whose edges do not share a common label. In order to distinguish them from the triangles whose edges have a common label, we indicate the first and the second types as T-triangles and K-triangles, respectively.

More precisely, the vertices \(\{v_1,v_2,v_3\}\) of a T-triangle have the general form \(v_1=\{x,y,z\}\), \(v_2=\{x,y,t\}\), and \(v_3=\{x,z,t\}\)—only four vertices of H are used; while those of a K triangle (with common label \(\{x,y\}\)) have the form \(v_1=\{x,y,z\}\), \(v_2=\{x,y,t\}\), and \(v_3=\{x,y,r\}\)—five vertices of H are used.

Figure 1a shows a configuration of a 2-intersection graph where a T-triangle and a K-triangle live together and share an edge. The T-triangle is shaded gray.

Fig. 1
figure 1

a Example of a T and a K sharing 2 vertices. b Example of S

With the previous definitions, a first obvious necessary condition for a graph to be reconstructible is described in the following lemma.

Lemma 1

If G is reconstructible, then every vertex of G must belong to at most three maximal cliques, such that the vertices of each of them have in common the same couple of labels. Furthermore, these maximal cliques can be joined by at most two non-adjacent T-triangles as shown in Fig. 2.

Proof

A clique in \(I_2 (H)\) can derive from a shared pair or it can be a triangle (in which two pairs are used). In all cases, since a vertex of \(I_2 (H)\) has only three pairs, it cannot belong to more than three cliques. However, note that the configuration in which a point is shared by four triangles is reconstructible (see Fig. 2).

Fig. 2
figure 2

Reconstruction of the configuration in which a point belongs to 5 triangles

The reason is simple: the edges of the T triangles shared with the K triangles count as a unique pair containing the central point. Therefore, it shares exactly three pairs, as desired. Note that the configuration is reconstructible even if the K triangles are replaced by any clique of order at least four. \(\square \)

We encounter a similar situation when dealing with \(K_4\) cliques: Fig. 1b shows a clique that may be present in a 2-intersection graph and whose edges do not share a common label. This clique is composed of four intersecting T-triangles. It arises from four vertices of H for which all possible triples occur as hyperedges. So, maintaining the notation introduced for triangles, we denote such a square by S, and we differentiate it from the K-square, i.e., the 4-clique whose edges all have a common label.

Property 2

Let \(C_1\) and \(C_2\) be two cliques of \(I_2(H)\). If \( \mid \! C_1 \cap C_2\! \mid \ge 3\) then \(C_1=C_2\).

Proof

Let \(C=\{v_1,v_2,v_3\} \subseteq C_1\cap C_2\). We proceed by contradiction assuming that there exist two non adjacent vertices \(x\in C_1\) and \(y\in C_2\) such that \(C_1'=C\cup x\) and \(C_2'=C\cup y\) are two different cliques. The following two cases arise (see cases (a) and (b) in Fig. 1).

C is a T-triangle: we suppose w.l.g. \(v_1=\{1,2,3\}\), \(v_2=\{1,2,4\}\), and \(v_3=\{1,3,4\}\). Since \(C_1'\) is a clique, then \(x=\{2,3,4\}\) is the only possibility for x. The same reasoning holds for y, so it follows \(x = y\), against the hypothesis.

C is a K-triangle: we suppose w.l.g. \(v_1=\{1,2,3\}\), \(v_2=\{1,2,4\}\), and \(v_3=\{1,2,5\}\). Both x and y have to contain the pair \(\{1,2\}\), shared by all the elements of C, so there exists an edge joining them, against the hypothesis. \(\square \)

In the proof of Property 2, we note that if C is a K-triangle, then only two of its elements are enough to determine the common pair \(\{1,2\}\), so that:

Corollary 1

Let \(C_1\) and \(C_2\) be two cliques of \(I_2(H)\) not containing any T-triangle. If \(\mid C_1\cap C_2 \mid \ge 2\) then \(C_1=C_2\).

Corollary 2

Let \(C_1\) and \(C_2\) be two (maximal) cliques of \(I_2(H)\). If \(\mid \! C_1\cap C_2\! \mid = 2\), then either \(C_1\) or \(C_2\), but not both, are T-triangles.

We emphasize that, if both \(C_1\) and \(C_2\) are T-triangles such that \(\mid \! C_1\cap C_2 \!\mid = 2\), then they are not maximal, i.e., they form an S-square as in Fig. 1b.

The following example shows that S is the biggest clique that does not admit a common pair in all of its edges.

Example 1

Consider a clique \(K_5\) of a 2-intersection graph. It is not possible to label its vertices without a common pair. In fact, let us start by labelling a vertex with \(\{1,2,3 \}\) (see Fig. 3) and one of its neighbours with \(\{1,2,4\}\). Suppose that we label a third vertex with a pair different from \(\{1,2\}\), say \(\{1,3,4\}\). Then we have only one label possible for the fourth vertex, namely \(\{2,3,4\}\). We observe that there does not exist any label for the fifth vertex, since all possible pairs have been already used. So a labelling of the vertices of \(K_5\) without a common pair is not possible.

Fig. 3
figure 3

The labelling of the clique \(K_5\) used in Example 1

The same argument can be used to prove that any clique of order greater than four has the edges labelled with the same pair of indices. Many other conditions can help to restrict the cases when G is a 2-intersection graph.

Theorem 1

Let G be a graph containing two distinct cliques of order n and m and intersecting in \(2\le i \le \mathrm{min}(m,n)-1\) vertices. Moreover, assume that the condition of Lemma 1 holds. Then the following statements hold:

  1. (i)

    if \(n = 3\) and \(m \ge 3\), then G is reconstructible;

  2. (ii)

    let \(n = 4\) and \(m \ge 4\), then G is reconstructible if and only if \(i = 2\);

  3. (iii)

    if \(n >4\) and \(m > 5\), then G is not reconstructible.

Proof

(i): by hypothesis, \(i = 2\), so the two cliques must intersect in two vertices. From Property 2 and the corollaries, a clique \(K_m\), with \(m \ge 3\) shares a common edge, say with label \(\{x,y\}\), with a T-triangle. We proceed in labelling the three vertices of T by \(\{x,y,z_1\}, \{x,y,z_2\}, \{x,z_1,z_2\}\). Finally, we assign the labels \(\{x,y,z_3\}, \{x,y,z_4\},\dots , \{x,y,z_m\}\) to the remaining vertices of \(K_m\). The labels turn out to be the hyperedges of a 3-hypergraph H on \(\{x,y,z_1,\dots ,z_m\}\) vertices such that \(I_2(H)=G\), as desired.

(ii): from Property 2 and corollaries, if \(i = 2\), then the edge shared by the two cliques must intersect a triangle T. Let T be contained in the first clique whose configuration turns out to be S. The other clique is forced to have a common label of the edges, since it can not contain a second T-triangle. So, a labelling similar to that defined in (i) is allowed, providing a 3-hypergraph whose 2-intersection graph is G.

Finally, the case \(i = 3\) causes the collapse of the two cliques into one single clique.

(iii): consider two cliques of order greater than four. Property 2 states that if they share two or more vertices, then they are the same clique, so G is not a 2-intersection graph. \(\square \)

The above result can be naturally extended to graphs having more than two cliques, by inspecting the intersections between pairs of them. A labelling of the edges and the determination of a 3-hypergraph compatible with them can be performed.

However, there are several classes of graphs that can be immediately detected as 2-intersection graphs due to their topological properties. For them, some simple edge labellings lead to the determination of a related 3-hypergraph. One class is the cycle graphs, i.e. a sequence of consecutive 2-cliques.

First, we observe that a cycle of length k admits a labelling involving k integer indices at most. In fact, we start by labelling a randomly chosen vertex \(v_1\) with \(\{1,2,3\}\), then we visit the remaining vertices \(v_2, \dots , v_k\) of the cycle according to a chosen direction and we label the \(i^{\mathrm{th}}\) one, where \(1<i<k-1\), with \(\{i,i+1,i+2\}\), so that \(\{i,i+1\}\) is the pair shared by \(v_{i-1}\) and \(v_i\), i.e., the label of the edge joining them. Finally, vertices \(v_{k-1}\) and \(v_k\) are labelled with \(\{1,k,k+1\}\) and \(\{1,2,k\}\), respectively. An example is shown in Fig. 4.

Note that the labelling of the first \(k-1\) vertices of the cycle defined above can be used to label a path of length \(k-1\) involving k integer indices.

Fig. 4
figure 4

The labelling of a cycle of length 6

4 Computational Complexity of 2-Intersection Property

In this section it is shown that it is NP-complete to determine whether an arbitrary graph G is the 2-intersection graph of a 3-hypergraph. We refer to this problem as then 2INT problem. Note that is clear that 2INT is in NP. We reduce from the following variant of the 3-SAT problem (L02 in [11])

MAX-3-SAT:

Instance: a set U of variables and a set C of clauses over U such that each clause \(c\in C\) has \(\mid \! c\!\mid =3\) literals, where a literal corresponding to a variable x is either x or \(\overline{x}\). Each variable, as represented by a literal, appears at most three times in the clauses. Furthermore, no three occurrences of a variable are the same literal.

Question: Is there a satisfying truth assignment for C?

First of all, we prove that this problem is NP-complete.

Lemma 2

MAX-3-SAT is NP-complete.

Proof

We reduce 3-SAT to MAX-3-SAT. Consider an instance of 3-SAT, in which a variable x appears k times, either as x or \(\overline{x}\). Replace the first instance with \(x_1\), the second with \(x_2\) and so on up to \(x_k\) (possibly the complements). Then add \(\left( \overline{x}_1 \vee x_2 \right) \wedge \left( \overline{x}_2 \vee x_3 \right) \ldots \left( \overline{x}_k \vee x_1 \right) \). This ensures that either all \(x_i\) are true, or all are false. Note that each \(x_i\) has two literals occurring in this expression, and one more literal occurring in the clauses of 3-SAT, providing a total of three occurrences.

Acting similarly for the remaining literals, when needed, we obtain an instance of 3-SAT, where each variable appears at most three times, all of them not the same literal. \(\square \)

Given an instance C of MAX-3-SAT, we construct a graph \(G_C\) so that there is a solution of the MAX-3-SAT instance if and only if \(G_C\) is a 2-intersection graph. This will imply that 2INT is NP-complete. We remark that each solution of C will be achieved by one of the possible labellings of \(G_C\) that determines a 3-hypergraph H such that \(G=I_2(H)\).

To achieve the objective, we need to define some graph configurations that have the 2-intersection property and that are useful to model variables and clauses of 3-SAT. Each vertex of a 2-intersection graph G corresponds to a hyperedge of its related hypergraph H. So each vertex v of G contains three vertices of H. In order to avoid confusion with the use of the word vertex, we will use the term indices for the vertices of H contained in a vertex of G. When a hypergraph H is constructed from a 2-intersection graph G, by assigning indices to the vertices of G, we say that a label is assigned to v, eg., we assign \(\{1,2,4\}\) as the label of a vertex of G. In the following properties, we consider subgraphs of G determined by triangles, and show that when G is a 2-intersection graph, the labels of G have to satisfy certain requirements, i.e., local properties of G extend to properties of H.

Property 3

If two triangles intersecting in one vertex have the 2-intersection property, and there are no edges joining the triangles, then they are not T-triangles both.

Proof

Observe that the three vertices of a T-triangle use just four different indices from H. If the two triangles are T-triangles, then the common vertex has to share four different pairs of indices with the four adjacent vertices, and this is not possible (see Fig. 5). \(\square \)

We will call two triangles sharing one vertex, with no edges between them, a ribbon configuration. Figure 5 shows the labels of two one-vertex intersecting triangles when at least one of them is a K-triangle.

Fig. 5
figure 5

Two possible labels of a ribbon configuration. In each of them at most one triangle is a T-triangle

Property 4

Let \(T_1\) and \(T_2\) be two triangular cliques. Suppose there are just two edges joining a vertex of \(T_1\) to a vertex of \(T_2\), without common endpoints. Then the obtained configuration has the 2-intersection property. Furthermore, \(T_1\) and \(T_2\) cannot both be T-triangles.

Proof

Let \(x_1\) and \(y_1\) be the vertices of \(T_1\) adjacent to the vertices \(x_2\), and \(y_2\) of \(T_2\) by the edges \(e_x\) and \(e_y\), respectively. We first show that that \(T_1\) and \(T_2\) cannot be both T-triangles. Suppose, w.l.g., that \(T_1\) is a T-triangle whose vertices have labels \(x_1=\{1,2,3\}\), \(y_1=\{2,3,4\}\), and \(z_1=\{1,2,4\}\) (see Fig. 6). Since \(x_2\) is adjacent to only \(x_1\) in \(T_1\), then the label of \(e_x\) must be \(\{1,3\}\). With the same argument, the label of \(e_y\) is \(\{3,4\}\). Since \(x_2\) and \(y_2\) belong to \(T_2\), they have a common pair of labels, say \(\{3,5\}\). So their labels must be \(x_2=\{1,3,5\}\) and \(y_2=\{3,4,5\}\). If we assume \(T_2\) to be a T-triangle, then \(z_2=\{1,4,5\}\). This leads to a contradiction since \(z_2\) is not adjacent to \(z_1=\{1,2,4\}\). Therefore the only possible label is \(z_2=\{3,5,6\}\), showing that \(T_2\) is a K-triangle.

To show that \(T_1\) and \(T_2\) can both be K-triangles, we set \(x_2=\{1,3,5\}\) and \(y_2=\{3,4,5\}\) and \(z_2=\{3,5,6\}\) in \(T_2\) (see Fig. 6). We can then take \(x_1=\{1,2,3\}\), \(y_1=\{2,3,4\}\) and \(z_1=\{2,3,7\}\) in \(T_1\). \(\square \)

Fig. 6
figure 6

The configuration obtained by two triangles with joined by two edges. One possible labelling is shown

Fig. 7
figure 7

The graph \(G_x\). It is used to model the occurrences of the literals x and \(\overline{x}\) in the clauses of an instance of MAX-3-SAT. The two parts \(G^1_x\) and \(G_x^2\) are indicated together with their connection through a ribbon configuration

4.1 Representing the Variables of U

Define a variable gadget, denoted \(G_{x}\), to represent a variable x in U. The gadget is a 2-intersection graph obtained by the union of different configurations and its definition can be checked in Fig. 7.

The graph \(G_{x}\) consists of two gadgets \(G_x^1\) and \(G_x^2\) that grow around two \(K_5\) cliques \(C_1\) and \(C_2\) that are connected by a ribbon configuration, say R.

The gadget \(G_x^1\) includes the clique \(C_1\) whose vertices are in common with five different \(K_3\) triangular cliques, counter-clockwise denoted by \(T_i^1\), with \(1\le i \le 5\), and starting from the triangle facing the ribbon that joins the two gadgets. These triangles are then connected in pairs by their two remaining free vertices, forming a 10-cycle, as shown in Fig. 7.

The triangles \(T^1_2\) and \(T_5^1\) will be associated with the two (at most) occurrences of the variable x, while \(T^2_3\) will be associated with the single occurrence of the variable \(\overline{x}\).

We show that the graph \(G_x\) has the 2-intersection property. Furthermore, it allows very few possibilities when setting the triangles as K or T.

Property 5

The variable gadget \(G_x\) is a 2-intersection graph.

In Figs. 8 and 9 we provide samples of labellings of \(G_x\).

Corollary 3

A labelling of the vertices of the graph \(G_x\) only produces the following possible types (K or T) of the triangles \(T_2^1\), \(T_5^1\) and \(T^2_3\):

  1. i)

    if \(T_3^2=T\) then \(T_2^1=T_5^1=K\);

  2. ii)

    if \(T_5^1=T\) (resp. \(T_2^1=T\)) then \(T_3^2=K\).

Fig. 8
figure 8

One of the labellings of \(G_x\) related to case i) of Corollary 3. The starting triangle \(T_3^2=T\) is shaded. The type (T or K) of each triangle is also shown

Fig. 9
figure 9

One of the labellings of \(G_x\) related to case ii) of Corollary 3. The starting triangle \(T_3^2=T\) is shaded. The type (T or K) of each triangle is also shown

Proof

i) let us assume \(T_3^2=T\). Property 4 assures that triangle \(T_1^2\) is a K-triangle. So, by Corollary 2, the triangle adjacent to \(T_1^2\) is a T-triangle, and the triangle adjacent to \(T_1^1\) is a K-triangle by Property 3. Continuing with the configurations, we get \(T_1^1=T\), and, again by Property 4, we obtain that both \(T_2^1\) and \(T_5^1\) are K-triangles as desired (see a possible labelling in Fig. 8).

ii) let us assume \(T_5^1=T\) (resp. \(T_2^1=T\)). Property 4 assures that \(T_1^1=K\). So, by Corollary 2, the triangle adjacent to \(T_1^1\) is a T-triangle, and the triangle adjacent to \(T_1^1\) is a K-triangle by Property 3, and finally \(T_1^2=T\). Again Property 4 assures that \(T_3^2\) is a K-triangle as desired (see a possible labelling in Fig. 9). \(\square \)

Remark 1

We point out that in case ii) of Corollary 3 no assumption involves the type of \(T_2^1\), that can be either T or K, when \(T_5^1=T\) and vice versa. Figure 9 shows an example of a labelling where \(T_1^2=K\). An easy check reveals that exchanging the types K and T between \(T_1^3\) and \(T_1^2\) produces a new admissible labelling.

4.2 Representing the Clauses of U

The clause gadget \(G_{c}\), represents a single clause \(c\in C\). It consists of a central clique \(K_6\) whose vertices also belong to six different \(K_3\) cliques, called boundary triangles, as shown in Fig. 10. The boundary triangles are then connected in pairs via the two remaining free vertices, as shown in Fig. 12, forming a 12-cycle. In order to have the 2-intersection property, the clause gadget admits a maximum number of T-triangles among the six boundary ones, as stated in the following

Fig. 10
figure 10

The clause gadget \(G_c\) with its triangles. By Property 4 no more that three T-triangles are allowed in the boundary

Lemma 3

A clause gadget \(G_c\) is a 2-intersection graph if and only if the boundary triangles do not contain either exactly three or exactly one T-triangles.

Proof

W.l.g. let \(T_1, \dots , T_6\) be the boundary triangles (labelled counter-clockwise) of a clause gadget. Without loss of generality, let \(T_i\) have vertices \(\{x_i,y_i,z_i\}\), such that \(x_i\) is in common with the central clique \(K_6\), while \(y_i\) and \(z_i\) connect \(T_i\) with the neighbour triangles \(T_{i-1}\) and \(T_{i+1}\). Note that the indices \(i-1\) and \(i+1\) are reduced to the range \(1 \dots 6\). We first show that there is no labelling when three (non consecutive, according with Property 4) boundary triangles are T-triangles. Let \(T_1\), \(T_3\) and \(T_5\) be T-triangles that alternate with three K-triangles \(T_2\), \(T_4\) and \(T_6\). We show that such a configuration does not have the 2-intersection property, i.e., it does not allow any labelling. Assume that the edges of the central clique \(K_6\) have the common label \(\{ 1,2 \}\). Therefore, label every vertex \(\{x_1,\dots , x_6 \}\) of \(K_6\) with \(\{ 1,2,i\}\), with \(3\le i \le 8\), respectively, and let \(x_1\) belong to a T-triangle.

W.l.g, its two remaining vertices have labels \(y_1=\{1,3,9\}\) and \(z_1=\{2,3,9\}\). Suppose \(T_1\) is connected by the edges \((y_1,y_2)\) and \((z_1,z_6)\) with the triangles \(T_2\) and \(T_6\), respectively. So, the edge \(\{y_1,y_2\}\) has label \(\{1,9\}\), and the edge \(\{z_1,z_6\}\) has label \(\{2,9\}\) (check the labelling in Fig. 11, left graph).

So, the labels \(y_2=\{1,8,9\}\) and \(z_6=\{2,4,9\}\) are determined. Since \(T_2\) is a K-triangle, the label of \(z_2\) requires the introduction of a new index, i.e., \(z_2=\{1,8,10\}\). The same holds in \(T_6\), where the label \(y_6=\{2,4,11\}\) can be assumed.

Continuing labelling the boundary triangles, we observe that the edge \(\{z_2,z_3\}\) has two possible labels remaining, i.e., either \(\{1,10\}\) or \(\{8,10\}\). Since \(T_3\) is a T-triangle, then \(z_3\) has either label \(\{1,7,10\}\) or \(\{2,7,10\}\); the first one only being compatible with one of the possible labels of the edge \(\{z_2,z_3\}\). As a consequence, \(y_3=\{2,7,10\}\).

Acting similarly on the T-triangle \(T_5\), we get \(y_5=\{2,5,11\}\) and \(z_5=\{1,5,11\}\).

Finally, a problem occurs in the labelling of the K-triangle \(T_4\): the edges \(\{z_3,z_4\}\) and \(\{y_4,y_5\}\) have labels \(\{2,10\}\) and \(\{1,11\}\), respectively, preventing any connection between the vertices \(y_5\) and \(z_5\).

A similar reasoning reveals that the presence of exactly one boundary T-triangle does not allow a labelling of the clause gadget. The failure of a labelling in this case is shown in Fig. 11, right (\(T_1\) is the T-triangle). \(\square \)

Fig. 11
figure 11

An attempt to define a labelling of a clause gadget with three (on the left) or one (on the right) boundary T-triangles. Both configurations prevent any labelling of the K-triangle \(T_4\)

Finally, Fig. 12 shows the possible labellings when either two or no T-triangles are present as boundary triangles.

Fig. 12
figure 12

Reconstruction in the case of zero or two T-triangles. The bold triangles are the boundary triangles

4.3 The Final NP-Completeness Reduction

Let us consider the instance \(C=\{c_1,\dots , c_n \}\) of MAX-3-SAT involving the variables in the set \(U=\{x_1,\dots x_m\}\). Based on the gadgets already defined, we construct a graph \(G_C\) whose labels determine its 2-intersection property and express the desired valuations of C. The reader can follow an example of the construction of \(G_C\) in the case \(C= \left( x_1\vee \overline{x}_1\vee x_2\right) \wedge \left( x_1\vee x_2\vee \overline{x}_3 \right) \) in Fig. 13.

First, from Lemma 2, we can suppose that each variable must appear at most three times: one in a form and two in the opposite form. For each variable \(x_i\in U\), we define a variable gadget \(G_{x_i}\), and associate the triangle \(T_3^2\) with the single occurrences of a literal \(x_i\). The at-most-two remaining occurrences of the opposite literal are associated with the triangles \(T_2^1\) and \(T^1_5\).

For each clause \(c_j\in C\), we construct a clause gadget \(G_{c_j}\) and label its boundary triangles \(T_1 \dots T_6\) as in Lemma 3.

Finally, we connect variable gadgets and clause gadgets together as follows: for each clause \(c_j\), with \(1\le j \le n\), we use a ribbon to the triangle \(T_{2i-1}\) of the clause gadget \(G_c\), to the corresponding triangle associated with the \(i^{\mathrm{th}}\) literal of c in the \(G_x\) gadget of its variable, as in Fig. 13.

Now, we prove the main theorem of this section.

Lemma 4

Given an instance C of MAX-3-SAT, the graph \(G_C\) has the 2-intersection property if and only if the instance C has a solution.

Fig. 13
figure 13

Example of the construction of the gadget for \(C =\{c_1,c_2\}\), \(c_1=\left( x_3,x_1,\overline{x}_1\right) \), \(c_2=\left( \overline{x}_1,\overline{x_3},x_2\right) \). One of the valuations obtained by the labelling of the corresponding \(G_C\) graph is \(x_1={ true}\), \(x_2={ true}\) and \(x_3={ true}\). The valuation can be obtained by the position of (at least one of) the T configurations in the triangles \(T_2^1\), \(T^1_5\) and \(T_3^2\) of the variable gadget

Proof

Let us assume that there exists a valuation for the MAX-3-SAT instance C. Given a variable \(x\in U\), for each literal with value true associated with x, we assign the triangles associated with it to be T-triangles, and we assign the triangles associated with its negation to be K-triangles. Corollary 3 assures that the variable gadget \(G_x\) has a labelling. Then, for each clause \(c_j \in C\), in its clause gadget \(G_{c_j}\), we assign the triangles associated with the literals having valuation true to be K-triangles, but T-triangles for the literals having valuation false. Since three or more T-triangles are not allowed in \(G_{c_j}\) by Lemma 3, then also the clause gadget has a labelling. The labelling of the connecting ribbons is straightforward. The reader can benefit from an example of such a construction in Fig. 13.

On the other hand, suppose \(G_C\) has the 2-intersection property, i.e., there is a labelling of \(G_C\) that determines a 3-hypergraph H such that \(I_2(H)=G_C\). For each clause gadget \(G_{c_j}\), with \(c_j\in C\), there exists at least one triangle among \(T_1\), \(T_3\) and \(T_5\), say \(T'\) of type K, by Lemma 3. Property 3 assures that \(T'\) having type K leads to a T-triangle in the variable gadget \(G_x\) to which a literal, say l, is associated (note that the opposite does not hold, as shown by the red triangle in Fig. 13). We assign such a literal the truth value true. The opposite literal \(\overline{l}\) is then associated with false. Due to Corollary 3 the triangles (one or two) in \(G_x\) associated with \(\overline{l}\) are of type K.

We emphasize the following situation: it may happen that there exists a \(G_x\) labelling where all three triangles associated with the literals are of type K. In such a case, the value assigned to the variable does not affect the truth value of the clauses of C, so it can be arbitrarily assigned.

So, the valuation defined is a solution of the MAX-3-SAT instance C: each clause gadget \(G_{c_j}\) has at most one triangle among \(T_1\), \(T_3\) and \(T_5\) of type K, so at least one literal in the clause has value true. Furthermore, in each variable gadget, if one literal is set to true, i.e. at least one of the corresponding triangles is of type T, then the the opposite literal has the logical value false. \(\square \)

Theorem 2

The 2INT Problem is NP-complete.

The proof directly follows from Lemma 4.3, after checking that the construction of the graph \(G_C\) associated with the instance C can be performed in polynomial time.

Remark 2

In Fig. 13, the two highlighted triangles in different colors indicate the following situation:

  • the red triangle in the ribbon connecting \(T_1\) of \(G_{c_1}\) to \(T_2^1\) of \(G_{x_3}\) shows that the T-triangle related to the value false in a clause may produce the truth value true in the associated literal. This is not a contradiction: it simply means that in the clause, here \(c_1\), there exists at least a second triangle of type K, i.e. the clause is already satisfied by at least one different literal;

  • the blue triangle \(T_1^5\) in \(G_{x_2}\) is of type K which is different from the T-triangle \(T^1_2\) although they are associated with the same literal l. This means that l may have a value false in a second clause in which it is possibly present. As a consequence, a different literal having truth value true is present in that clause. What is relevant in \(G_{x_2}\) is that the triangle associated with \(\overline{l}\), i.e. \(T_3^2\), has to be of type K, assuring that \(\overline{l}\) has truth value false in all its occurrences.

Example 2

Consider the formula \(F = \left( x_1\vee \overline{x}_1\vee x_3\right) \wedge \left( \overline{x}_1\vee x_2\vee \overline{x}_3 \right) \). Figure 13 shows the construction of its corresponding gadget. The labelling shown in the same figure corresponds to the valuation \(x_1 =\) false, \(x_3 =\) false. The value of \(x_2\) doesn’t matter since, in any case, the assignment is a solution for F.