Manuscript Offprint
arXiv:2610.36516Upper and Lower Bounds on the Complexity of Unit-Distance Graph Realization in
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Upper and Lower Bounds on the Complexity of Unit-Distance Graph Realization in
Eric Binnendyk
October 26, 2026
Abstract
It is known that the problem of recognizing the existence of a unit-distance realization in for a graph is NP-complete. Here, assuming ETH, we give a sub-exponential lower bound of for this problem in and in , and give an upper bound of for the time complexity with an explicit divide-and-conquer algorithm. This approach beats naive exhaustive search by a factor of in the exponent. For 2 and 3 dimensions, our upper and lower bounds match to within a logarithmic factor.
In this paper, we study the complexity of unit-distance graph recognition for , the d-dimensional square grid lattice. This problem is also called partial grid recognition by de Sá et al. [4] We call a unit-distance realization of in a d-dimensional grid embedding for short.
This problem is known to be NP-complete for dimensions by a result of Bhatt and Cosmadakis, reducing the problem to NA3SAT (a variation of 3SAT) [1], and is also NP-complete for dimensions due to the graph prism construction introduced by de Sá et al. [4]
One might wonder if we can determine anything about the exact complexity of this problem, assuming . A naive approach to this problem is to place one vertex at a specified location, do a depth-first search on , and exhaustively try each of the 2d possible locations for each vertex that are one unit away from its parent. For each location, check that all cross-edges and back-edges are also unit distance. This algorithm runs in time . One might wonder if, under suitable hardness assumptions, a algorithm is the best possible.
In this paper, we show that it is not, and we present a algorithm for partial grid recognition based on the paradigm of divide-and-conquer across light balanced cuts of G. A cut of G is defined to be light if it is crossed by fewer than edges, and balanced if it has at least cn vertices on both sides, where c is some positive constant independent of n (but dependent on d). The idea behind our sub-exponential search algorithm is that if we can prove the existence of a light balanced cut in any grid-embedding graph G that corresponds to a geometric cut in , we can reduce the problem to finding such a cut and embedding the induced subgraphs of G in non-overlapping bounding boxes on either side of the cut in such a way that the cut-adjacent vertices line up.
The problem of partial grid recognition is equivalent to determining if G is an edge-induced subgraph of a grid graph, as defined in Wolfram MathWorld: [8]. As such, partial grid recognition is a special case of the subgraph isomorphism problem, which is known to be NP-complete in general, although there are known polynomial time algorithms when restricted to certain subclasses of graphs, such as planar graphs. [6]
Unit-distance graphs have been an object of mathematical study going back to the 1940s with work by Paul Erdős. Erdős posed the unit distance problem in 1946, which asks, given points in , what is the maximum number of pairs of points that can be one unit apart. A lower bound of , where , was recently proved by an OpenAI model [11], and was subsequently improved to by Will Sawin. [12]
The problem of unit-distance graph detection has mainly been studied in , in which space it was shown by Schaefer to be -complete by reduction to a geometric problem called Stretchability. [13] The class consists of all problems with polynomial-time reductions to the problem of deciding formulas over . To our knowledge, no previous work determines the complexity of this problem in for . At the end of [13], Schaefer says that it is an open question to understand the complexity of decision problems involving linkages in higher-dimensional real space.
The basis of Bhatt and Cosmadakis’ NP-hardness proof for unit-distance realizability in is the logic engine construction, simulating a logical formula with a graph. [1] Logic engines were also used by Eades and Whitesides in [5] to prove the hardness of the problem of nearest-neighbor realizability—the existence of a set of points in such that the nearest pairs of points are precisely the edges of a graph . A logic engine converts the satisfiability of an -variable -clause NAkSAT formula into the planar realizability of a graph with vertices and edges.
Other similar problems to unit-distance graph detection in have also been studied. For example, David Eppstein showed that if the restriction is added such that any path in of length has distance of in , the recognition problem is in P. [7]
2 Theorems about light balanced cuts
These theorems are the basis of our sub-exponential search algorithm.
2.1 Two-dimensional case
First, we write out the proof for the two-dimensional case, which is simplest and contains the same ideas as the higher-dimensional proofs.
Theorem 1: For any 2-dimensional grid embedding of a graph with vertices, there is a horizontal or vertical cut passing through at most edges with at least vertices on each side.
To prove this, we need some lemmas.
Lemma 1: Assume we have a set containing points where points are in columns with at least points and points are in rows with at least points, where . Then .
Proof: Call columns and rows with at least points heavy. Let be the union of all heavy columns and be the union of all heavy rows.
Let be the set of all heavy columns and be the set of all heavy rows. Because the elements of are pairwise disjoint with cardinality at least , . Similarly, .
Every heavy row and heavy column intersect at exactly one point in , which may or may not be a point in . Every point in is at one of these intersections. Therefore, .
We can also find a lower bound on . We know that and . Therefore, by a union bound, , and so .
Putting our upper and lower bound together, we have:
Solving for q, we get:
Since and , we have . Therefore:
QED.
Corollary: Let in the lemma above. Then .
Lemma 2: Call a column or row in V heavy if it has at least vertices, and call it light otherwise, as above. There is a light column or row C such that there are at least points with smaller x-coordinate and at least points with larger x-coordinate (or y-coordinate respectively) than points in C, where .
Proof of lemma 2: Let be the set of vertex locations of . As above, call a column or row in heavy if it has at least vertices. Let and be the sets of points in all heavy columns and all heavy rows respectively. By the above corollary, either or . Without loss of generality, assume . In this case, we will prove the existence of a light column with points on either side.
Sort the elements of by increasing -coordinate, breaking ties arbitrarily. Let be the median point or one of the two median points, depending on if is odd or even. If is in a light column then we are done, because we know that at least points are on either side of this column.
Otherwise, let be a point minimizing over all points in light columns. Then the set is a subset of . Therefore, or .
We know because we assumed the column containing the median point(s) is heavy. Without loss of generality, assume . The same logic works when with the sides reversed. Write and let and . Then . From we get . Because is in a light column, . QED.
We now give the proof of Theorem 1. Let be the set of vertex locations of . Lemma 2 says that there is either a column or a row of vertices with at least vertices on each side. Without loss of generality, assume is a column.
Consider the set of edges between points in and points in the next column , whose -coordinates differ by 1. Because all edges go orthogonally, an edge in one column cannot connect to multiple edges in a neighboring column. Thus, and there are at least vertices on each side of including the vertices in . QED.
2.2 Higher-dimensional case
The proof of light balanced cuts in d dimensions is very similar to the proof in 2 dimensions, so we skip the parts of the proofs that are almost identical.
The proof of correctness in 2 dimensions can be extended to d dimensions as follows.
Definition. An i-layer is a subset of V of the form .
Lemma 1: Let contain points. Let be the union of all -layers with at least points (“heavy” -layers), where . Define for all . Then there is a specific constant , dependent on and , such that .
Proof: Let be the set of all heavy -layers. Similar to the 2-dimensional case, we have .
Also similar to the 2-dimensional case, we can find upper and lower bounds on the size of , the set of points in heavy layers in all directions. Every set of i-layers, with one for each direction , intersect at exactly one point in , which may or may not be a point in . Therefore, .
We can also find a lower bound on . We have and so and .
As in the 2-dimensional case, the comparison between these bounds gives us a bound on a symmetric polynomial in all the :
What condition on the does this imply? First, assume all are equal to a common value , and let . Then the condition is equivalent to
We have , (because ). We also have for . By the intermediate value theorem, there is exactly one root of in . Call this root . Over the range , the condition is equivalent to .
Now go back to the original expression where the can be different. The partial derivatives of the expression with respect to each are negative for :
This means we can replace each with a smaller value in without decreasing the value. In particular, we can replace all with .
So our original inequality
implies
which as we showed above is equivalent to
QED.
Lemma 2: Let contain points and let . Then there is a direction such that there is a particular -layer defined by , with , where the sets and both contain at least points.
Proof. As the proof is similar to what we had in the 2-dimensional case, we just sketch it. Let be the direction given by Lemma 1. Sort all points in V by i-coordinate. If the median point or pair of points are in a column with fewer than points, then and we are done.
Otherwise, let be the closest point to the median point or two points, in this ordering, that is in an -layer with fewer than points; call this layer . Let be the set of points closer to the median than ; then . The ranks of the points in range from to . Assume comes before the median point; then has rank . We have , so and . If comes after the median point, the reasoning is similar. QED.
Note: If we knew , we could simplify the argument by only considering the last point in the lightest column before the median. That would require restricting the value of c, but we haven't yet tried this approach.
Theorem 2: For any -dimensional grid embedding of a graph with vertices, there is a plane perpendicular to one of the axes passing through fewer than edges with at least vertices on each side, where is a constant that depends only on . (Note that for any value of , for sufficiently large .)
Proof. Let be the direction and be the -layer given by Lemma 2 with . Consider the set of edges between points in and points in the next layer , whose -coordinates differ by 1. Because all edges go orthogonally, an edge in one column cannot connect to multiple edges in a neighboring column. Thus, and there are at least vertices on each side of including the vertices in . QED.
3 Our realization algorithm
Here, we present an exhaustive divide-and-conquer approach to determine partial grid recognition of a graph in time , beating naive search by a factor of in the exponent, by making use of the above theorems about light balanced cuts.
Our algorithm makes use of a recursive function . This function takes in a graph , a dimension parameter , a bounding box , and a function stored as a table mapping vertices to points. We either return an injective function such that for all , , and for each , , or determine that no such function exists. The function is also stored as a table mapping vertices to points.
We start with the base cases.
3.1 Base cases
One type of base case is a common situation for which we can guarantee no realization function exists. We immediately return False on these cases:
• If any has degree .
• If any point in the range of pts is outside the bounding box.
• If two inputs in S map to the same output under pts.
- If the same input in S maps to two outputs under pts (i.e. pts isn't actually a function). This could happen if the new cut was adjacent to a vertex that already had a mapping in the previous call.
We also have a base case for which the existence of a realization function is trivial. If and pts assigns a unique location inside the bounding box to the 0 or 1 points in , we return pts.
3.2 Main iteration and recursion
We iterate through every position of an orthogonal planar cut within . Each is given by a direction and a pair of consecutive -coordinates where . We also iterate through all of cardinality , and check if each is a cut in with a graph search algorithm. If contains two edges that share a vertex, skip this iteration (as it cannot be an orthogonal cut in a grid embedding). If is the number of connected components of , each is a cut for ordered pairs partitioning . We iterate through each such pair. We also iterate through every way to put the cut edges between the two hyperplanes: every injective function
For each , , we assume that the cut maps to a planar cut through in direction and position with crossing edges in positions given by . We make two recursive calls.
First, let and be the subgraphs induced by and respectively. Define new bounding boxes and by splitting the old bounding box in two. Define and to be the vertices in and respectively that are adjacent to edges in . Define by if and for where is the edge adjacent to . Define similarly, except where the vector is added to each output.
Now make two calls GridEmbed(G', d, , pts_1) and GridEmbed(G''', d, , pts_2). If either call returns False, continue to the next loop iteration. Otherwise, both calls return embedding functions of their graphs, and . Combine these functions into an embedding function by defining for and for and return .
3.3 Ending condition
If no iterations find valid realizations of and , return False.
3.4 The parent function call
To determine partial grid recognition of a connected graph in , we call , where and is the length-d vector whose entries are all . If is disconnected, we call the same function on all of its components and re-position the resulting embeddings so that they don't overlap.
3.5 Proof of correctness
Now we move on to the correctness proof of the algorithm, which follows from the theorems about light balanced cuts.
Claim: The function call GridEmbed(G, d, x, pts) returns a d-dimensional grid embedding of G with bounding box extending from to x and with v embedded at pts(v) for v in the domain of pts, if such an embedding exists, and returns false otherwise.
Proof of claim: First we observe that the recursion always terminates, because the subgraphs in the recursive calls have strictly fewer vertices than the original graph. Therefore, we eventually reach the base cases of 0 and 1 vertices, for which correctness is easily verified.
Assume by strong induction that GridEmbed is correct on all graphs with fewer than n vertices. Consider a call GridEmbed(G, d, x, pts) where and .
(⇒:) First, assume that has a grid embedding satisfying the above criteria. Theorem 2 says that there is a cut across fewer than edges between two parallel layers of vertices where each side has at least vertices. The rest of the embedding consists of two subgraphs and within smaller bounding boxes made by the intersection of the original bounding box with the two parallel planes.
The algorithm goes through all possible cuts with , so it finds this cut. It also goes through all possible positions of cut edges across all parallel layers in the bounding box, so it eventually finds the locations of the cut edges in the embedding.
The restriction of to subgraphs and gives two grid embeddings of and in smaller bounding boxes. However, any embeddings of and in their respective bounding boxes, as long as they have cut-edge-adjacent vertices in the same locations in addition to the restriction given by pts, can be connected with the cut edges to get another grid embedding of . (Note that because the two bounding boxes don't overlap, the vertices in the embedding won't overlap either.) We know that grid embeddings of the subgraphs exist. The algorithm GridEmbed modifies pts to add the restrictions about cut-edge-adjacent vertices in the two recursive calls. By the inductive hypothesis, some valid grid embeddings of and will be returned. Because they are inside the bounding boxes and have vertices in the designated places, they can be combined with to make a valid embedding of G, which will be returned by the parent call.
(⇐): Now assume that G has no valid grid embedding respecting the restrictions. We showed above that the only possible realization that GridEmbed can return is a valid grid embedding. Since there is no grid embedding of G, no realization can be returned, and so GridEmbed must return False. QED
3.6 Time complexity
Let be the time complexity of GridEmbed on a graph with vertices embedded in with a maximum bounding box edge length of and in components.
Then we have the following upper bound for the time complexity (note that we have due to the preconditions):
for any , for sufficiently large n relative to d.
Specifically, we want so that . Then, is an upper bound on the number of vertices in each of and .
Let . Note that for sufficiently small . Then we can unroll the recurrence relation into the following expression:
(Here, the exponent in the last term should contain a sum of for different values of i, but these terms have been replaced by the larger value to make calculation easier.)
We can rewrite some of these exponential expressions with a base of 2:
Note that because , and can be absorbed into the big .
If starts with disconnected components on the outermost call, we can call the algorithm separately for each disconnected component. So we can assume without loss of generality that . In this case, because , we have the following bound on the time complexity for a constant :
This beats exhaustive search by a factor of in the exponent.
4 Lower bounds
We now show how we can use NA3SAT reductions and the Exponential Time Hypothesis to find lower bounds of for unit-distance graph recognition in and for the same problem in .
First we show how to use Bhatt and Cosmadakis' reduction, along with the graph prism construction technique given in [4], to produce a lower bound of ( if not assuming constant ) for the -dimensional grid embedding problem, assuming ETH. This nearly matches the upper bound when .
4.1 Exponential Time Hypothesis and Sparsification Lemma
Note: On the day this paper was published to Arxiv, OpenAI announced a claimed disproof of ETH by means of an algorithm for k-SAT in time. This proof is currently under review. We expect that our lower bounds still hold with an extra factor of in the exponent under a weaker version of ETH that asserts there is no algorithm with time for 3-SAT instances with clauses for any , but this will need to be checked separately.
The Exponential Time Hypothesis is a conjecture formulated by Russell Impagliazzo and Mohan Paturi, which is the basis of many lower bounds in fine-grained complexity. [9]
Definition. The Exponential Time Hypothesis says that k-SAT cannot be solved in time for each , where n is the number of variables.
We will also need another tool to demonstrate that we can get away with making reductions from n-variable k-SAT instances with clauses only. This tool is the sparsification lemma, introduced in [10] by Impagliazzo, Paturi, and Zane in 1998. It says that for any k-SAT formula there is a formula with a constant multiple of n clauses with the same difficulty:
Theorem - sparsification lemma. There is an algorithm such that for every -CNF formula , the call runs in time and outputs a sequence of -CNF formulae, where , each has clauses, and the solution set of is the union of the solution set of each .
Corollary (Calabro, Impagliazzo, Paturi) [3]. Let be the problem of SAT restricted to input formulae with at most clauses. For each and , there is a value that is (for constant ) giving an time Turing reduction from -SAT to instances with the same number of variables.
Finally, because we are dealing with NAkSAT instead of k-SAT, we will need to demonstrate a reduction from k-SAT to NAkSAT for each value of k. We do this by applying clause splitting to a standard reduction from k-SAT to .
Theorem. Let be any function of . If -SAT with variables and clauses requires time, then NAkSAT with variables and clauses requires time.
Proof. Let be a -CNF formula with variables. For each , we define , where is a dummy variable. We define the formula . Then, any satisfying assignment for becomes a satisfying assignment for with . Furthermore, every satisfying assignment for can be assumed to have , possibly by negating variables. Then it corresponds to a satisfying assignment for . Now we define a formula by a technique called clause splitting. We introduce new variables and define and . If has a satisfying assignment, it can be converted to a satisfying assignment for by assigning for each . Furthermore, if has a satisfying assignment, the conditions on imply that the subset of values assigned to variables in produces a satisfying assignment for . The formula has variables and clauses. If a sub- algorithm for exists with these parameters, then the reduction can construct a sub- algorithm for -SAT. QED.
4.2 A lower bound for 3 dimensions
Here, we describe how to build a reduction from n-variable NA3SAT to 3D grid embedding of a graph with vertices. This shows that, assuming ETH, the problem of 3D grid graph embedding has time complexity .
Our construction uses a 3D version of the logic engine that encodes each variable as a set of connections between lines perpendicular to the center plane, taking advantage of the third dimension to avoid overlaps. There are such lines in total, and we use a graph coloring argument to show that layers are required for all the connections.

Figure 1: A corner of the 3D grid base. The “diagonal” lines go in the directions.
4.2.1 The base
The base of the 3D logic engine consists of a grid of vertices with two extra edges coming out of each vertex, three coming out of each edge vertex, and four coming out of each corner vertex. Each of these edges connects a grid vertex a to a “tassel” vertex that connects to no other vertices in the base.
This grid has only one embedding, besides rigid transformation and the rearrangement of non-grid edges. To see this, name the grid vertices according to their coordinate, where and range from 1 to some value that is . Each square of grid vertices must be embedded as a square in . Consider a single square with vertices . Assume that is embedded horizontally with a -coordinate of 0.
Note that each vertex of A has six neighbors. These six neighbors must take up all six adjacent locations in the grid. In a given embedding, let and be the two tassel vertices adjacent to a grid vertex a and embedded above and below the plane z = 0.
Consider edges and . They must be parallel in the embedding. That is because must be perpendicular to , and in two of the three options, or would overlap with one of the six vertices adjacent to . Similarly, edges and must be parallel. If two edges of a grid square have fixed embeddings at a right angle, the other two edges also have a unique embedding in the same plane. Starting from vertex , it follows by induction that the entire grid is embedded in a plane in .
4.2.2 Chains
A chain is a simple path with extra edges added to ensure the path is straight. Each chain is made of vertices for , where is the height. A grid graph of points (that is, a grid graph of squares), called a

Figure 2: Part of a chain
link, is connected to each vertex , with being identified with the middle point in the grid.
Two chains are added to the tassels around each grid point , where and range from 1 to , spanning the entire grid. These chains are indexed as and , and are called the positive chain and negative chain respectively. They are connected to the grid as follows: To we add an edge to vertex of and to we add an edge to vertex of .
We can prove that, in this setup, all but the last two links of any chain must be embedded in horizontal planes parallel to the base:
Theorem. Let be a graph consisting of a base and a chain connected by an edge , where is a tassel vertex attached to an internal grid vertex. In any grid embedding of , the first links must be in consecutive planes parallel to the base with in a line perpendicular to the base.
Proof. We proceed by strong induction. Assume that for , the first links are embedded in parallel planes. Assume without loss of generality that is a tassel pointing upwards from the base in the direction. If , then must be in the plane above because all other directions are taken by tassels or the base. If , must be in the plane above for the same reason. Of the four neighbors of in , assume by contradiction that one of them is above . Without loss of generality, say that points in the direction instead of the direction. Then has to be in the direction from . The vertex has six neighbors, including , but it is one unit away from a non-neighbor in the direction: either a tassel vertex (if ) or a vertex in (if ). This implies that there is not enough room to embed all neighbors of , a contradiction. Therefore, can only be embedded as a link above and parallel to link . QED.
Note that neighboring chains are four units apart and the embedding of each chain consisting of parallel links takes up a region of size 3 by 3 by . This is small enough that embeddings of multiple chains do not overlap. Therefore, the part of the graph consisting of the base and the chains has a number of 3-dimensional grid embeddings where each chain in a pair can be flipped up or down, perpendicular to the base. Apart from the embedding of the last link, each link must be embedded parallel to the base.

Figure 3: A single layer of chain links associated with variables in a 4-clause formula. Note that any two of the variables could be identical, but they still get separate chains.

Figure 4: A link with two flags added on opposite sides
4.2.3 Flags
Flags are a tool we will use to encode satisfiability constraints, as in the original logic engine design. For a chain link with center vertex e, a flag is a vertex f connected to one of the four neighbors of e. Observe that if there are links above and below e, or if e is the closest link to the base, f must be on the same layer as e, but it can be rotated or reflected into any of eight configurations (of which at most four are distinct up to labeling of vertices). The only way a chain link with flags could have no embedding is if, no matter how it is positioned, the flag overlaps with a flag of a different chain. Because neighboring chains are four units apart, this can only happen if two neighboring chains have flags pointing towards each other.
4.2.4 Encoding NA3SAT constraints
Let be the NA3SAT formula, with clauses. By the sparsification lemma, we can assume .
Make sure the base of the graph is sufficiently large to accommodate all gadgets, but still by .
Encode each clause in as a sequence of three consecutive horizontal chains with at least one empty row/column of chains in the horizontal/vertical directions between clauses.
To encode the clauses, add flags to the two links of each chain closest to the base. For the literal in clause , let be the corresponding chain. Let and be the nearest links on the positive and negative sides. If appears positively in , add two flags to opposite sides of and three flags on three sides of . If appears negatively, do the same with and swapped.

Figure 5: The layer directly above the base in the encoding of the NA3SAT formula , , , . The embedding uses the satisfying assignment , . Red chains mean the positive side is pointing up, blue chains mean the negative side is pointing up.
Put flags on all four sides of a link that is between two clauses in the same row.
Leave off all flags from the links in rows between clauses.
Theorem. Let be a NA3SAT formula and let be a logic engine graph with chains and flags added to encode (but no connections added; see below). For any family of assignments , the following two statements are equivalent:
• Each is a satisfying assignment for .
- There is an embedding of such that the chain corresponding to points in the direction if is true and the direction otherwise.
Proof. We focus on the three chains for the variables in and the surrounding chains. The two neighboring chains in each row have four flags on them, so no matter how they are oriented, a flag is sticking towards the first chain from the left and the third chain from the right. If the first chain has three flags, one of the flags must be pointing to the right as well. The same applies to the second chain, and so on by induction. If all chains have three flags, the third chain must have a flag pointing to the right, which clashes with the chain to the right. Thus no embedding is possible. On the other hand, if at least one link e has two flags, there is an embedding where every link in the row has flags pointing forward and backward, every link before e has flags pointing to the right, and every link after e has flags pointing to the left. The links on neighboring rows have no flags and so they do not interfere with this construction.
Furthermore, without adding connections, there is always a way to embed the chains corresponding to each clause (just set two literals to true and one to false, for instance). So without any other restrictions, an embedding of a single clause can be extended into an embedding of the rest of the structure.
So an embedding exists if and only if, on both the layers above and below the base, one of the links in has two flags instead of three. For the layer above

Figure 6: A variable connection between two chains (lower layer = black, upper layer = red)
the base, this means there is either a positive literal with a true variable or a negative literal with a false variable; for the layer below the base, vice versa. Thus, the constraints of NA3SAT are enforced. QED.
4.2.5 Encoding variable connections
We have a way of encoding satisfiability of individual clauses. But we need a way of ensuring that the same variable in different clauses gets the same truth value. We accomplish this with variable connections.
Definition. Between any two chains and , a variable connection at height is a simple path between link of the positive side of chain and link of the positive side of chain , connected to vertices which are themselves adjacent to the center of the links, and consisting of new vertices if and new vertices if , unless in which case there are new vertices.
Variable connections are not allowed to be placed on the first link (because of the flags) or the last two links of a chain (which are not guaranteed to be horizontal).
Canonical embeddings. Any variable connection has a standard embedding that is possible if the two chains either both point up or both point down. This embedding consists of starting from the link of (where we assume that ), going one step in the positive y direction, going left or right until the x-coordinate matches the empty space to the right of column , going up in the z direction one step, and then going in the positive y direction until we are directly to the right of the link of , and then going one step to the left to connect. Exception: If , we simply go forward one unit in the y direction, to the right, and then backward one unit to connect to the second link. It can be shown that this is always possible by rotating the links into the right orientation because of the number of vertices in the path.
We now show that canonical embeddings allow a variable connection to be embeddable precisely when it should be.
Theorem. Consider a graph G with a base, a field of chains, and flags on upper and lower layer 1. For any valid embedding f of G without connections added and any , can be extended to an embedding with a connection between chains and at height , if and only if the positive sides of and either both point up or both point down.
Proof. If they do point in the same direction, the endpoint links are on the same side. We can use the “standard” embedding described above on any two layers above layer 1, and there will be no clashes because the two layers have no flags.
If they do not point in the same direction, first note that the Manhattan distance between the two points in the canonical embedding is at most two units less than the length of the path in edges. Rotating the endpoints on the chains decreases the Manhattan distance by at most two on each side, so the minimum possible Manhattan distance between the endpoints when they are on the same side is . The Manhattan distance between the xy-components of the points is at least . If one of the two chains is flipped to the other side, the z-coordinates are at least 6 units apart. Therefore, the Manhattan distance between the two endpoints when they are on opposite sides is at least units. Therefore, any embedding of the connection between endpoints on opposite sides cannot go in two opposite directions at different steps, as this will require the path length to be at least the Manhattan distance plus two. Therefore, every point of the path must be inside the bounding box between the endpoints. But every such point on the base layer is taken by a vertex of the base, so there will be a clash. Thus, no embedding exists when the links are on opposite sides. QED.
However, we will need to add multiple variable connections to a single graph. We need a theorem telling us when two variable connections will never interfere with each other's embeddability.
Definition. The variable connection between and overlaps with the connection between and if any two chains, one from each pair, have the same x or y coordinate.
Theorem. If variable connections are added to the graph in the above theorem, the variable connection from to at height is embeddable if and point in the same direction and the VC does not overlap with any other variable connection at height . The VC from to is not embeddable if and point in opposite directions.
Proof. Notice that in the standard embedding, all the new vertices are placed on two lines: the row whose y-coordinate is two more than the center of chain on layer 2h (above or below the base), and the column whose x-coordinate is two more than the center of chain on layer . If two VCs on the same layer clash, then they must either use the same horizontal or vertical line for their vertices. Thus, they overlap in the sense described above. Furthermore, the “lower” layer of one connection cannot clash with the “upper” layer of another, because the former has even index and the latter has odd index. Thus if the value h is different for two connections, the two connections don’t overlap. QED.
To show that we can fit all our variable connections on a single graph without clashing, we need a special theorem, where we model the chains as a set of 2D grid points:
Theorem. Given an m by n grid of vertices with connections between certain pairs of points where each point has at most d connections incident to it. Draw each connection as a horizontal segment followed by a vertical segment (either of these segments can be of length 0). If the vertical parts or the horizontal parts of any two connections are in the same column or row respectively, they need to be colored different colors. Then there exists a coloring of all connections with at most colors and there is an efficient algorithm to find it.
The proof of this theorem uses an ingredient called Brooks' Theorem, which gives an upper bound on the chromatic number of a graph with bounded degree. Brooks' theorem is a classic theorem of graph theory, first proven by R. Leonard Brooks in 1941. [2] The intuition behind Brooks' Theorem is that if you build a graph, at some point you have so many vertex colors that a new vertex can't conflict with all of them.
Theorem (Brooks' Theorem). For any undirected graph G with maximum vertex degree , there is an efficient greedy algorithm to find a coloring of the vertices of G with colors, where no two neighboring vertices have the same color. In fact, if the graph is not a complete graph or a cycle, colors are needed.
Because we’re dealing with asymptotic complexity, we don’t need the conditional bound of colors and can use the greedy coloring bound of colors instead. The proof of the greedy bound is simply that, if colors are used, there will be at most colors that are unusable for each vertex, so the first color will be at most index .
From Brooks' Theorem, we can prove our theorem about grid connection coloring by modeling the grid connections as a graph.
Proof of above theorem. Build a graph G whose vertices are the grid connections, and edges are pairs of connections. Due to the maximum number of connections of each vertex, each connection overlaps (is in the same column/row as) at most other connections. Thus, the max degree of G is at most . By Brooks' Theorem, there is an efficient coloring of the vertices of G with at most colors, which leads to a coloring of connections where no two connections with the same color share the same row/column.
We now use the above theorems about grid connections on an abstract level to prove a bound on the number of layers needed for a certain number of connections.
Theorem. If a 3D logic engine graph has an m by n grid of chains and each chain has at most d connections, there is an algorithm to place the connections in layers so that they don't clash.
Proof. We build an abstract m by n grid where each point represents a chain and connect each pair of points that require a connection. Now the above theorem on colored connections applies. The condition for two connections to get different colors in the theorem (horizontal or vertical components in the same line) exactly matches the condition for two variable connections to get different layers to avoid clashing. This implies that, if we run the coloring algorithm, we can put connections of each color on a separate pair of layers and none will clash. The algorithm yields a solution with colors. Because each connection needs two layers, we use layers. QED.
4.2.6 Proof of main construction
Main theorem - 3-dimensional partial grid recognition reduction. There is a polynomial time reduction from any -variable -clause NA3SAT formula to a graph with vertices that has a unit-distance embedding in if and only if is satisfiable.
Proof. Build the base and the chains as described above, in an by grid, with the chains representing variables in each clause of and with extra chains between neighboring clauses. Add flags on the link layers nearest the base to encode the local NA3SAT constraints. For each Boolean variable in , list all the chains , , etc. corresponding to variable . Put a connection between each and . This ensures that in any embedding, chains and have the same truth value. By extension, all chains representing the same variable have the same truth value. Furthermore, the maximum number of connections each chain participates in is . Thus, the length of each chain is . This also ensures the maximum number of connections is .
The base of the graph has vertices. There are chains and each chain has vertices. There are also connections each with vertices. Thus, the entire graph has vertices. QED.
4.3 A lower bound for 3-dimensional grid embedding
Assuming ETH, the reduction from NA3SAT to 3-dimensional grid embedding implies a lower bound for the complexity of the latter problem.
Theorem. Assuming ETH, 3-dimensional grid embedding takes time
Proof. We use the sparsification lemma corollary with . Assuming ETH, on some input with variables, any algorithm for 3-SAT takes at least for some . Choose any , and use the corollary to fix a constant .
Let be an instance of 3-SAT with variables. We use the corollary to reduce to an instance of with variables and clauses. Then we use the reduction to convert this instance of to NA3SAT also with clauses, and then to a graph using our new reduction for grid embedding in . Then we check if is has a 3-dimensional grid embedding. The first reduction takes and makes oracle calls. The second reduction (to NA3SAT and then to ) takes time, which means the algorithm for verifying grid realizability of must take time. The graph has vertices, and . Thus, for all , has vertices. The time complexity of the realizability algorithm is then lower bounded by

Figure 7: Example graph prism construction.
. This leads us to our conclusion: conditional on ETH, any algorithm for 3-dimensional grid embedding takes at least runtime for at least one graph for each of an infinite number of values of . This is sufficient to prove that is a conditional lower bound for the complexity of this problem.
QED.
4.4 The graph prism construction: a lower bound for d-dimensional grid embedding
In [4], de Sá et al. define the prism of a graph to be the result of connecting the matching vertices of two copies of the graph. We use this construction to extend our result to a conditional lower bound for -dimensional grid embedding for all .
Definition. Let be . Then the prism of , prism, is defined as . (This is also the Cartesian product of with the complete graph .)
Note that the prism of a graph with n vertices has 2n vertices.
Now we show that any -dimensional grid embedding of leads to a -dimensional grid embedding of and vice versa. The proof of the 2D 3D case was given in [4]; our proof is a simple modification to arbitrary dimensions.
Definition. A lateral edge of prism(G) is an edge between duplicate vertices in the two copies of G.
Theorem. If G is connected, any d-dimensional grid embedding of prism(G) must have the two copies of G in neighboring parallel planes.
Proof: Let be a grid embedding of . We proceed by structural induction on the vertices of . For the base case, pick a vertex of , and let be the corresponding edge of . Let be the direction of the vector . Now let be a subset of vertices of containing . Assume by induction that the lateral edges of each vertex in are realized in direction between two parallel -planes one unit apart. Let be a vertex in not in that is connected to a vertex in . Let the corresponding lateral edges be and respectively. The only ways to realize and are:
• With being a vector in direction . Then must be the same vector in order for and to be 1 unit apart. But this means that either or , which are both impossible because vertices overlap. So this cannot happen.
• With and having i-coordinates of 0. Again, these two vectors must be identical. In this case, the edge is parallel to and only changes on a coordinate not equal to i. So lies between the same parallel planes as the lateral edges corresponding to vertices in V.
Because G is connected, this structural induction eventually reaches all vertices of G. Thus, all vertices in the same subgraph as have i-coordinates matching , and the same with . The entire realization therefore consists of two copies of G is parallel i-planes. QED.
Theorem. A graph G can be realized in if and only if prism(G) can be realized in .
Proof.
•
If has a -dimensional grid embedding, let be the realization function. Now define a realization function for by , . It can be shown that no vertices are overlapping and every edge has unit length in realization .
•
Assume can be realized in . If is a connected component of , then is a connected component of . Thus, every connected component of is realized in two parallel planes. Each of these connected components can be realized separately in to give a grid embedding of . QED.
Theorem. Assuming ETH, d-dimensional grid embedding takes time .
Proof. Just like above, we assume ETH and reduce satisfiability with variables to 3-dimensional partial grid recognition of a graph . The former problem, and hence the latter problem, must take time. We reduce to verifying grid realizability in of the graph , which has vertices. Now our lower bound for solving realizability in is . QED.
5 Future research
In the future, we plan to adapt this research to show similar lower bounds for the complexity of grid embedding in dimensions. We conjecture that there is a reduction from m-variable NA3SAT to d-dimensional partial grid recognition of a graph with vertices, implying a conditional lower bound of time. This matches our algorithm to a logarithmic factor in the exponent.
We also conjecture that a lower bound of holds for the complexity of partial grid recognition on any discrete -dimensional lattice with a basis of unit vectors, and that this lower bound is tight up to a logarithmic factor in the exponent.
We expect similar logic-engine-based constructions to work in these cases to prove NP-hardness, but it might be a bit harder to come up with a building block that we can ensure makes rigid structures.
We also want to research the hardness of unit-distance graph recognition in higher dimensions, not just in lattices but in . We expect that Schaeffer's Peaucellier-linkage based construction, which was used to show that unit-distance graph recognition in is -hard, can be extended to higher dimensions in a systematic way to show that the problem for is also -hard, but we are currently unaware of a specific extension.
6 Acknowledgements and AI usage
I give thanks to my academic advisors, Russell Impagliazzo and Mohan Paturi, for providing some critical insights regarding this paper. In particular, Russell suggested the idea of using a divide-and-conquer approach to show that partial grid recognition has a time algorithm. He also gave me the idea of proving the existence of light near-balanced cuts with union bounds, and helped me understand the sparsification lemma. Mohan gave me feedback on readability and connections to other results. I also give thanks to the mathematician David Eppstein at UC Irvine for looking at an earlier draft of this paper and pointing out that some of my results were previously known.
I did not use generative AI to write any text in this paper or prove any results. However, I used Google’s AI to get the statement of Brooks’ theorem after I rediscovered the greedy graph coloring bound myself and wanted a citation, and I used ChatGPT for proofreading an earlier draft of this paper. ChatGPT helped me find and fix errors in the definition of the cut-edge placement function in the algorithm and the proof of the reduction.
References
[1] Sandeep N. Bhatt and Stavros S. Cosmadakis. "The complexity of minimizing wire lengths in VLSI layouts". In: Information Processing Letters 25.4 (1987), pp. 263–267. ISSN: 0020-0190. DOI: https://doi.org/10.1016/0020-0190(87)90173-6. URL: https://www.sciencedirect.com/science/article/pii/0020019087901736.
[2] R. L. Brooks. “On colouring the nodes of a network”. In: Mathematical Proceedings of the Cambridge Philosophical Society 37.2 (1941), pp. 194–197. DOI: 10.1017/S030500410002168X.
[3] C. Calabro, R. Impagliazzo, and R. Paturi. “A duality between clause width and clause density for SAT”. In: 21st Annual IEEE Conference on Computational Complexity (CCC'06). 2006, 7 pp.–260. DOI: 10.1109/CCC.2006.6.
[4] Vinícius G.P. de Sá et al. “Complexity dichotomy on partial grid recognition”. In: Theoretical Computer Science 412.22 (2011), pp. 2370–2379. ISSN: 0304-3975. DOI: https://doi.org/10.1016/j.tcs.2011.01.018. URL: https://www.sciencedirect.com/science/article/pii/S0304397511000521.
[5] Peter Eades and Sue Whitesides. “The logic engine and the realization problem for nearest neighbor graphs”. In: Theoretical Computer Science 169.1 (1996), pp. 23–37. ISSN: 0304-3975. DOI: https://doi.org/10.1016/S0304-3975(97)84223-5. URL: https://www.sciencedirect.com/science/article/pii/S0304397597842235.
[6] David Eppstein. “Subgraph Isomorphism in Planar Graphs and Related Problems”. In: CoRR cs.DS/9911003 (1999). URL: https://arxiv.org/abs/cs/9911003.
[7] David Eppstein. “The lattice dimension of a graph”. In: European Journal of Combinatorics 26.5 (2005), pp. 585–592. ISSN: 0195-6698. DOI: https://doi.org/10.1016/j.ejc.2004.05.001. URL: https://www.sciencedirect.com/science/article/pii/S0195669804000885.
[8] GridGraph. URL: https://mathworld.wolfram.com/GridGraph.html.
[9] R. Impagliazzo and R. Paturi. “Complexity of k-SAT”. In: Proceedings. Fourteenth Annual IEEE Conference on Computational Complexity (Formerly: Structure in Complexity Theory Conference) (Cat.No.99CB36317). 1999, pp. 237–240. DOI: 10.1109/CCC.1999.766282.
[10] R. Impagliazzo, R. Paturi, and F. Zane. “Which problems have strongly exponential complexity?” In: Proceedings 39th Annual Symposium on Foundations of Computer Science (Cat. No.98CB36280). 1998, pp. 653–662. DOI: 10.1109/SFCS.1998.743516.
[11] OpenAI. “Planar Point Sets with Many Unit Distances”. In: (). URL: https://cdn.openai.com/pdf/74c24085-19b0-4534-9c90-465b8e29ad73/unit-distance-proof.pdf.
[12] Will Sawin. An explicit lower bound for the unit distance problem. 2026. arXiv: 2605.20579 [math.CO]. URL: https://arxiv.org/abs/2605.20579.
[13] Marcus Schaefer. “Realizability of Graphs and Linkages”. In: unknown. 2013. URL: https://api.semanticscholar.org/CorpusID:8477664.