Keywords

1 Introduction

In order to model complex systems with one-to-one interactions, one among the most versatile and used mathematical structure is that of graph so that the elements of the systems are represented by nodes, and their mutual interactions by edges. A wide interest in graph theory started in the half of 20th century, and few years later, took shape the idea of generalizing the interactions’ possibility to more than two elements of the systems. So, edges naturally evolved into hyperedges, regarded as subsets of nodes, and the notion of graph changed into hypergraph, accordingly.

In addition to the natural generalization of graphs, hypergraphs found their own relevance in different research areas, ranging from the most theoretical ones such as Geometry, Algebra and Number Theory, to more applicative as Optimization, Physics, Chemistry, etc.

The seminal book by Berge [5] will give to the reader the formal definitions and vocabulary, some results with their proofs, and more about applications of hypergraphs.

Most of the times what is required is to infer some statistics and characteristics of the modelled system from partial and sometimes inaccurate information about it. A typical situation is when the data concern only the number of interactions that involves each node, say the degree of a node, without detailing the subjects of those interactions; this case is referred to as degree based reconstruction problem and it involves various subproblems concerning the reconstruction of a hypergraph from a given degree sequence \(\pi \), counting the number of different hypergraphs having a given \(\pi \), possibly reconstructing all of them, and also sampling a typical element among them.

In this paper, we concentrate on the first of these problems related to a specific subclass of hypergraphs, i.e. the h-uniform simple ones, with \(h=3\). This choice is motivated by the fact that degree sequences for \(h=2\), i.e. simple graphs, have been studied by many authors, including the celebrated work of Erdös and Gallai [17], which effectively characterizes them. From their result, a P-time algorithm was designed to reconstruct the adjacency matrix of a graph having degree sequence \(\pi \) (if it exists). On the other hand, the case \(h\ge 3\) remained open till nowadays: in 2018, Deza et al. in [15] proved its NP-completeness, i.e., they showed that for any fixed integer \(h\ge 3\) it is NP-complete to decide if a sequence of positive integers can be the degree sequence of a h-uniform hypergraph.

So, it acquires relevance to restrict the set of intractable degree sequences and find fast reconstruction algorithms for those remaining: in [18], h-uniform regular and almost regular hypergraphs are considered and the related degree sequences have been characterized and efficiently reconstructed. Successively, Behrens et al. in [2] propose a sufficient condition for a degree sequence to be h-graphic; unfortunately the characterization gives no information about the associated h-uniform hypergraphs. Finally, in [7], an efficient generalization of the algorithm in [18] fills this gap. Our studies aim to push further the efficient extension of the condition of [2] in case of 3-uniform hypergraphs.

We give the definitions and the results useful for our study in the next section. Then in the Sect. 3 we will give our new sufficient condition and the related polynomial time algorithm that given a sequence of integers \(\pi \) satisfying it, builds the incidence matrix of a 3-uniform hypergraph that realizes \(\pi \), if such hypergraph exists.

2 Definitions and State of the Art

Borrowing the notation from [5], we define hypergraph to be the couple \({G}=(Vert,\mathcal{E})\) such that \(Vert=\{v_1,\ldots ,v_n\}\) is a ground set of vertices and \(\mathcal{E}\subset 2^{\vert Vert \vert }\setminus \emptyset \) is the set of hyperedges. We choose to consider simple hypergraphs only, i.e. such that \(e\not \subseteq e'\) for any pair \(e,e'\) of \(\mathcal E\), and we admit isolated points as vertices, so \(\bigcup \mathcal{E} \subseteq Vert\), see Fig. 1. The degree of a vertex \(v\in Vert\) is the number of hyperedges \(e\in \mathcal E\) such that \(v\in e\), and the degree sequence of a hypergraph, also called graphic sequence, is the list of its vertex degrees, usually written in nonincreasing order, as \(\pi =( d_1,d_2,\ldots ,d_n),d_1\ge d_2\ge \cdots \ge d_n\). In the sequel, it will be useful to indicate by \(\sigma (\pi )\) the sum of the elements of \(\pi \), and \(\pi ^-\) the sequence \(\pi \) with the first element removed, i.e. \(\pi ^-=(d_2,\dots ,d_n)\).

A hypergraph is h-uniform if \(\vert e\vert =h\) for all hyperedge \(e\in \mathcal E\). In Fig. 1 two 3-uniform hypergraphs, i.e., (a) and (c), and a 2-uniform one, (b), are depicted; the last one turns out to be a simple graph.

Fig. 1.
figure 1

