1 Introduction

Representing graphs as the contact of geometric objects has been an area of active research for many years (see Hliněný and Kratochvíl’s survey [15] and Alam’s thesis [1]). Most of this work concerns representation in two dimensions, though there has been some interest in three-dimensional representation as well [2, 3, 5, 13, 25]. Representations in 3d typically use 3d geometric objects that touch properly i.e., their intersection is a positive area 2d face. In contrast, our main focus is on contact representation of graphs and hypergraphs using non-intersecting (open, “filled”) planar polygons in 3d. Two polygons are in contact if they share a corner vertex. Note that two triangles that share two corner vertices do not intersect and a triangle and rectangle that share two corners, even diagonally opposite ones, also do not intersect. However, no polygon contains a corner of another except at its own corner. A contact representation of a graph in 3d is a set of non-intersecting polygons in 3d that represent vertices. Two polygons share a corner point if and only if they represent adjacent vertices and each corner point corresponds to a distinct edge. We can see a contact representation of a graph \(G = (V,E)\) as a certain drawing of its dual hypergraph \(H_G=(E,\{E(v)\mid v \in V\})\) which has a vertex for every edge of G, and a hyperedge for every vertex v of G, namely the set E(v) of edges incident to v. We extend this idea to arbitrary hypergraphs: A non-crossing drawing of a hypergraph in 3d is a set of non-intersecting polygons in 3d that represent edges. Two polygons share a corner point if and only if they represent edges that contain the same vertex and each corner point corresponds to a distinct vertex. It is straightforward to observe that the set of contact representations of a graph G is the same as the set of non-crossing drawings of \(H_G\).

Many people have studied ways to represent hypergraphs geometrically [4, 6, 16], perhaps starting with Zykov [29]. A natural motivation of this line of research was to find a nice way to represent combinatorial configurations [14] such as Steiner systems (for an example, see Fig. 7). The main focus in representing hypergraphs, however, was on drawings in the plane. By using polygons to represent hyperedges in 3d, we gain some additional flexibility though still not all hypergraphs can be realized. Our work is related to Carmensin’s work [8] on a Kuratowski-type characterization of 2d simplicial complexes (sets composed of points, line segments, and triangles) that have an embedding in 3-space. Our representations are sets of planar polygons (not just triangles) that arise from hypergraphs. Thus they are less expressive than Carmensin’s topological 2d simplicial complexes and are more restricted. In particular, if two hyperedges share three vertices, the hyperedges must be coplanar in our representation.

