1 Introduction

The notion of graph functionality provides a common generalisation for various graph parameters, such as maximum vertex degree, degeneracy, clique-width and twin-width, in the sense that boundedness of any of these parameters implies bounded functionality, but not necessarily vice versa. Originally, this notion appeared in an implicit form in [2] in the context of graph representation. A formal definition of graph functionality was introduced in [1], where boundedness or unboundedness of functionality was shown for a variety of graph classes. In particular, it was proved in [1] that functionality is bounded for permutation graphs, line graphs and unit interval graphs. However, the question of boundedness or unboundedness of functionality in the entire class of interval graphs was left open in [1]. In the present paper we answer this question by showing that the functionality of any interval graph is at most 8.

We observe that interval graphs are precisely box intersection graphs in \(\mathbb {R}^1\) (all definitions can be found in Sect. 2). This observation, together with our result for interval graphs, naturally leads to the question of boundedness or unboundedness of functionality for box intersection graphs in \(\mathbb {R}^d\) for \(d>1\). We answer this question for \(d\ge 3\) by showing that in this case the functionality is unbounded.

We also observe that the result for unit interval graphs proved in [1] is, in fact, stronger than showing boundedness of functionality in this class. The result deals with a restricted version of functionality called symmetric difference. This parameter is intermediate between twin-width and functionality in the sense that bounded twin-width implies bounded symmetric difference, which in turn implies bounded functionality, but neither of the reverse implications is valid in general. The result in [1] proves bounded symmetric difference for unit interval graphs. In the present paper, we show that this result cannot be extended to interval graphs by providing an explicit construction of interval graphs of unbounded symmetric difference (and hence of unbounded twin-width). Finally, we show that boundedness of symmetric difference in the class of unit interval graphs, i.e. unit box intersection graphs in \(\mathbb {R}^1\), cannot be extended to unit box intersection graphs in \(\mathbb {R}^2\). However, functionality of unit box intersection graphs in \(\mathbb {R}^2\) remains a challenging open question.

The organisation of the paper is as follows. All definitions and notations related to the topic of the paper can be found in Sect. 2.

In Sect. 3 we show that the functionality of any interval graph is at most 8. Then, in Sect. 4 we prove that the functionality of box intersection graphs in \(\mathbb {R}^3\) is unbounded. Finally, in Sect. 5 we focus on the symmetric difference and show that this parameter is unbounded both for interval graphs and for unit box intersections graphs in \(\mathbb {R}^2\). Our proofs are constructive and describe explicitly families of graphs of unbounded symmetric difference, and hence of unbounded twin-width and clique-width. Section 6 concludes the paper with a number of open questions.

2 Preliminaries

For a positive integer k, we denote by [k] the set \(\{1,\ldots , k\}\). All graphs in this paper are finite, undirected, without loops and multiple edges. The vertex set and the edge set of a graph G are denoted V(G) and E(G), respectively. The neighbourhood of a vertex \(x\in V(G)\), denoted N(x), is the set of vertices of G adjacent to x, and the degree of x, denoted \(\deg (x)\), is the size of its neighbourhood. We denote by N[x] the closed neighbourhood of x, that is, the set \(N(x)\cup \{x\}\). Two vertices x and y are twins if \(N(x)\setminus \{y\}=N(y)\setminus \{x\}\), or, equivalently, if \(N[x]\setminus \{x,y\}=N[y]\setminus \{x,y\}\). The minimum vertex degree and the maximum vertex degree in G are denoted by \(\delta (G)\) and \(\Delta (G)\), respectively.

Let G be a graph and \(A=A_G\) the adjacency matrix of G. We say that a vertex \(y\in V(G)\) is a function of vertices \(x_1,x_2,\ldots ,x_k\in V(G) \setminus \{y\}\) if there is a Boolean function f of k variables such that for every vertex \(z\in V(G)\) different from \(y,x_1,x_2,\ldots ,x_k\) we have \(A(y,z)=f(A(y,x_1),\ldots ,A(y,x_k))\). We observe that every vertex is a function of some other vertices. In particular, every vertex is a function of its neighbours, for the function \(f\equiv 0\), and a function of its non-neighbours, for the function \(f\equiv 1\). The minimum k such that y is a function of k other vertices is the functionality of y and is denoted \(\textrm{fun}_G(y)\), or simply \(\textrm{fun}(y)\) if the graph is clear from the context. The functionality of G is denoted and defined as follows:

$$\begin{aligned} \texttt{fun}(G)=\max _H \min _{y\in V(H)} \textrm{fun}(y), \end{aligned}$$

where the maximum is taken over all induced subgraphs H of G. If in this definition we replace \(\textrm{fun}(y)\) with \(\deg (y)\), then we obtain the definition of degeneracy. Together with the observation that \(\textrm{fun}(y)\le \deg (y)\), we conclude that functionality of a graph is always bounded from above by its degeneracy. In particular, bounded degeneracy implies bounded functionality. Similarly, boundedness of some other graph parameters implies bounded functionality. For clique-width, this was proved in [1] by showing that in any graph of bounded clique-width, there must exist two vertices whose neighbourhoods have small symmetric difference. This motivates the study of one more graph parameter, implicitly introduced in [2], and called the symmetric difference of a graph in [1].