(a): a 3-uniform hypergraph with vertices \(V=\{v_1,v_2,v_3,v_4,v_5\}\) and hyperedges \(\mathcal{E}=\{e_1,e_2,e_3,e_4\}\). Its degree sequence (arranged in non increasing order) is \(\pi =(3,3,2,2,2)\); (b): the link hypergraph of the decomposition of the hypergraph in (a) w.r.t. the removed vertex \(v_1\), according to Theorem 2. The link hypergraph is 2-uniform, i.e. it is a simple graph; (c): the residual 3-uniform hypergraph of the same decomposition.

The problem of the combinatorial and algorithmically efficient characterization of the degree sequences of h-uniform hypergraphs, say h-graphic sequences, has been one of the most relevant in the theory of hypergraphs: the case of simple graphs, i.e. when \(h=2\), was solved in 1960 by Erdös and Gallai in the following milestone theorem (see [4]).

Theorem 1

(Erdös, Gallai). A sequence \(\pi =(d_1,d_2,\ldots ,d_n)\) where \(d_1\ge d_2\ge \cdots \ge d_n\) is (2-)graphic if and only if \(\sigma (\pi )\) is even and

$$\begin{aligned}{\sum _{i=1}^k d_i\le k(k-1)+\sum _{i=k+1}^n \min \{k,d_i\}, 1\le k\le n.}\end{aligned}$$

Concerning the general case of h-graphical sequences, we recall the following (non efficient) result from [14]:

Theorem 2