Our work is also related to that of Ossona de Mendez [21]. He showed that a hypergraph whose vertex–hyperedge inclusion order has poset dimension d can be embedded into \(\mathbb {R}^{d-1}\) such that every vertex corresponds to a unique point in \(\mathbb {R}^{d-1}\) and every hyperedge corresponds to the convex hull of its vertices. The embedding ensures that the image of a hyperedge does not contain the image of a vertex and, for any two hyperedges e and \(e'\), the convex hulls of \(e\setminus e'\) and of \(e' \setminus e\) don’t intersect. In particular, the images of disjoint hyperedges are disjoint. Note that both Ossona de Mendez and we use triangles to represent hyperedges of size 3, but for larger hyperedges, he uses higher-dimensional convex subspaces.

Our Contribution. All of our representations in this paper use convex polygons while our proofs of non-representability hold even permitting non-convex polygons. We first show that recognizing segment graphs in 3d is \(\exists \mathbb {R}\)-complete.

We show that every graph on n vertices with minimum vertex-degree 3 has a contact representation by convex polygons in 3d, though the volume of the drawing using integer coordinates is at least exponential in n; see Sect. 2.

Table 1. Required volume and running times of our algorithms for drawing n-vertex graphs of certain graph classes in 3d

For some graph classes, we give 3d drawing algorithms which require polynomial volume. Table 1 summarizes our results. When we specify the volume of the drawing, we take the product of the number of grid lines in each dimension (rather than the volume of a bounding box), so that a drawing in the xy-plane has non-zero volume. Some graphs, such as the squares of even cycles, have particularly nice representations using only unit squares; see the full version of this paper [12].

For hypergraphs our results are more preliminary. There are examples as simple as the hypergraph on six vertices with all triples of vertices as hyperedges that cannot be drawn using non-intersecting triangles; see Sect. 3. Similarly, hypergraphs with too many edges of cardinality 4 such as Steiner quadruple systems do not admit 3d drawings using convex quadrilaterals. On the other hand, we show that the two smallest Steiner triple systems can be drawn using triangles. (We define these two classes of hypergraphs in Sect. 3.)

2 Graphs

It is easy to draw graphs in 3d using points as vertices and non-crossing line segments as edges – any set of points in general position (no three colinear and no four coplanar) will support any set of edge segments without crossings. A more difficult problem is to represent a graph in 3d using polygons as vertices where two polygons intersect to indicate an edge (note that here we do not insist on a contact representation, i.e., polygons are allowed to intersect arbitrarily). Intersection graphs of convex polygons in 2d have been studied extensively [19]. Recognition is \(\exists \mathbb {R}\)-complete [23] (and thus in PSPACE since \(\exists \mathbb {R} \subseteq \) PSPACE [7]) even for segments (polygons with only two vertices).

Every complete graph trivially admits an intersection representation by line segments in 2d. Not every graph, however, can be represented in this way, see e.g., Kratochvíl and Matoušek [18]. Moreover, they show that recognizing intersection graphs of line segments in the plane, called segment graphs, is \(\exists \mathbb {R}\)-complete. It turns out that a similar hardness result holds for recognizing intersection graphs of straight-line segments in 3d (and actually in any dimension). The proof modifies the corresponding proof for 2d by Schaefer [23]. See also the excellent exposition of the proof by Matoušek [20]. For the proof, as well as the proofs of other theorems marked with \(\spadesuit \), see the full version of this paper [12].

Theorem 1

(\(\spadesuit \)). Recognizing segment graphs in 3d is \(\exists \mathbb {R}\)-complete.

We consider contact representation of graphs in 3d where no polygons are allowed to intersect except at their corners, and two polygons share a corner if and only if they represent adjacent vertices. We start by describing how to construct a contact representation for any graph using convex polygons, which requires at least exponential volume, and then describe contructions for graph families that use only polynomial volume.

2.1 General Graphs

Lemma 1

For every positive integer \(n \ge 3\), there exists an arrangement of n lines \(\ell _1,\ell _2,\ldots ,\ell _n\) with the following two properties:

  1. (A1)

    line \(\ell _i\) intersects lines \(\ell _1, \ell _2, \dots , \ell _{i-1}, \ell _{i+1}, \dots \ell _n\) in this order, and

  2. (A2)

    distances between the intersection points on line \(\ell _i\) decrease exponentially, i.e., for every i it holds that

    $$\begin{aligned} d_{i}(j+2,j+1)&\le d_{i}(j+1,j)/2&\text {for } j \in \{1,\dots ,i-3\}\end{aligned}$$
    (1)
    $$\begin{aligned} d_{i}(i+1,i-1)&\le d_{i}(i-1,i-2)/2\end{aligned}$$
    (2)
    $$\begin{aligned} d_{i}(i+2,i+1)&\le d_{i}(i+1,i-1)/2 \end{aligned}$$
    (3)
    $$\begin{aligned} d_{i}(j+2,j+1)&\le d_{i}(j+1,j)/2&\text {for } j \in \{i+1,\dots ,n-2\}, \end{aligned}$$
    (4)

    where \(d_{i}(j,k)\) is the xy-plane distance between \(p_{i,j}\) and \(p_{i,k}\) and \(p_{i,j} = p_{j,i}\) is the intersection point of \(\ell _i\) and \(\ell _j\).

Proof

We construct the grid incrementally. We start with the x-axis as \(\ell _1\), the y-axis as \(\ell _2\), and the line through (1, 0) and \((0,-1)\) as \(\ell _3\); see Fig. 1. Now suppose that \(i > 3\), we have constructed lines \(\ell _1,\ell _2,\ldots ,\ell _{i-1}\), and we want to construct \(\ell _i\). We fix \(p_{i-1,i}\) to satisfy \(d_{i-1}(i,i-2) = d_{i-1}(i-2,i-3)/2\) then rotate a copy of line \(\ell _{i-1}\) clockwise around \(p_{i-1,i}\) until it (as \(\ell _i\)) satisfies another of the inequalities in (1) with equality. Note that during this rotation, all inequalities in (A2) are satisfied and we do not move any previously constructed lines, so the claim of the lemma follows.   \(\square \)

Fig. 1.
figure 1

Construction of \(\ell _4\) in the proof of Lemma 1.

Fig. 2.
figure 2

The polygon \(P_i\) that represents vertex i of \(K_n\).

Theorem 2

For every \(n \ge 3\), the complete graph \(K_n\) admits a contact representation by non-degenerate convex polygons in 3d, each with at most \(n-1\) vertices. Such a representation can be computed in \(O(n^2)\) time (assuming unit cost for arithmetic operations on coordinates).

Proof

Take a grid according to Lemma 1. Set the z-coordinate of point \(p_{i,j}\) to \(\min \{i,j\}\) and represent vertex i by the polygon \(P_i\), which we define to be the convex hull of \(\{p_{i,1}, p_{i,2}, \dots , p_{i,i-1}, p_{i,i+1}, \dots p_{i,n}\}\). Note that \(P_i\) is contained in the vertical plane that contains line \(\ell _i\); see Fig. 2. To avoid that \(P_1\) is degenerate, we reduce the z-coordinate of \(p_{1,2}\) slightly.

Note that, for \(i=2,\dots ,n-1\), the counterclockwise order of the vertices around \(P_i\) is

$$p_{i,1}, p_{i,2}, \dots , p_{i,i-1}, p_{i,n}, p_{i,n-1}, \dots , p_{i,i+1}, p_{i,1}.$$

We show that all these points are on the boundary of \(P_i\) by ensuring that the angles formed by three consecutive points are bounded by \(\pi \). Clearly the angles \(\angle p_{i,i+1} p_{i,1} p_{i,2}\) and \(\angle p_{i,i-1} p_{i,n} p_{i,n-1}\) are at most \(\pi \). For \(j=2,\dots ,i-2\), we have that \(\angle p_{i,j-1}p_{i,j}p_{i,j+1}<\pi \), which is due to the fact that the z-coordinates increase in each step by 1, while the distances decrease (property (A2)). Note that \(\angle p_{i,i+1},p_{i,i+2},p_{i,i+3}= \dots = \angle p_{i,n-2},p_{i,n-1},p_{i,n} = \pi \). Finally, we claim that \(\angle p_{i,i-2},p_{i,i-1},p_{i,n} < \pi \). Clearly, \(z(p_{i,i-1})-z(p_{i,i-2})=1=z(p_{i,n})-z(p_{i,i-1})\). The claim follows by observing that, due to property (A2) and the geometric series formed by the distances,

$$d_{i}(i-1,n) = d_{i}(i-1,i+1) + \sum _{k=i+1}^{n-1} d_{i}(k,k+1) < 2d_{i}(i-1,i+1) \le d_{i}(i-2,i-1).$$

It remains to show that, for \(1 \le i < j \le n\), polygons \(P_i\) and \(P_j\) do not intersect other than in \(p_{i,j}\). This is simply due to the fact that \(P_j\) is above \(P_i\) in \(p_{i,j}\), and lines \(\ell _i\) and \(\ell _j\) only intersect in (the projection of) this point.   \(\square \)

Corollary 1

Every graph with minimum vertex-degree 3 admits a contact representation by convex polygons in 3d.

Proof

Let n be the number of vertices of the given graph \(G=(V,E)\). We use the contact representation of \(K_n\) and modify it as follows. For every pair \(\{i,j\} \not \in E\), just remove the point \(p_{i,j}\) before defining the convex hulls.   \(\square \)

We can make the convex polygons of our construction strictly convex if we slightly change the z-coordinates. For example, decrease the z-coordinate of \(p_{i,j}\) by \(\delta / d_{\min \{i,j\}}(1,\max \{i,j\})\), where \(\delta \) is such that moving every point by at most \(\delta \) doesn’t change the orientation of any four non-coplanar points.

Let us point out that Erickson and Kim [11] describe a construction of pairwise face-touching 3-polytopes in 3d that may provide the basis for a different representation in our model of a complete graph.

While we have shown that all graphs admit a 3d contact representation, these representations may be very non-symmetric and can have very large coordinates. This motivates the following question and specialized 3d drawing algorithms for certain classes of (non-planar) graphs; see the following subsections.

Open Problem 1

Is there a polynomial p such that any n-vertex graph has a 3d contact representation with convex polygons on a grid of size p(n)?

Fig. 3.
figure 3

A 3d contact representation of a bipartite graph.

2.2 Bipartite Graphs

Theorem 3

Every bipartite graph \(G=(A \cup B,E)\) admits a contact representation by convex polygons whose vertices are restricted to a cylindrical grid of size \(|A| \times 2|B|\) or to a 3d integer grid of size \(|A|\times 2|B| \times 4|B|^2\). Such a representation can be computed in O(|E|) time.

Proof

Let G be the given bipartite graph with bipartition (AB). We place the vertices of the A-polygons vertically above the corners of a regular 2|B|-gon in the xy-plane. Each A-polygon goes to its own horizontal plane; the planes are one unit apart. For an example, see Fig. 3. For each \(v \in B\), the polygon \(p_v\) that represents v has a vertical edge above a unique even corner of the 2|B|-gon. This vertical edge connects the bottommost A-polygon incident to \(p_v\) to the topmost A-polygon incident to \(p_v\). All the intermediate vertices of \(p_v\) are placed on the vertical line through the clockwise next corner of the 2|B|-gon. This makes sure that all vertices of \(p_v\) lie in one plane, and \(p_v\) does not intersect any other B-polygon.

Due to convexity, the interiors of the A-polygons project to the interior of the 2|B|-gon. Each B-polygon projects to an edge of the 2|B|-gon. Hence, the A- and B-polygons are interior-disjoint.

Note that the polygons constructed by the argument above are not strictly convex. We can obtain a representation with strictly convex polygons by using a finer grid (\(|A| \times |E|/2\)) on the cylinder. If we insist on representations on the integer grid, we can replace the regular 2|B|-gonal base of the cylinder by a strictly convex drawing of the 2|B|-cycle. Using grid points on the 2d unit parabola, we obtain a 3d representation of size \(|A|\times 2|B| \times 4|B|^2\).   \(\square \)

If we apply Theorem 3 to \(K_{3,3}\), we obtain a representation with three horizontal equilateral triangles and three vertical isosceles triangles, but with a small twist we can make all triangles equilateral. For the proof, see the full version.

Proposition 1

(\(\spadesuit \)). The graph \(K_{3,3}\) admits a contact representation in 3d using unit equilateral triangles.

2.3 1-Planar Cubic Graphs

A simple consequence of the circle-packing theorem [17] is that every planar graph (of minimum degree 3) is the contact graph of convex polygons in the plane. In this section, we consider a generalization of planar graphs called 1-planar graphs that have a drawing in 2d in which every edge (Jordan curve) is crossed at most once.

Our approach to realizing these graphs will use the medial graph \(G_\mathrm {med}\) associated with a plane graph G (or, to be more general, with any graph that has an edge ordering). The vertices of \(G_\mathrm {med}\) are the edges of G, and two vertices of \(G_\mathrm {med}\) are adjacent if the corresponding edges of G are incident to the same vertex of G and consecutive in the circular ordering around that vertex. The medial graph is always 4-regular. If G has no degree-1 vertices, \(G_\mathrm {med}\) has no loops. If G has minimum degree 3, \(G_\mathrm {med}\) is simple. Also note that \(G_\mathrm {med}\) is connected if and only if G is connected.

Theorem 4

Every 1-plane cubic graph with n vertices can be realized as a contact graph of triangles with vertices on a grid of size \((3n/2-1) \times (3n/2-1) \times 3\). Given a 1-planar embedding of the graph, it takes linear time to construct such a realization.

Proof

Let G be the given 1-plane graph. Let \(G_\mathrm {med} '\) be the medial graph of G with the slight modification that, for each pair \(\{e,f\}\) of crossing edges, \(G_\mathrm {med} '\) has only one vertex \(v_{ef}\), which is incident to all (up to eight) edges that immediately precede or succeed e and f in the circular order around their endpoints; see Fig. 4a. The order of the edges around \(v_{ef}\) is the obvious one. Using Schnyder’s linear-time algorithm [24] for drawing 3-connected graphsFootnote 1 straight-line, we draw \(G_\mathrm {med} '\) on a planar grid of size \((3n/2-1) \times (3n/2-1)\). Note that this is nearly a contact representation of G except that, in each crossing point, all triangles of the respective four vertices touch. Figure 4b is a sketch of the resulting drawing (without using Schnyder’s algorithm) for the graph in Fig. 4a.

We add, for each crossing \(\{e,f\}\), a copy \(v'_{ef}\) of the crossing point \(v_{ef}\) one unit above. Then we select an arbitrary one of the two edges, say \(e=uv\). Finally we make the two triangles corresponding to u and v incident to \(v'_{ef}\) without modifying the coordinates of their other vertices. The labels in Fig. 4b are the resulting z-coordinates for our example; all unlabeled triangle vertices lie in the xy-plane.

Fig. 4.
figure 4

1-plane cubic graphs admit compact triangle contact representations.

Fig. 5.
figure 5

left: graphs G (here a B-configuration, gray) and \(G_\mathrm {med} '\); center: straight-line drawing of \(G_\mathrm {med} '\); right: resulting 3d representation of G (numbers are z-coordinates).

If a crossing is on the outer face of G, it can happen that a vertex of G incident to the crossing becomes the outer face of \(G_\mathrm {med} '\); see Fig. 5 where this vertex is called a and the crossing edges are ac and bd. Consider the triangle \(\varDelta _a\) that represents a in \(G_\mathrm {med} '\). It covers the whole drawing of \(G_\mathrm {med} '\). To avoid intersections with triangles that participate in other crossings, we put the vertex of \(\varDelta _a\) that represents the crossing to \(z=-1\), together with the vertex of the triangle \(\varDelta _c\) that represents c.

Our 3d drawing projects vertically back to the planar drawing, so all triangles are interior disjoint (with the possible exception of a triangle that represents the outer face of \(G_\mathrm {med} '\)). Triangles that share an edge in the projection are incident to the same crossing – but this means that at least one of the endpoints of the shared edge has a different z-coordinate. Hence, all triangle contacts are vertex–vertex contacts. Note that some triangles may touch each other at \(z=1/2\) (as the two central triangles in Fig. 4b), but our contact model tolerates this.   \(\square \)

Fig. 6.
figure 6

Representing a 2-edge-connected cubic graph G by touching triangles in 3d: (a) partition of the edge set into disjoint cycles and a perfect matching (the numbers denote a permutation of the matching edges); (b) the graph H; (c) 3d contact representation of G; the numbers inside the triangles indicate the z-coordinates of the triangle apexes (above h), the small numbers denote the non-zero z-coordinates of the vertices.

2.4 Cubic Graphs

We first solve a restricted case and then show how this helps us to solve the general case of cubic graphs.

Lemma 2

Every 2-edge-connected cubic graph with n vertices can be realized as a contact graph of triangles with vertices on a grid of size \(3 \times n/2 \times n/2\). It takes \(O(n \log ^2 n)\) time to construct such a realization.

Proof

By Petersen’s theorem [22], any given 2-edge-connected cubic graph G has a perfect matching. Note that removing this matching leaves a 2-regular graph, i.e., a set of vertex-disjoint cycles \(C_1,\dots ,C_k\); see Fig. 6(a). Such a partition can be computed in \(O(n \log ^2 n)\) time [10]. Let \(n=|V(G)|\) and \(n_1=|V(C_1)|, \dots , n_k=|V(C_k)|\). Note that \(n=n_1+\dots +n_k\). We now construct a planar graph \(H=(V,E)\) with \(n+1\) vertices that will be the “floorplan” for our drawing of G. The graph H consists of an n-wheel with outer cycle \(v_{1,1},\dots ,v_{1,n_1},\dots ,v_{k,1},\dots ,v_{k,n_k}\), n spokes and a hub h, with additional chords \(v_{1,1}v_{1,n_1}, v_{2,1}v_{2,n_2}, \dots , v_{k,1}v_{k,n_k}\). We call the edges \(v_{1,n_1}v_{2,1}, \dots , v_{k,n_k}v_{1,1}\) dummy edges (thin gray in Fig. 6(b) and (c)) and the other edges on the outer face of the wheel cycle edges.

The chords and cycle edges form triangles with apex h. More precisely, for every \(i \in \{1,\dots ,k\}\), the chord-based triangle \(\varDelta v_{i,1}v_{i,n_i}h\) and the \(n_i-1\) cycle-based triangles \(\varDelta v_{i,1}v_{i,2}h, \dots , \varDelta v_{i,n_i-1}v_{i,n_i}h\) together represent the \(n_i\) vertices in the cycle \(C_i\) of G. For each \(C_i\), we still have the freedom to choose which vertex of G will be mapped to the chord-based triangle of H. This will depend on the perfect matching in G. The cycle edges will be drawn in the xy-plane (except for those incident to a chord edge); their apexes will be placed at various grid points above h such that matching triangles touch each other. The chord-based triangles will be drawn horizontally, but not in the xy-plane.

In order to determine the height of the triangle apexes, we go through the edges of the perfect matching in an arbitrary order; see the numbers in Fig. 6(a). Whenever an endpoint v of the current edge e is the last vertex of a cycle, we represent v by a triangle with chord base. We place the apexes of the two triangles that represent e at the lowest free grid point above h; see the numbers in Fig. 6(c). Our placement ensures that, in every cycle (except possibly one, to be determined later), the chord-based triangle is the topmost triangle. This guarantees that the interiors of no two triangles intersect (and the triangles of adjacent vertices touch).

Now we remove the chords from H. The resulting graph is a wheel; we can simply draw the outer cycle using grid points on the boundary of a \((3 \times n/2\))-rectangle and the hub on any grid point in the interior. (For the smallest cubic graph, \(K_4\), we would actually need a \((3\times 3)\)-rectangle, counting grid lines, in order to have a grid point in the interior, but it’s not hard to see that \(K_4\) can be realized on a grid of size \(3 \times 2 \times 2\).) If one of the k cycles encloses h in the drawing (as \(C_1\) in Fig. 6(c)), we move its chord-based triangle from \(z=z^\star >0\) to the plane \(z=-1\), that is, below all other triangles. Let \(i^\star \) be the index of this cycle (if it exists). Note that this also moves the apex of the triangle that is matched to the chord-based triangle from \(z=z^\star \) to \(z=-1\). In order to keep the drawing compact, we move each apex with z-coordinate \(z'>z^\star \) to \(z'-1\). Then the height of our drawing equals exactly the number of edges in the perfect matching, that is, n/2.

The correctness of our representation follows from the fact that, in the orthogonal projection onto the xy-plane, the only pairs of triangles that overlap are the pairs formed by a chord-based triangle with each of the triangles in its cycle and, if it exists, the chord-based triangle of \(C_{i^\star }\) with all triangles of the other cycles. Also note that two triangles \(\varDelta v_{i,j-1}v_{i,j}h\) and \(\varDelta v_{i,j}v_{i,j+1}h\) (the second indices are modulo \(n_i\)) that represent consecutive vertices in \(C_i\) (for some \(i \in \{1,\dots ,k\}\) and \(j \in \{1,\dots ,n_i\}\)) touch only in a single point, namely in the image of \(v_{i,j}\). This is due to the fact that vertices of G that are adjacent on \(C_i\) are not adjacent in the matching, and for each matched pair its two triangle apexes receive the same, unique z-coordinate.

We do not use all edges of H for our 3d contact representation of G. The spokes of the wheel are the projections of the triangle edges incident to h. The k dummy edges don’t appear in the representation (but play a role in the proof of Theorem 5 ahead).   \(\square \)

In order to generalize Lemma 2 to any cubic graph G, we use the bridge-block tree of G. This tree has a vertex for each 2-edge-connected component and an edge for each bridge of G. The bridge-block tree of a graph can be computed in time linear in the size of the graph [28]. The general idea of the construction is the following. First, remove all bridges from G and, using some local replacements, transform each connected component of the obtained graph into a 2-edge-connected cubic graph. Then, use Lemma 2 to construct a representation of each of these graphs. Finally, modify the obtained representations to undo the local replacements and use the bridge-block tree structure to connect the constructed subgraphs, restoring the bridges of G. The proof is in the full version.

Theorem 5

(\(\spadesuit \)). Every cubic graph with n vertices can be realized as a contact graph of triangles with vertices on a grid of size \(3n/2 \times 3n/2 \times n/2\). It takes \(O(n \log ^2 n)\) time to construct such a realization.

Corollary 2

Every graph with n vertices and maximum degree 3 can be realized as a contact graph of triangles, line segments, and points whose vertices lie on a grid of size \(3\lceil n/2 \rceil \times 3 \lceil n/2 \rceil \times \lceil n/2 \rceil \). It takes \(O(n \log ^2 n)\) time to construct such a realization.

Proof

If n is odd, add a dummy vertex to the given graph. Then add dummy edges until the graph is cubic. Apply Theorem 5. From the resulting representation, remove the triangle that corresponds to the dummy vertex, if any. Disconnect the pairs of triangles that correspond to dummy edges.   \(\square \)

3 Hypergraphs

We start with a negative result. Hypergraphs that give rise to simplicial 2-complexes that are not embeddable in 3-space also do not have a realization using touching polygons. Carmesin’s example of the cone over the complete graph \(K_5\) is such a 2-complexFootnote 2, which arises from the 3-uniform hypergraph on six vertices whose edges are \(\{\{i,j,6\} :\{i,j\} \in [5]^2 \}\). Recall that d-uniform means that all hyperedges have cardinality d. Any 3-uniform hypergraph that contains these edges also cannot be drawn. For example, \(\mathcal {K}^d_n\), the complete d-uniform hypergraph on \(n \ge 6\) vertices for \(d = 3\) does not have a non-crossing drawing in 3d. For an elementary proof of this fact, see the full version.

Note that many pairs of hyperedges share two vertices in these graphs. This motivates us to consider 3-uniform linear hypergraphs, i.e., hypergraphs where pairs of edges intersect in at most one vertex. Very symmetric examples of such hypergraphs are Steiner systems. Recall that a Steiner system S(tkn) is an n-element set S together with a set of k-element subsets of S (called blocks) such that each t-element subset of S is contained in exactly one block. In particular, examples of 3-uniform hypergraphs are Steiner triple systems S(2, 3, n) [27]. They exist for any vertex number in \(\{6k+1, 6k+3 :k \in \mathbb {N}\}\). For \(n = 7, 9, 13, \dots \), the corresponding 3-uniform hypergraph has \(n(n-1)/6\) hyperedges and is \(((n-1)/2)\)-regular.

First we show that the two smallest triple systems, i.e., S(2, 3, 7) (also called the Fano plane) and S(2, 3, 9), admit non-crossing drawings in 3d. See Fig. 7 for the picture of the representation of the Fano plane. The proofs of the results stated in this section can be found in the full version. Actually, the existence of such representations follows from Ossona de Mendez’ work [21] (see introduction) since both hypergraphs have incidence orders of dimension 4 (which can be checked by using an integer linear program). His approach, however, yields coordinates that are exponential in the number of vertices.

Fig. 7.
figure 7

The Fano plane and a drawing using touching triangles in 3d

Proposition 2

(\(\spadesuit \)). The Fano plane S(2, 3, 7) and the Steiner triple system S(2, 3, 9) admit non-crossing drawings using triangles in 3d.

Now we turn to a special class of 4-uniform hypergraphs; Steiner quadruple systems S(3, 4, n) [26]. They exist for any vertex number in \(\{6k+2, 6k+4 :k \in \mathbb {N}\}\). For \(n = 8, 10, 14, \dots \), the corresponding 4-uniform hypergraph has \(m=\left( {\begin{array}{c}n\\ 3\end{array}}\right) /4\) hyperedges and is \(4m/n=(n-1)(n-2)/6\)-regular. We now show that no Steiner quadruple system admits a drawing using convex quadrilaterals in 3d.

Observation 1

In a non-crossing drawing of a Steiner quadruple system using quadrilaterals in 3d, every plane contains at most four vertices.

Proof

Suppose that there is a drawing R and a plane \(\varPi \) that contains at least five vertices. Let ab be a maximum length edge of the convex hull of the points in the plane \(\varPi \). No four, say wxyz in that order, can be collinear or the quadrilateral containing wyz is either wxyz, which is degenerate (a line segment), or it contains x on its perimeter but x is not a corner, a contradiction. Thus the set S of vertices on \(\varPi \) that are not on the edge ab has size at least two. If there exist \(u,v \in S\) such that abu and abv formFootnote 3 two distinct quadrilaterals with ab then these quadrilaterals intersect in the plane (they are both on the same side of ab), a contradiction. If no such pair exists then S contains exactly two points and they form one quadrilateral with ab, which must contain the other vertex in \(\varPi \) (on the edge ab) that is not a corner, a contradiction.   \(\square \)

Observation 1 is the starting point for the following result.

Proposition 3

(\(\spadesuit \)). The Steiner quadruple system S(3, 4, 8) does not admit a non-crossing drawing using (convex or non-convex) quadrilaterals in 3d.

Theorem 6

No Steiner quadruple system admits a non-crossing drawing using convex quadrilaterals in 3d.

Proof

Day and Edelsbrunner [9, Lemma 2.3] used an approach similiar to that of Carmesin (mentioned in footnote 2) to show that the number of triangles spanned by n points in 3d is less than \(n^2\) if no two triangles have a non-trivial intersection. (A trivial intersection is a common point or edge.) We need to redo their proof taking lower-order terms into account. If a Steiner quadruple system S(3, 4, n) can be drawn using quadrilaterals in 3d, the intersection of these quadrilaterals with a small sphere around a vertex is a planar graph. Recall that any S(3, 4, n) has n vertices and \(m=\left( {\begin{array}{c}n\\ 3\end{array}}\right) /4\) quadruples. Let v be any vertex. Then v is incident to \(4m/n=(n-1)(n-2)/6\) quadrilaterals. Breaking these (convex) quadrilaterals into \((n-1)(n-2)/3\) triangles yields a graph on \(n-1\) vertices (that is, on all but v) with \((n-1)(n-2)/3\) edges. For \(n>9\), this graph cannot be planar. The only Steiner quadruple system with at most nine vertices is S(3, 4, 8), hence Proposition 3 yields our claim.   \(\square \)

4 Conclusion and Open Problems

In Sect. 3 we discussed the Fano plane and other Steiner systems. The Fano plane is the smallest projective plane. Can the second smallest projective plane, PG(3), which is the Steiner quadruple system S(2, 4, 13), be drawn in 3d, such that each edge is a (convex) quadrilateral? To this end, we make the following observation (proved in the full version): If there is a drawing of PG(3) in which every edge is a convex quadrilateral, then no two quadrilaterals are coplanar.