Given a graph G and a pair of vertices xy in G, let \(\textrm{sd}_G(x,y)\) (or simply \(\textrm{sd}(x,y)\) if the graph is clear from the context) be the number of vertices different from x and y that are adjacent to exactly one of x and y. In other words, if x and y are non-adjacent, then \(\textrm{sd}(x,y)\) is the size of the symmetric difference of N(x) and N(y), and if x and y are adjacent, then \(\textrm{sd}(x,y)\) is the size of the symmetric difference of N[x] and N[y]. Then, the symmetric difference of G is denoted by \(\texttt{sd}(G)\) and defined to be 0 if G is a single-vertex graph, and otherwise

$$\begin{aligned} \texttt{sd}(G) = \max _H \min _{\begin{array}{c} x,y\in V(H)\\ x\ne y \end{array}} \textrm{sd}(x,y), \end{aligned}$$

where the maximum is taken over all induced subgraphs H of G with at least two vertices.

If x and y are twins, then \(\textrm{sd}(x,y)=0\) and the functionality of both vertices is at most 1, i.e. x and y are functions of each other. More generally, any two vertices x and y are functions of each other and of the vertices distinguishing them, i.e. \(\textrm{fun}(x)\le \textrm{sd}(x,y)+1\) and \(\textrm{fun}(y)\le \textrm{sd}(x,y)+1\).Footnote 1 The above discussion shows that symmetric difference is a parameter intermediate between clique-width and functionality in the sense that bounded clique-width implies bounded symmetric difference, which in turn implies bounded functionality.

The recently introduced parameter twin-width [6] lies strictly between clique-width and symmetric difference, i.e. bounded clique-width implies bounded twin-width, which in turn implies bounded symmetric difference. Therefore, any construction of graphs of unbounded (i.e. arbitrarily large) symmetric difference is also of unbounded twin-width and clique-width.

In the present paper, we study functionality and symmetric difference of box intersection graphs.

Definition 2.1

A box in \(\mathbb {R}^d\) is a solid d-dimensional rectangle with axis-parallel sides. A unit box is a box with all sides of length 1. A graph G is a box intersection graph in \(\mathbb {R}^d\) (resp., a unit box intersection graph in \(\mathbb {R}^d\)) if each vertex of G can be associated with a box (resp., a unit box) in \(\mathbb {R}^d\) so that two vertices of G are adjacent if and only if the corresponding boxes intersect.

Box intersection graphs in \(\mathbb {R}^1\) are known as interval graphs, i.e. intersection graphs of intervals on the real line.

3 Functionality of Interval Graphs is Bounded

Let G be an interval graph with n vertices given together with an interval representation. Without loss of generality we assume that the endpoints of the intervals are pairwise distinct. This allows us to label the endpoints of the intervals by numbers from 1 to 2n consecutively from left to right, and to represent each interval (vertex of G) by a pair of numbers (ij), where i is the left endpoint and j is the right endpoint of the interval (and thus \(i<j\)). We can therefore represent each interval (vertex of G) by a point in \(\mathbb {N}^2\) above the diagonal \(\{(i,i)\mid 1\le i\le n\}\).

We denote the vertex of G corresponding to the point (ij) by \(v_{i,j}\). The Manhattan distance between two points (ij) and (pq) in \(\mathbb {N}^2\) is \(|i-p|+|j-q|\). We also define the horizontal distance between (ij) and (pq) to be \(|i-p|\), and the vertical distance between (ij) and (pq) to be \(|j-q|\).

Lemma 3.1

If the Manhattan distance between two points (ij) and (pq) is k, then the symmetric difference of \(v_{i,j}\) and \(v_{p,q}\) is at most \(k-2\).

Proof

It is easy to check that if a vertex \(v_{s,t}\) is in the symmetric difference of the neighbourhoods of \(v_{i,j}\) and \(v_{p,q}\) and different from the two vertices, then one of the endpoints of (st) belongs to the interval \((\min \{i,p\}, \max \{i,p\})\) or to the interval \((\min \{j,q\}, \max \{j,q\})\). Since the endpoints of all intervals are pairwise distinct and the Manhattan distance between (ij) and (pq) is k, there could be at most \(k-2\) possible vertices \(v_{s,t}\) satisfying this property. \(\square \)

Theorem 3.2

The functionality of any interval graph is at most 8.

Proof

Since the class of interval graphs is hereditary, to prove the theorem it suffices to show that each interval graph contains a vertex of functionality at most 8.

Let G be an interval graph. We use a representation of G by points in \(\mathbb {N}^2\) that has been described in the beginning of the section. All points representing the vertices of G are located above the diagonal in the \([2n]\times [2n]\) area of the integer grid. Each vertical line and each horizontal line in this area contains at most one vertex of G. We split the 2n horizontal lines in this area into \(\lceil 2n/5 \rceil \) stripes, each containing 5 consecutive lines, except possibly one stripe containing at most 4 consecutive lines if 2n is not a multiple of 5. Similarly, we split vertical lines into \(\lceil 2n/5 \rceil \) stripes. The intersection of a horizontal stripe and a vertical stripe will be called a block.