(Dewdney). Let \(\pi = (d_1,\dots ,d_n)\) be a non-increasing sequence of non-negative integers. \(\pi \) is h-graphic if and only if there exists a non-increasing sequence \(\pi ' = (d_2',\dots ,d_n')\) of non-negative integers such that

  1. 1.

    \(\pi '\) is \((h-1)\)-graphic,

  2. 2.

    \(\sum _{i=2}^{n} d_i' = (h-1)d_1\), and

  3. 3.

    \(\pi '' = (d_2-d_2',\dots ,d_n-d_n')\) is h-graphic.

The underlying idea of the theorem rests on the possibility of splitting a h-uniform hypergraph G into two parts: for each vertex v, the first one consists of the hypergraph obtained from G after deleting all the hyperedges not containing v, and then removing, from all the remaining hyperedges, the vertex v; this hypergraph is identified in the literature with \(L_G(v)\), say the link of v, and its degree sequence the link sequence of v. The second hypergraph \(G_v^-\), say the residual of v, is obtained from G after removing all hyperedges containing v. It is clear that G can be obtained from \(L_G(v)\) and \(G_v^-\); furthermore one can notice that \(L_G(v)\) is \((h-1)\)-uniform, while \(G^-_v\) preserves the h-uniformity. Such a decomposition can be recursively carried on till reaching trivial hypergraphs.

Relying on this result, the authors of [2] provided a sufficient conditions for the h-graphicality of a degree sequence:

Theorem 3

(Behrens et al.). Let \(\pi \) be a non-increasing sequence of length n with maximum entry \(\varDelta \) and t entries that are at least \(\varDelta -1\). If h divides \(\sigma (\pi )\) and

$$\begin{aligned} {\left( {\begin{array}{c}t-1\\ h-1\end{array}}\right) } \ge \varDelta \end{aligned}$$
(1)

then \(\pi \) is h-graphic.

Unfortunately, this theorem does not furnish an efficient way to construct a h-uniform realization of the sequence \(\pi \).

It is worth mentioning that very recently, in [15], it has been proved the non polynomiality of the reconstruction of a 3-uniform hypergraph that realizes a given degree sequence, spreading the result to each \(h\ge 3\). So, it has acquired relevance the study of sets of degree sequences whose h-graphicality can be certified in polynomial time and the definition of a strategy to construct their related hypergraphs.

Following the direction, in these last years the result of Behrens et al. has been investigated from a different perspective, as an inverse problem in the discrete environment. The required mathematical tools come from discrete tomography that is wide research area whose aim, among many others, is that of reconstructing (or at least retrieve information about) unknown binary matrices regarded as homogeneous finite sets of points, from projections, i.e. measurements of the number of elements lying on each line intersecting the set and having a given direction.

One can refer to the books of Herman and Kuba [21, 22] for basics on the theory, algorithms and applications of discrete tomography.

Coming back to our context, the problem of the characterization of the degree sequence \((d_1,d_2,\ldots ,d_n)\) of an h-uniform (simple) hypergraph G asks whether there is a binary matrix A with projections \(H=(h,h,\ldots ,h)\) and \(V=(d_1,d_2,\ldots ,d_n)\) and having distinct rows, i.e., A is the adjacency matrix of G where rows and columns correspond to hyperedges and vertices, respectively. Ryser’s Theorem [24] answers the question for generic hypergraphs, since it admits the presence of equal rows in the reconstructed matrix, so, as mentioned in [5], the reconstruction of a multi-hypergraph (parallel hyper edges are authorized) from a given degree sequence can be efficiently done. In [7], the Theorem 3 has been considered and translated into an inverse reconstruction problem, gaining efficiency to the sufficient condition it introduces. In the next section, we rely on this result to efficiently generalize the sufficient condition it proposes to 3-uniform hypergraphs.

3 A Sufficient Condition for the 3-Graphicality

We recall the notion of dominance order defined by Brylawski in [6]: let \(\pi =(d_1,\dots ,d_n)\) and \(\pi '=(d_1',\dots ,d_n')\) be two integer sequences such that \(\sigma (\pi )=\sigma (\pi ')\), we define

$$ \pi \le _d \pi ' \text {if and only if} \sum _{i=1}^{k}d_i \ge \sum _{i=1}^{k}d_i' $$

for each \(1\le k \le n\).

Lemma 1

Let \(\pi =(d_1,\dots ,d_n)\) and \(\pi '=(d_1',\dots ,d_n')\) be two sequences such that \(\pi \le _d \pi '\). If \(\pi \) is graphic, then also \(\pi '\) is.

Proof

The graphic characterization in Theorem 1 related to \(\pi \) states that, for each \(1\le k \le n\), \(\sum _{i=1}^k d_i \le k(k-1)+\sum _{i=k+1}^n min\{k,d_i\}\). Since \(\pi \le _d \pi '\), we have

$$ \sum _{i=1}^k d_i' \le \sum _{i=1}^k d_i \le k(k-1)+\sum _{i=k+1}^n min\{k,d_i\} \le k(k-1)+\sum _{i=k+1}^n min\{k,d_i'\}, $$

the last inequality holding since \(\sigma (\pi )=\sigma (\pi ')\), so \(\pi '\) is also graphic.   \(\square \)

The following lemma states the trivial property that in a n-nodes (simple and loopless) graph, each node can be edge connected to the remaining \(n-1\) nodes at most:

Lemma 2

Let \(\pi =(d_1,\dots ,d_n)\) be a non increasing graphic sequence. It holds that \(d_1\le n-1\).

The following definitions and some notations introduce the main result of this section: let \(\pi =(d_1,\dots ,d_n)\) be a nonincreasing integer sequence. We define the S cut (sequence) of \(\pi \) to be the sequence \(\pi '=(d_1',\dots ,d_n')\) such that \(\sigma (\pi ')=S\), and

$$\begin{aligned} d_i' = {\left\{ \begin{array}{ll} d_i - c - 1 &{} \text {if } i\le k' \\ d_i - c &{} \text {if } k'<i\le k \\ 0 &{} \text {otherwise} \end{array}\right. } \end{aligned}$$

with \(0\le k' < k \le n\) and \(0\le c < d_1\). We indicate \(\pi '=Cut(\pi ,S)\) and we refer to c as the height of \(\pi '\); Fig. 2 helps in visualizing the definition.

Fig. 2.
figure 2

The Ferrer diagram of the sequence \(\pi =(9,9,8,6,6,6,5,5,5,4,3,3,3,2,2)\). The cut sequence of sum 29 is \(\pi '=Cut(\pi ,29)=(5,5,4,2,3,3,2,2,2,1,0,0,0,0,0)\). The height \(c=3\) of the cut and the indexes \(k'\) and k are also highlighted. Observe that \(\pi '\) may loose the nonincreasing property.

Furthermore, let A and B be two \(m\times n\) and \(m'\times n'\) matrices, respectively; we introduce the following standard operators: if \(m=m'\), then the horizontal concatenation of A and B, write , is the matrix obtained by orderly concatenating the columns of A to those of B. Similarly, if \(n=n'\), we define the vertical concatenation of A and B, write \(A\ominus B\), to be the ordered concatenation of the rows of A and B.

Theorem 4

Let \(\pi =(d_1,\dots ,d_n)\) be a nonincreasing sequence such that \(\sigma (\pi )\) is a multiple of 3. If the cut sequence \(\pi '=Cut(\pi ^-,2 d_1)\) is graphic, then \(\pi \) is 3-graphic.

Proof

We proceed by first constructing a 3-uniform realization \(G'\) of the sequence \((d_1,\pi ')\), with \(\pi '=Cut(\pi ^-,2 d_1)=(d'_2,\dots ,d'_n)\): the adjacency matrix of \(G'\) has dimension \(d_1 \times n\) since \(\sigma (d_1,\pi ')=3d_1\), so its first column contains elements 1 only. By hypothesis, \(\pi '\) is graphic, so we fill the remaining \(n-1\) columns by one of its realizations, obtaining the desired adjacency matrix of \(G'\). Since its horizontal projections have common value 3, then \(G'\) is 3-uniform (see Examples 1 and 2).

Now, we focus on the residual (in the sense of Theorem 2, and as shown in Fig. 2) sequence \(\pi ''=(\pi -(d_1,\pi '))^-=(d_2'',\dots ,d_n'')\) that we consider arranged in non increasing order by the permutation \(\alpha \), if needed. By construction, it holds that \(\sigma (\pi '')\) is multiple of 3. If \(\pi ''\) is the zero sequence, then \(G'\) itself is a 3-uniform realization of \(\pi \). On the other hand, let \(Cut(\pi ^-,2 d_1)\) have eight \(c< d_1\); some cases according to the value of \(d_2'\) arise:

(i):

\(d'_2 \le 1\): the maximum element of \(\pi '\) is 1, and, by definition of cut sequence, \(\pi ''\) has an initial almost regular sequence of length greater than or equal to \(d_1\). Since \(d_2' \le d_1\), then \(\pi ''\) satisfies the conditions in Theorem 3. The result in [7] that relies back to [18], provides in P-time a 3-uniform realization \(G''\) of \(\pi ''\);

(ii):

\(d_1-1 \le d'_2 \le d_1\): \(\pi ''\) has maximum element 2 at most, and consequently it has an immediate 3-uniform realization \(G''\);

(iii):

\(\frac{d_1}{2} \le d_2' < d_1-1\): the sequence \(\pi '=(d_2',\dots ,d_k,0\dots ,0)\) has \(k-1\ge d_2'+1\) elements different from zero, by Lemma 2, with k ranging from 4 to n (if \(k=3\), then \(d_2'=1\), as in case (i) above). The residual sequence can be written as

$$ \pi ''=(\underbrace{c+1,\dots ,c+1}_{t \, \text {times}},c,\dots ,c,d_{k+1},\dots ,d_n) \text { possibly with t =0.} $$

Since \(c\le d_2'<k\), it follows that \(\pi ''\) satisfies the hypothesis of Theorem 3 and so it admits a 3-uniform realization in P-time as in [7] (see Example 1);

(iv):

\( 1< d_2' < \frac{d_1}{2}\): again the sequence \(\pi '=(d_2',\dots ,d_k',0\dots ,0)\) has \(k-1\ge d_2'+1\) elements different from 0, by Lemma 2. We observe that the maximum number of edges, i.e. the maximum value of \(d_1\), of a graph with \(d_2'+1\) nodes is \(\frac{d_2'(d_2'+1)}{2}\), provided by the complete graph that we indicate as \(K_{d_2'+1}\), and this same upper bound also holds for \(d_2 (\le d_1)\).

If the upper bounds realize for \(d_1\) and \(d_2\), with the minimum k, i.e. \(k=d_2'+2\), then \(\pi ''\) has an initial sequence of \(d_2'+1\) elements having common value

$$ c = d_2-d_2'=\frac{d_2'(d_2'+1)}{2}-d_2'=\frac{(d_2'-1)d_2'}{2}, $$

that is the number of edges of the complete graph with \((d_2'-1)\) nodes. So, the sequence \(\pi '''=Cut(\pi '', 2 d_2'')\) is again graphic and \(\pi ''\) satisfies the conditions of this theorem, allowing the described decomposition to apply recursively till reaching the constant sequence. A 3-uniform realization \(G''\) of \(\pi ''\) can be computed in P-time. If the upper bounds on \(d_1\) and \(d_2\) with the minimum value of k do not realize, then the sequence \(\pi ''\) that originates is obviously greater in the dominance order, so \(\pi '''\) is graphic a fortiori (see Example 2).

In all the cases, the final 3-uniform realization of \(\pi \) can be recursively obtained as , where [0] stands for the zero column, after observing that \(G'\) has no common edges with \(G''\).   \(\square \)

To make clearer the reconstruction process just described, we provide two examples of cases (iii) and (iv), being (i) and (ii) easiest subcases.

Example 1

Let us consider the sequence \(\pi =(10,9,7,5,4,4,4,3,1,1)\), and compute

$$ \pi '=Cut(\pi ^-,20)=(6,4,3,2,2,2,1,0,0)~and~\pi ''=(3,3,2,2,2,2,2,1,1). $$

Since the sequence \(\pi '\) is graphic by Theorem 1, then \(\pi ''\) satisfies the hypothesis of Theorem 3, i.e. \(3\le \left( {\begin{array}{c}6\\ 2\end{array}}\right) \), and so one of its realizations \(G''\) can be computed in polynomial time.

The final realization G of \(\pi \) is obtained by composing the realizations \(G'\) and \(G''\) of \(\pi '\) and \(\pi ''\), respectively, as indicated in the proof of Theorem 4, case (iii), and depicted in Fig. 3.

Fig. 3.
figure 3

A 3-uniform hypergraph G whose degree sequence is \(\pi =(10,9,7,5,4,4,4,3,1,1)\). The hypergraph G is obtained as the composition of \(G'\) and \(G''\), i.e., the 3-uniform realizations of the related sequences \(\pi '\) and \(\pi ''\), respectively.

Example 2

In order to clarify the proof of Theorem 4, case (iv), let us consider the sequence \(\pi =(10,10,10,10,10,10)\), and compute

$$ \pi '=Cut(\pi ,20)^-=(4,4,4,4,4)~and~\pi ''=(6,6,6,6,6). $$

It holds \(d_2'(=4)<\frac{d_1}{2}\), the sequence \(\pi '\) is graphic and its realization is the complete graph \(K_5\).

The sequence \(\pi ''\) still satisfies the hypothesis of Theorem 4, since \(\pi '''=Cut((\pi '')^-,12)=(3,3,3,3)\) is again the degree sequence of \(K_4\).

The final realization G of \(\pi \) is obtained recursively by composing the 3-uniform realizations of \(K_5\), \(K_4\), \(K_3\) and \(K_2\) as in Fig. 4.

Fig. 4.
figure 4

Two 3-uniform hypergraphs G and \(G_1\) related to case (iv) of Theorem 4. The complete graphs \(K_5\), \(K_4\), \(K_3\), and \(K_2\) that are part of G. The 3-uniform hypergraph \(G_1\) is still in case (iv) and it is a realization of \(\pi _1\).

Finally, let us consider the sequence \(\pi _1=(10,9,9,8,8,8,5,3)\), and verify that \(\pi _1'=(4,4,3,4,4,1,0)\) is graphic. The related \(\pi _1''=(5,5,5,4,4,4,3)\) is greater than \(\pi ''\) in the dominance order and consequently it admits a fortiori a 3-uniform realization as stated in Theorem 4, case (iv) (see the hypergraph \(G_1\) in Fig. 4).

Corollary 1

Let \(\pi =(d_1,\dots ,d_n)\) be a nonincreasing integer sequence satisfying the hypothesis of Theorem 4. The reconstruction of a 3-uniform hypergraph consistent with \(\pi \) can be performed in P-time.

In the proof of Theorem 4 we defined the algorithm to reconstruct the adjacency matrix of a 3-uniform hypergraph consistent with \(\pi \). It is easy to check that all the steps can be performed in P-time (with respect to the dimensions of the matrix) and they are recursively called polynomially many times.

4 Conclusion and Open Problems

Our study gave a new sufficient condition for a sequence \(\pi \) of integers to be the degree sequence of a 3-uniform hypergraph, that can be efficiently checked. Furthermore, we also defined a polynomial time algorithm to reconstruct the adjacency matrix of a 3-uniform hypergraph realizing \(\pi \) if such hypergraph exists.

The defined condition and the algorithm are tuned for 3-uniform hypergraphs. An open problem is to find similar conditions for h-uniform hypergraphs, with \(h\ge 4\).

One of the most important feature in discrete tomography is the study of the instances of a reconstruction problem admitting a unique realization. So, another interesting open problem is to characterize such instances in the case of the reconstruction of uniform hypergraphs. On the opposite side, another challenge is to count the number of realizations of a given graphic sequence. The interested reader can find some hints in this direction both in the last part of [2], and in [23].

Coming to an end, we recalled that the characterization of the degree sequences of h-uniform hypergraphs, with \(h\ge 3\), is an NP-hard problem. So, under the assumption that \(P\ne NP\), there is no hope to find a good characterization of them, but it would be of great interest to find a compact nice looking one in order to design algorithms for real-life applications.