Assume first that there is a block containing two vertices of G. Then the Manhattan distance between these two vertices is at most 8 and hence, according to Lemma 3.1, the symmetric difference of these two vertices is at most 6, implying that the functionality of each of them is at most 7.

From now on, we assume that each block contains at most one vertex of G. We call blocks containing no vertex of G empty. To find a vertex of low functionality, let us start by considering the case when there exist two consecutive horizontal lines, say \(L_\textsf{h}\) and \(L'_\textsf{h}\), and two consecutive vertical lines, say \(L_\textsf{v}\) and \(L'_\textsf{v}\), such that

  • one of the four points in the intersections of these lines (that is, \(L_\textsf{h}\cap L_\textsf{v}\), \(L_\textsf{h}\cap L'_\textsf{v}\), \(L'_\textsf{h}\cap L_\textsf{v}\), and \(L'_\textsf{h}\cap L'_\textsf{v}\)) is a vertex of G, say vertex \(x\in L_\textsf{h}\cap L_\textsf{v}\),

  • there is a vertex of G above x in the other vertical line \(L'_\textsf{v}\), say vertex y,

  • there is a vertex of G to the left of x in the other horizontal line \(L'_\textsf{h}\), say vertex z.

In this case, we claim that x is a function of y and z. More precisely, a vertex \(v\in V(G)\setminus \{x,y,z\}\) is adjacent to x if and only if \(A(v,y)= A(v,z)=1\), where A is the adjacency matrix of G. Indeed, by construction the four lines contain vertices xyz only, and any other vertex v is either adjacent to x, in which case it is also adjacent to both y and z, or non-adjacent to x, in which case it is non-adjacent to at least one of y or z.

The requirement that the two vertical lines and the two horizontal lines are consecutive can be relaxed by asking that x and y are of bounded horizontal distance from each other, while x and z are of bounded vertical distance from each other, say both distances are at most k, i.e. there are at most \(k-1\) vertical lines between x and y and at most \(k-1\) horizontal lines between x and z. Then the vertical lines between x and y contain at most \(k-1\) vertices \(y_1,\ldots , y_{k-1}\) and the horizontal lines between x and z contain at most \(k-1\) vertices \(z_1,\ldots , z_{k-1}\). In this case, x is a function of \(y, y_1,\ldots ,y_{k-1},z,z_1,\ldots ,z_{k-1}\) for the same reason as above. The only difference is that \(y_1,\ldots ,y_{k-1},z_1,\ldots ,z_{k-1}\) are inessential variables of the function, i.e. the function does not depend on them.

To find a vertex x satisfying the above conditions, we introduce the following terminology. The leftmost non-empty block in any horizontal stripe and the topmost non-empty block in any vertical stripe will be called marginal blocks.

Let B be a non-empty block and let x be the only vertex of G that belongs to B. If B is not marginal, then there is a vertex y above x in the same vertical stripe and a vertex z to the left of x in the same horizontal stripe. In this case, x is a function of y and z and at most 3 vertices in the vertical lines between x and y and at most 3 vertices in the horizontal lines between x and z, i.e. the functionality of x is at most 8.

It remains to show that a non-empty non-marginal block does exist. Each horizontal stripe contains at most one marginal block and each vertical stripe contains at most one marginal block. Therefore, there are at most \(2 \lceil 2n/5 \rceil \) marginal blocks. Since the total number of non-empty blocks is exactly n, and \(n> 2 \lceil 2n/5 \rceil \) holds for any \(n\ge 9\), we conclude that there is at least one non-empty non-marginal block and hence a vertex of functionality at most 8 for all \(n\ge 9\). In graphs with at most 8 vertices, the functionality of each vertex is at most 7. \(\square \)

4 Functionality of Box Intersection Graphs in \(\mathbb {R}^3\) is Unbounded

Having proved boundedness of functionality for interval graphs, i.e. for box intersection graphs in \(\mathbb {R}^1\), it is natural to ask whether this parameter is bounded for box intersection graphs in \(\mathbb {R}^d\) for larger values of d. In the present section, we answer this question in the negative for \(d\ge 3\). We start with a helpful lemma, where \(K_{n,m}\) stands for the complete bipartite graph with parts of size n and m.

Lemma 4.1

Let \(p \ge 2\) be an integer and let X be a class of \(K_{2,p}\)-free triangle-free graphs such that there exists an increasing function \(g: \mathbb {N} \rightarrow \mathbb {N}\), and an infinite sequence of graphs \(G_1, G_2, \ldots \) in X with \(|V(G_n)| = g(n)\) such that \(a(n):= \delta (G_n)\) is in \(\omega (1)\) and \(b(n):= \Delta (G_n)\) is in o(g(n)). Then X has unbounded functionality.

Proof

Suppose towards a contradiction that X and \((G_n)_{n \in \mathbb {N}}\) is a class and a sequence, respectively, as in the statement of the lemma, but X has functionality bounded by k for some constant k.

Let n be a large enough integer such that

$$\begin{aligned}\delta (G_n) \ge kp+1\quad \quad \quad \text { and }\quad \quad \quad \Delta (G_n) \le \frac{g(n)-k-2}{k+1}.\end{aligned}$$

Such an n exists by the assumption on the functions a and b. By assumption, there exist vertices \(x, y_1, y_2, \ldots , y_k \in V(G_n)\) such that x is a function of \(y_1, y_2, \ldots , y_k\). To prove the lemma it is enough to find a pair of vertices uw distinct from \(x,y_1,y_2, \ldots , y_k\) such that u is adjacent to x, w is not adjacent to x, but uw are not distinguished by \(y_1, y_2, \ldots , y_k\) (i.e. u and w have the same neighbourhood in \(\{ y_1, y_2, \ldots , y_k \}\)). Indeed, this will contradict the assumption that x is a function of \(y_1, y_2, \ldots , y_k\).

First, note that since \(G_n\) is \(K_{2,p}\)-free and triangle-free, x has at most \(p-1\) neighbours in common with \(y_i\) for every \(i \in [k]\). Thus, from \(\deg (x) \ge kp+1\) we conclude that there exists a neighbour u of x that is distinct from \(y_1, \ldots , y_k\) and is not adjacent to any of these vertices. On the other hand, from \(\Delta (G_n)\le \frac{g(n)-k-2}{k+1}\), we conclude that there exists a vertex w that is distinct from \(x, y_1, \ldots , y_k\) and adjacent to none of them. \(\square \)

We denote by \(Q_n\) the n-dimensional hypercube, and by \(\mathcal {Q}\) the hereditary closure of hypercubes, that is, the class of all induced subgraphs of hypercubes. As a corollary of Lemma 4.1 we recover a result from [1].

Corollary 4.2

The class \(\mathcal {Q}\) has unbounded functionality.

Proof

The corollary follows by applying Lemma 4.1 to the sequence \(Q_1, Q_2, Q_3, \ldots \). Indeed, every graph in \(\mathcal {Q}\) is \(K_{2,3}\)-free [8], and the functions \(a(n) = b(n) = \log g(n)\), where \(g(n) = 2^n\), satisfy the conditions of Lemma 4.1. \(\square \)

A bipartite graph \(G=(P,B,E)\) is a point-box incidence graph if the vertices in P (which we call point-vertices) can be associated with points in the Euclidean plane (\(\mathbb {R}^2\)) and the vertices in B (which we call box-vertices) can be associated with boxes in the plane so that \(p \in P\) and \(b \in B\) are adjacent if and only if the box associated with b contains the point associated with p.

Lemma 4.3

The class of point-box incidence graphs has unbounded functionality.

Proof

To prove the lemma we will show that there is a sequence of point-box incidence graphs \((G_n)_{n \in \mathbb {N}}\) that satisfies the conditions of Lemma 4.1.

We will use the construction presented in [4] (see Proposition 3.5 and Lemma 3.3) that was used to show the existence of \(K_{2,2}\)-free point-box incidence graphs with superlinear number of edges. The minimum and the maximum degrees of the vertices, which are important for applications of Lemma 4.1, were not analysed explicitly in [4]. In order to do this, below we describe the construction in graph theoretic terms, from which we can easily infer the minimum and the maximum degrees of the graphs.

Let n be a positive integer. We define \(H^{n}_1:= (P_1, B_1, E_1)\) to be the star \(K_{1,n}\) with the central vertex in \(B_1\) and n leaves in \(P_1\). For every \(i = 2,\ldots ,n\), we define \(H^{n}_i\) inductively as follows. The graph \(H^{n}_i=(P_i,B_i, E_i)\) is obtained by taking n vertex-disjoint copies of \(H^{n}_{i-1}\), adding \(|P_{i-1}|\) box-vertices to \(B_i\), and adding a perfect matching between these vertices and the point-vertices of each of the copies of \(H^{n}_{i-1}\).Footnote 2 Notice that, if \(p_i\) and \(b_i\) denote the number of point- and box-vertices in \(H^{n}_i\), respectively, then \(p_1 = n\), \(b_1 = 1\), and \(p_i = n \cdot p_{i-1}\), \(b_i = n \cdot b_{i-1} + p_{i-1}\). From these recurrence relations, it is easy to deduce that \(p_i = n^i\) and \(b_i = i\cdot n^{i-1}\) for all \(i \in \{1,\ldots ,n\}\). In particular, \(p_{n} = b_{n} = n^{n}\).

Note that each of the graphs \(H^{n}_i\) is \(K_{2,2}\)-free. We further observe that every time we add a new box-vertex its degree is n and it does not change in the subsequent graphs. The degree of every copy of a point-vertex from \(H^{n}_{i-1}\) increases by one in \(H^{n}_i\), i.e. the degree of every point-vertex in \(H^{n}_i\) is i. Hence, \(G_{n}:= H^{n}_{n}\) is a \(K_{2,2}\)-free point-box incidence graph with \(g(n):=2n^n\) vertices in which every vertex has degree \(n \in \Theta \left( \frac{\log g(n)}{\log \log g(n)}\right) \). Applying Lemma 4.1 to \((G_n)_{n \in \mathbb {N}}\) implies the lemma. \(\square \)

It is known that point-box incidence graphs are box intersection graphs in \(\mathbb {R}^3\) (see, e.g., [9]). Summarising, we derive the main result of this section.

Theorem 4.4

The class of box intersection graphs in \(\mathbb {R}^3\) has unbounded functionality.

Clearly, Theorem 4.4 implies that the class of box intersection graphs in \(\mathbb {R}^d\) has unbounded functionality for all \(d\ge 3\).

5 Symmetric Difference is Unbounded for the Classes of Interval Graphs and Unit Box Intersection Graphs in \(\mathbb {R}^2\)

Bonnet et al. showed in [5] that the class of interval graphs has unbounded twin-width based on a construction of a class of interval graphs that can represent an arbitrary permutation. The construction relies on the notion of a half graph, that is, a bipartite graph with 2n vertices, \(n\ge 1\), that admits a partition of its vertex set into two equally sized independent sets \(X =\{x_1,\ldots , x_n\}\) and \(Y= \{y_1,\ldots , y_n\}\) such that for all \(i,j\in [n]\), vertex \(x_i\) is adjacent to vertex \(y_j\) if and only if \(i < j\).

Definition 5.1

An ABC graph is any graph G with 3n vertices, \(n\ge 1\), such that the vertex set of G can be partitioned into three cliques A, B and C, each of size n, such that there are no edges between A and C, the edges between A and B form a half graph, and the edges between B and C form a half graph. More precisely, there exists an order \(a_1,\ldots , a_n\) for the vertices in A and an order \(b_1,\ldots , b_n\) for the vertices in B such that \(a_i\) is adjacent to \(b_j\) if and only if \(i<j\). Similarly, there exists another order \(b_1',\ldots , b_n'\) for the vertices in B and an order \(c_1,\ldots , c_n\) for the vertices in C such that \(b_i'\) is adjacent to \(c_j\) if and only if \(i<j\).

It is important to note that the orders \(b_1,\ldots , b_n\) and \(b_1',\ldots , b_n'\) for the vertices in B are completely independent from each other. In particular, they may differ.

ABC graphs have been studied in [7], where they have been shown to be of unbounded clique-width. Bonnet et al. extended this result by showing that the twin-width of ABC graphs is unbounded. However, the proof in [5] is non-constructive and relies on a counting argument. We now improve this result in two different ways. First, we extend it by showing that the ABC graphs have unbounded symmetric difference, which is a stronger conclusion. Second, our proof is constructive and provides an explicit family of induced subgraphs of ABC graphs with increasing symmetric difference.

Theorem 5.2

The class of ABC graphs has unbounded symmetric difference.

Proof

We will show that for every integer \(k\ge 2\) there exists a graph \(G_k\) that is an induced subgraph of an ABC graph and such that the symmetric difference of \(G_k\) is at least k. The construction is as follows. The graph \(G_k\) consists of three disjoint cliques A, B and C, and some edges between them. The two cliques A and C are each of size t where \(t = k^3\). The clique B has size \(k^4\), its vertices correspond to pairs of integers, and it is partitioned into \(k^2\) smaller sets, each of size \(k^2\),

$$\begin{aligned}B = \bigcup _{1\le i,j\le k}B_{ij},\end{aligned}$$

where the sets \(B_{ij}\) are defined as follows:

  • \(B_{11} = \{(pk-q,qk+p)\mid 1\le p\le k,0\le q\le k-1\}\)

  • for all \((i,j)\in [k]^2\setminus \{(1,1)\}\), the set \(B_{ij}\) is a translate of the set \(B_{11}\):

    $$\begin{aligned} B_{ij} = B_{11}+((i-1)k^2,(j-1)k^2) = \{(x+(i-1)k^2,y+(j-1)k^2)\mid (x,y)\in B_{11}\}. \end{aligned}$$

See Fig. 1 for an example of \(G_k\) for \(k = 4\). Note that for each vertex \(b = (b_x,b_y)\) in B, it holds that \(1\le b_x\le t\) and \(1\le b_y\le t\). To describe the edges between the cliques A, B and C, we fix an ordering of the vertices in A and in C as \(A = \{a_1,\ldots , a_t\}\) and \(C = \{c_1,\ldots , c_t\}\), respectively. Then, the edges between the cliques A, B and C are as follows.

  • For every vertex \(a_i\in A\) and every vertex \(b = (b_x,b_y)\in B\), vertices \(a_i\) and b are adjacent if and only if \(i < b_x\).

  • For every vertex \(b = (b_x,b_y)\in B\) and every vertex \(c_j\in C\), vertices b and \(c_j\) are adjacent if and only if \(b_y< j\).

  • There are no edges between A and C.

This completes the description of the graph \(G_k\).

Fig. 1
figure 1

A schematic representation of the graph \(G_k\), for \(k = 4\), as defined in Theorem 5.2. The bottom-most vertices belong to the clique A; the right-most vertices belong to the clique C; vertices on the grid belong to the clique B. For each \(i \in [t]\), vertex \(a_i\) (on column i) is adjacent to all the vertices in B on a column \(j > i\). Similarly, for each \(i \in [t]\), vertex \(c_i\) (on row i) is adjacent to all the vertices in B on a row \(j < i\)

Next, we show that the symmetric difference of \(G_k\) is at least k, that is, that for any two distinct vertices \(u,v\in V(G_k)\) we have \(\textrm{sd}(u,v)\ge k\). We distinguish several cases depending on which of the cliques A, B and C vertices u and v belong to (and taking into account the fact that \(\textrm{sd}(u,v) = \textrm{sd}(v,u)\)).

We first observe that for any fixed \(i\in [t]\), the number of vertices \((b_x,b_y)\) in B with \(b_x = i\) is k. Similarly, the number of vertices in B with \(b_y = i\) is also k.

Case 1: \(u,v\in A\). Let \(u = a_i\) and \(v = a_j\) be any two vertices of A with \(1\le i<j\le t\). By construction we have that \(\{(b_x,b_y)\in B\mid b_x = j\}\subseteq N(u){\setminus } N(v)\). Therefore, by the above observation, \(\textrm{sd}(u,v)\ge k\).

Case 2: \(u,v\in C\). Let \(u = c_i\) and \(v = c_j\) be any two vertices of C with \(1\le i<j\le t\). Again, by construction we have that \(\{(b_x,b_y)\in B\mid b_y = i\}\subseteq N(v){\setminus } N(u)\). Thus, we again obtain that \(\textrm{sd}(u,v)\ge k\).

Case 3: \(u\in A\) and \(v\in C\). By construction we have that \(A{\setminus } \{u\} \subseteq N(u)\) and \((A{\setminus } \{u\}) \cap N(v) = \emptyset \). Thus, \(\textrm{sd}(u,v)\ge t -1 = k^3-1\ge k\) (here we use the assumption that \(k\ge 2\)).

Case 4: \(u\in A\) and \(v\in B\). Let \(u = a_i\in A\), \(i\in [t]\), and let \(v = (b_x,b_y)\in B\). Note that by definition, no vertex in A is adjacent to any vertex \(b\in B\) with the first coordinate equal to 1. As we have already observed, there are exactly k such vertices in B. Thus, if \(b_x\ge 2\), then, since B is a clique, \(\textrm{sd}(u,v)\ge k\) and we are done. Therefore, we may assume that \(b_x = 1\). But then \(N(v)\cap A = \emptyset \), while \(A\setminus \{u\}\) is of size \(t-1\) contained in N(u). Thus, we again have that \(\textrm{sd}(u,v)\ge t-1\ge k\).

Case 5: \(u\in B\) and \(v\in C\). In this case the arguments are similar to those in Case 4. Let \(u = (b_x,b_y)\in B\) and \(v = c_j\in C\), \(j\in [t]\). No vertex in C is adjacent to any vertex \(b\in B\) with the second coordinate equal to t and there are exactly k such vertices in 1. Thus, if \(b_y\le t-1\), then, since B is a clique, \(\textrm{sd}(u,v)\ge k\) and we are done. Therefore, we may assume that \(b_y = t\). But then \(N(u)\cap C = \emptyset \), while \(C\setminus \{v\}\) is of size \(t-1\) contained in N(v), and \(\textrm{sd}(u,v)\ge k\).

Case 6: \(u,v\in B\). Let \(u = (u_x,u_y)\in B_{ij}\) and \(v = (v_x,v_y)\in B_{i'j'}\) be two distinct vertices of B. By construction of the graph \(G_k\), exactly \(|u_x-v_x|\) vertices in A are adjacent to precisely one of u and v and, similarly, exactly \(|u_y-v_y|\) vertices in C are adjacent to precisely one of u and v. Therefore, \(\textrm{sd}(u,v)\ge k\) whenever the Manhattan distance \(|u_x-v_x|+|u_y-v_y|\) between u and v is at least k. If \(|i'-i|\ge 2\), then \(|u_x-v_x|\ge k^2+1\). Consequently, \(\textrm{sd}(u,v)\ge k^2+1\ge k\) whenever \(|i'-i|\ge 2\) and a similar conclusion holds if \(|j'-j|\ge 2\).

We may therefore assume that \(|i' - i| \le 1\) and \(|j' - j | \le 1\). Let us verify that in this case the Manhattan distance between u and v is at least k. We have \(u = (x+(i-1)k^2,y+(j-1)k^2)\) where \(x = pk-q\) and \(y = qk+p\) for some \(1\le p\le k\) and \(0\le q\le k-1\) and, similarly, \(v = (x'+(i'-1)k^2,y'+(j'-1)k^2)\) where \(x' = p'k-q'\) and \(y' = q'k+p'\) for some \(1\le p'\le k\) and \(0\le q'\le k-1\). We thus have

$$\begin{aligned}|u_x-v_x| = |(i-i')k^2+(p-p')k+q'-q|\end{aligned}$$

and

$$\begin{aligned}|u_y-v_y| = |(j-j')k^2+(q-q')k+p-p'|.\end{aligned}$$

Consider first the case when \(i' = i\) and \(j' = j\). In this case, the Manhattan distance between u and v is equal to \(|(p-p')k+q'-q|+|(q-q')k+p-p'|\). If \(p' = p\) then \(q'\ne q\) and the expression simplifies to \((k+1)|q-q'|\ge k+1\). Similarly, if \(q' = q\) then \(p'\ne p\) and the above expression simplifies to \((k+1)|p-p'|\ge k+1\). If \(p'\ne p\) and \(q'\ne q\), then we may assume without loss of generality that \(p>p'\). Suppose to a contradiction that the Manhattan distance between u and v is less than k, that is,

$$\begin{aligned}|(p-p')k+q'-q|+|(q-q')k+p-p'| < k.\end{aligned}$$

Since \(p-p'\in [k-1]\) and \(q'\ne q\), we obtain from the second term on the left side of the inequality that \(q-q' = -1\). Thus, we have that \(q'>q\), and from the first term on the left side of the inequality we obtain that \(p-p' = -1\), a contradiction with the assumption that \(p>p'\).

Next, consider the case when \(i' \ne i\). We may assume without loss of generality that \(i' > i\), and hence \(i' = i+1\) (recall that \(|i'-i|\le 1\)). The Manhattan distance between u and v is hence equal to \(|k^2 + (p'-p)k + (q-q')| + |(j'-j)k^2 + (q'-q)k + (p'-p)|\). Suppose for a contradiction that the Manhattan distance between u and v is less than k. In that case, we must have that \((p'-p) = -(k-1)\) and \((q-q')<0\). Recall that \(|j'-j|\le 1\). First, if \(j'-j = 0\), we must have that \(q'-q = 1\), but then the Manhattan distance between u and v is equal to \(|k^2-(k-1)k-1|+|k-(k-1)| = k\), a contradiction. Second, if \(j'-j = 1\), then, as \((q-q') < 0\), we have that \(|v_y-u_y| \ge k^2\), a contradiction. Third, if \(j'-j = -1\), then we must have that \((q-q') = -(k-1)\). However, in that case the Manhattan distance between u and v is equal to \(|k^2-(k-1)k-(k-1)|+|-k^2+(k-1)k-(k-1)| = 1+|-2k+1| = 2k\), again a contradiction.

Finally, consider the case when \(i' = i\) and \(j' \ne j\). Similarly as in the previous case, we may assume without loss of generality that \(j' > j\), and hence \(j' = j+1\). The Manhattan distance between u and v is equal to \(|(p'-p)k + (q-q')| + |k^2 + (q'-q)k + (p'-p)|\). Suppose for a contradiction that the Manhattan distance between u and v is less than k. Similarly as in the previous case, we must have that \((q'-q) = -(k-1)\) and \((p'-p)<0\). Furthermore, we must have \(p'-p = -1\), since otherwise the first term \(|(p'-p)k + (q-q')| = |(p'-p)k +(k-1)|\) would exceed k. But then the Manhattan distance between u and v is equal to \(|-k+(k-1)|+|k^2-(k-1)k-1| = k\), a contradiction.

Finally, we show that \(G_k\) is an induced subgraph of an ABC graph. To this end, we show that it is possible to add vertices to the clique A and to the clique C so that each of the resulting cliques \(A'\) and \(C'\) has cardinality equal to the cardinality of B, that is, \(k^4\), the edges between \(A'\) and B form a half graph, the edges between B and \(C'\) form a half graph and there are no edges between \(A'\) and \(C'\).

By symmetry, it suffices to show that it is possible to add vertices to the clique C to obtain a clique \(C'\) with \(|C'| = k^4\) so that the edges between B and \(C'\) form a half graph. First, notice that for every vertex \(b = (b_x,b_y)\) in B, its neighbourhood in C depends only on the value of \(b_y\). Denoting for each \(j \in [t]\) by \(B_j\) the set of all vertices \((b_x,b_y)\) in B such that \(b_y = j\), it holds that \(|B_j| = k\). Fix an arbitrary ordering of the vertices of B as \(B = \{b_1,\ldots , b_{k^4}\}\) such that the vertices in the same part \(B_j\) appear consecutively and the vertices of \(B_j\) appear before the vertices of \(B_{j+1}\), for all \(j\in [t-1]\). It follows from the construction that for every \(j \in [t]\), the neighbourhood of \(c_j\) in B equals to the union \(\bigcup _{i<j}B_i = \{b_\ell : \ell \le k \times (j-1)\}\). In particular, for any two consecutive vertices in C, their neighbourhoods in B are nested and differ in precisely k vertices. We extend the clique C to a larger clique \(C'\) by adding, for each \(j \in [t]\), a set of \(k-1\) new vertices \(c_j^1, \dots , c_j^{k-1}\) such that, writing \(c_j^{0} = c_j\), for each \(i \in \{0,\ldots , k-1\}\) the neighbourhood of \(c_j^i\) in B equals \(\{ b_\ell : \ell \le k \times (j-1) + i\}\). This implies that the \(k^4\) vertices of \(C'\) all have distinct but comparable neighbourhoods in B, with \(N(c_1) \cap B = \emptyset \) and \(N(c_t^{k-1}) \cap B = B\setminus \{b_{k^4}\}\). In particular, the edges between B and \(C'\) form a half graph, as desired. \(\square \)

As observed by Bonnet et al. [5], every ABC graph is an interval graph. Thus, Theorem 5.2 implies the following.

Corollary 5.3

The class of interval graphs has unbounded symmetric difference.

Theorem 5.2 has another consequence for the class of unit box intersection graphs in \(\mathbb {R}^2\).

Proposition 5.4

Every ABC graph is a unit box intersection graph in \(\mathbb {R}^2\).

Proof

Bonnet et al. showed in [5], with a proof by picture, that every ABC graph is a unit disk graph. We adapt their approach (and their figure) to show that every ABC graph is a unit box intersection graph in \(\mathbb {R}^2\). Let G be any ABC graph with 3n vertices, \(n\ge 1\), with cliques A, B and C, and orderings \(a_1,\ldots , a_n\), \(b_1,\ldots , b_n\), \(b_1',\ldots , b_n'\), and \(c_1,\ldots , c_n\) as in the definition of ABC graphs. We explain how to represent G as a unit box intersection graph in \(\mathbb {R}^2\); see the right part of Fig. 2.

Place n unit boxes in \(\mathbb {R}^2\) representing vertices of A so that their centers are close to each other and decreasing in both coordinates, in order \(a_1,\ldots , a_n\). Then, place n other unit boxes in \(\mathbb {R}^2\) representing vertices of B above the A-boxes so that their centers are close to each other and the intersections between A-boxes and B-boxes realise the half graph formed by the edges between A and B, taking into account the ordering \(b_1,\ldots , b_n\). Note that this imposes constraints on the vertical positions (that is, values of y-coordinates) of the centers of the B-boxes, but leaves some freedom about shifting the B-boxes horizontally. Next, place additional n unit boxes in \(\mathbb {R}^2\) representing vertices of C to the right of the boxes representing vertices of B so that the centers of the C-boxes are close to each other, decrease in both coordinates, in order \(c_1,\ldots , c_n\), and no C-box intersects any A-box. Finally, if necessary, shift the B-boxes horizontally so that the intersections between B-boxes and C-boxes realise the half graph formed by the edges between B and C, taking into account the ordering \(b_1',\ldots , b_n'\). \(\square \)

Theorem 5.2 and Proposition 5.4 imply the following.

Corollary 5.5

The class of unit box intersection graphs in \(\mathbb {R}^2\) has unbounded symmetric difference.

Fig. 2
figure 2

On the left, an ABC-graph with 15 vertices represented by intervals. On the right, the same graph, this time represented as a unit box intersection graph in \(\mathbb {R}^2\)

6 Conclusion

In this paper we proved a number of results on functionality and symmetric difference of box intersection graphs. A summary of our results is presented in Table 1.

Table 1 Functionality and symmetric difference of box intersection graphs in \(\mathbb {R}^d\)

As indicated in the table, the functionality of box intersection graphs in \(\mathbb {R}^2\) remains an open question. It also remains open whether the functionality is bounded for unit box intersection graphs in \(\mathbb {R}^{d}\) for any fixed \(d\ge 2\).

Among other classes with unknown behaviour of functionality we distinguish the following two important extensions of interval graphs: circular-arc graphs and trapezoid graphs.

Finally, we mention one more open problem related to graph functionality: characterisation and recognition of graphs of small functionality. By definition, vertices of functionality 0 are either isolated or dominating, and hence graphs of functionality 0 are threshold graphs, i.e. graphs every induced subgraph of which contains either an isolated or dominating vertex. However, the class of graphs of functionality at most 1 remains a mystery. It contains

  • all forests (as every forest contains a vertex of degree at most 1) and their complements,

  • all cographs, as every cograph with at least two vertices contains a pair of twins,

  • all distance hereditary graphs, as every graph in this class can be constructed from a single vertex by successively adding either a pendant vertex or a twin [3].

Note that the class of graphs of functionality at most 1 is substantially more complex, as it also contains graphs with anti-twins, i.e. vertices whose neighbourhoods complement each other. Similarly to twin vertices, anti-twins are functions of each other. More generally, any two vertices are functions of each other and of the vertices that do not distinguish them.Footnote 3 This observation gives rise to a new notion, analogous to symmetric difference, and to a new line of research related to graph functionality.