Paths that nearly fill half a cube fit exactly one half-filled pattern
Why it matters
In a ten-dimensional cube, at most 512 corners can be marked if the lines between neighboring marks must form separate paths. Every such layout with 507 marks fits exactly one full pattern, so none of its paths can run longer than six steps. With 506 marks, a layout can escape all the full patterns for the first time.
To find long paths through a cube, it helps to know when there is still room to join short paths together. Imagine marking corners and keeping every edge between marked neighbors. The marked corners must form separate paths: a branch or a loop spoils the arrangement. Half the corners can be marked this way. Knowing that maximum leaves a practical question unanswered. If an arrangement is nearly half full, can we reach half by adding marks without moving any?
In a cube of dimension n\ge5, every arrangement fewer than n-4 corners short of half has exactly one way to reach half. At n-4 short, some arrangements cannot reach half at all. For example, in ten dimensions every arrangement on 507 of the 1,024 corners extends to one on 512, but some on 506 do not. The reason this matters for long paths is that every half-filled arrangement follows one of just six patterns, all of them made of short paths.
Counting vertices and counting edges
An address in the n-dimensional cube Q_n is a string of n bits. Each address identifies a corner, or vertex, and two vertices share an edge if their addresses differ in one bit. The graph induced by the marked vertices includes every edge between them. We call the marked set a path forest, or snakepit, if it contains no cycle and each mark has at most two marked neighbors. A single isolated vertex counts as a path. A full forest occupies half the vertices. The deficit of a forest S is the number of marks it would need to reach half, 2^{n-1}-|S|. A completion is a full forest containing S.
One way to fill the cube to half is to mark all strings with an even number of ones. Every edge changes that number by one, so all the marks are isolated. Huang's degree bound explains why half is the limit for n\ge5: any larger set contains a vertex with at least \sqrt n neighbors in the set, too many for a path. The four-dimensional count below gives a direct proof for every n\ge4.
For forests made entirely of disjoint edges, called induced matchings, the largest arrangements have a simple form. Choose a bit and take every edge along that direction for which the remaining bits have a chosen parity (an even or an odd number of ones). Each maximum induced matching has this form and contains 2^{n-2} edges. Kahn and Park, §1 and Lemma 1.3 also show that a sufficiently large induced matching differs from a matching of this form in only o(2^n) edges: the difference divided by the number of cube vertices tends to zero as n grows. Here we allow paths of any length and ask when one forest fits entirely inside a full one. We found no previous classification of the six full patterns or threshold for fitting inside one.
A search for long paths rewards edges. Each path has one fewer edge than vertices, so joining paths can be worth losing vertices. Orland et al. use snakepits to search for long induced paths. In §7 they denote the maximum number of edges in a snakepit by \Lambda(n). Their bound \Lambda(n)\ge13\cdot2^{n-5} comes from two disjoint 13-edge paths in Q_5. Proposition 1 expresses the count as \Lambda(n)/2^n, dividing by all cube vertices. On that scale the construction gives 13/32 in every dimension n\ge5.
We checked the 510 snakepits released by Orland et al. by reconstructing each connected path from its binary addresses and verifying its length and the reported totals for edges and paths. Four entries in each dimension from five through nine were full. Across these 20 entries the longest path had at most six edges. In each dimension the best full entry had only 3/8 as many edges as the cube has vertices. The release provides one example per benchmark cell, so these short paths might reflect the choice of examples. To find restrictions common to every full forest, we counted labelled forests: two different sets of addresses count separately even if a symmetry of the cube takes one to the other.
Forests at half capacity and one vertex below
One missing vertex already allows failure in dimension five: 24,480 of the 52,832 forests one short of full have no completion. In dimension six all 142,528 have a unique completion. The table counts vertex sets; in dimension four some sets one short of full have multiple completions.
| Dimension | Full | One short | One short: no completion | One short: unique completion |
|---|---|---|---|---|
| 4 | 922 | 3,392 | 192 | 1,072 |
| 5 | 1,772 | 52,832 | 24,480 | 28,352 |
| 6 | 4,454 | 142,528 | 0 | 142,528 |
In dimension four we tested all 65,536 subsets of Q_4 for cycles and for vertices of degree greater than two, where degree counts marked neighbors. The largest forests had eight vertices. This count also constrains larger cubes. Fix all but four bits and let the other four vary: the resulting 16 vertices form a four-face. Keeping the same four bits free partitions the cube into parallel four-faces. Each face contains at most eight marks, so a full forest must have exactly eight on every face in every such partition.
To count forests in dimensions five and six, we split the cube on one bit. Fixing that bit first to zero, then to one, gives two smaller cubes called opposite facets, each a copy of Q_{n-1}. Their deficits are nonnegative and add to the total. We tried every ordered pair of full facets and every pair with one full facet and one facet one short, in both orders. We discarded unions with any degree above two. To detect cycles in the rest, we repeatedly stripped away path endpoints and isolated vertices; we kept a union if nothing remained. For each forest one short of full we counted the single vertices we could add to make it full.
Balance on every four-face connects the problem to Boolean functions. The function that assigns one to a mark and zero to an unmarked vertex is the membership indicator. If its values are evenly split after fixing any n-4 bits, it is called (n-4)-resilient. Rasoolzadeh classified all such functions. For n>10, after reordering the bits, membership depends on at most ten bits and switches with the parity of the rest. A balanced face can still contain a cycle: choosing strings of even parity on all but two bits leaves whole marked squares as those two bits vary. Requiring paths reduces the possibilities to six patterns on at most four bits. To prove completion we also need to handle faces with missing marks.
The six half-filled patterns
Picture a large cube as a stack of small cubes. Choose marked addresses C on d bits, the core. Both the marks and the unmarked addresses (the complement of C) must form path forests. Each setting of the remaining n-d bits selects a small cube, or slice. Mark C in slices where those bits have even parity, and the complement of C where they have odd parity. Crossing between adjacent slices switches membership, so no marked edge connects them. For n>d this construction, called a parity lift, fills exactly half the cube.
We can read the core back from a lift. Call a bit active if some pair of neighbors along it has the same membership, both marked or both unmarked. Fixing all inactive bits to zero recovers the core. Changing any inactive bit exchanges the two colors, marked and unmarked. For example, an empty core on one active bit alternates empty two-vertex slices with slices containing a whole marked edge. The result is a matching.
The table lists core addresses as the integers their bits encode. Path sizes count vertices. An empty list means there are no paths of that color. The last column gives the edge count of the lift divided by all 2^n cube vertices.
| Active bits | Marked core addresses | Path sizes, core | Path sizes, complement | Edges per cube vertex |
|---|---|---|---|---|
| 0 | ∅ | ∅ | 1 | 0 |
| 1 | ∅ | ∅ | 2 | 1/4 |
| 2 | 0 | 1 | 3 | 1/4 |
| 3 | 0, 3, 4 | 1, 2 | 5 | 5/16 |
| 3 | 0, 1, 3, 4 | 4 | 4 | 3/8 |
| 4 | 0, 1, 5, 6, 7, 8, 11, 12 | 1, 7 | 1, 7 | 3/8 |
We tried every subset on zero through four bits, requiring both colors to form path forests and every core bit to be active. The counts of labelled cores were respectively 2, 2, 8, 72 and 192. Grouping cores related by permuting bits, flipping bits or exchanging colors left the six rows. In a lift, flipping an inactive bit exchanges the colors. Every full forest in the dimension-five count had at most four active bits. Each therefore has an inactive bit, so both core colors occur as slices and must form path forests. This proves the list is complete in dimension five.
Joining two half-filled facets
For larger cubes, the key question is what happens when we put a full pattern on each of two opposite facets and include the edges between them. Either the join is itself a lift from the table, or it contains at least n-4 separate violations of the path rule. Each violation, called an obstruction, is a cycle or a claw (a vertex joined to three neighbors). The obstructions share no vertices, so each needs its own deletion. Even n-5 deletions leave at least one intact.
We tested the joins in dimensions six through ten. For the first facet we placed each of the six cores on the first d bits, where d is its number of active bits. This covers every first facet because we can apply the same symmetry to both facets, including a flip of an inactive bit to exchange colors. For the second core we tried each possible subset of the first core's bits as shared bits. We put its other bits in the first available positions outside those d, since permuting these outside positions preserves the first facet. On the chosen bits we tried every labelled second core, including both colors.
The table counts descriptions with the cores positioned this way; descriptions related by symmetry can still count separately. A valid join forms a path forest. For each incompatible join the last column gives the number of disjoint obstructions verified.
| Dimension | Valid joins | Incompatible joins | Disjoint obstructions certified per incompatible join |
|---|---|---|---|
| 6 | 32 | 6,146 | 2 |
| 7 | 32 | 9,082 | 3 |
| 8 | 32 | 10,306 | 4 |
| 9 | 32 | 10,498 | 5 |
| 10 | 32 | 10,498 | 6 |
Every valid join had at most four active bits and so came from the core table. To find obstructions in an incompatible join we chose the lowest-numbered vertex of degree three and removed it with its three neighbors. When none of degree three remained, we stripped endpoints and isolated vertices to expose the cycles and removed the cycle containing the lowest-numbered surviving vertex. For each obstruction we checked its internal degrees directly from the bit differences between pairs of addresses. Choosing obstructions in this order found the required count in every case, without having to maximize it.
We independently tested whether deleting at most n-5 vertices could repair an incompatible join. Starting with the six displayed cores, we tried all placements of the second core's bits rather than grouping placements by shared bits. The join has maximum degree three: a mark gains at most one neighbor across the facets. Deleting one vertex can eliminate at most four degree-three centers, itself and its neighbors. If the centers outnumbered four times the remaining deletion budget, we ruled out repair. Otherwise we chose a claw and tried each of its vertices in turn as the next deletion, since a repair must remove at least one. Once no claws remain, a repair costs exactly one vertex per remaining cycle. No incompatible description admitted a repair within budget, including all 183,034 in dimension ten in this larger count.
The ten-dimensional test covers higher dimensions because the two cores together use at most eight facet bits. For n>10, keep nine facet bits, including all those used by either core, plus the bit separating the facets. Fixing the other bits partitions the join into ten-dimensional slices. Flipping any of those other bits complements a slice. At least one of the nine retained facet bits is unused by both cores; flipping it has the same effect. Thus the slices are copies of one another up to a bit flip, and there are no marked edges between slices. If the first slice is valid, the whole join extends its parity lift. Otherwise the slices supply at least 6\cdot2^{n-10}\ge n-4 disjoint obstructions.
This proves the claim about joins for every n\ge6. It also proves the six-pattern classification by induction. In a full forest both facets must be full, since neither can exceed half capacity. If the list covers each facet, the forest is a valid join and hence is on the list too. The dimension-five count starts the induction.
Why a forest close to half can be completed
Let the deficit be t\le n-5. Suppose we can split the cube so that each facet has deficit at most n-6. The same completion result in dimension n-1 then fills both facets. Their join contains just t more vertices than the original forest. Deleting those t vertices recovers a forest, whereas an incompatible join needs at least n-4 deletions. The join must therefore be a full completion. The counts in dimensions five and six start this induction.
It remains to find such a split for n\ge7. When t<n-5, any bit works. When t=n-5, a split works if both sides share the deficit. Suppose instead that every bit puts the entire deficit on one side. The choices of deficient side, one per bit, give the address of a vertex v. In each partition into parallel four-faces, every face except the one through v fixes some bit opposite to v. It lies in a full facet, so has eight marks. This leaves 8-t marks on the face through v. Putting extra weight t on that single vertex would then restore the total to eight on every four-face. In symbols, the corrected weight is g=1_S+t1_{\{v\}}, where 1_S indicates membership in the forest and 1_{\{v\}} is one only at v.
To see why a correction at just one vertex is impossible, represent functions of bits by multilinear polynomials: each bit occurs at most once in each product. The representation is unique on binary inputs. Let \chi(x)=(-1)^{\sum_i x_i} be the parity sign and set p=\chi(2g-1). On any four-face the alternating sum of p is zero. Indeed, the signs of that sum cancel \chi up to a constant sign, and 2g-1 sums to zero because the weights sum to eight. Taking this alternating sum over four chosen bits picks out the coefficient of their product, itself a function of the remaining bits. It vanishes at every setting of those bits. Hence no term of p contains all four chosen bits, whichever four we choose: p has degree at most three.
Squaring p gives degree at most six, since x_i^2=x_i for a bit. Away from v, the weights are zero or one, so p^2-1 vanishes there. At v it is nonzero since g(v)\ge t=n-5\ge2. But any function nonzero only at v is a multiple of the indicator of v. That indicator is a product with one factor x_i or 1-x_i for every bit, so its degree is n>6. This contradiction forces a split sharing the deficit and proves a completion exists.
Why the completion is unique
Distinct full forests disagree at too many vertices to complete the same nearly full forest. For a full forest A, every four-face has eight marks, so the preceding alternating-sum argument gives p_A=\chi(2\,1_A-1) degree at most three. A nonzero multilinear polynomial of degree k is nonzero on at least 2^{n-k} cube vertices. To see why, choose a degree-k term and fix all bits outside it. Its coefficient survives every such assignment, leaving at least one nonzero value for each assignment.
For distinct full forests A and B, the polynomial p_A-p_B is nonzero exactly where membership differs. The two forests therefore disagree on at least 2^{n-3} vertices. Since they have equal sizes, at least 2^{n-4} vertices in A are absent from B. Two completions of a set with deficit t could omit at most t of each other's vertices. Thus whenever t<2^{n-4} a completion, if it exists, is unique.
This separate threshold for uniqueness is also sharp. Lift the two three-bit cores in the table on the same bits. In each of the 2^{n-3} slices their marks differ only at address 1. Each forest therefore lacks exactly 2^{n-4} marks of the other. Their intersection is a path forest that both complete.
A forest that cannot be completed
Start with the full matching M that marks all strings with odd parity on bits 1,\ldots,n-1, numbering bits from zero. Its edges run along bit zero. Write e_j for the string with a one only in bit j. The all-zero vertex (the origin) has marked neighbors e_1,\ldots,e_{n-1}. Remove all but e_1 and e_2 from that list, then mark the origin. Its two remaining neighbors belong to different matching edges, so adding the origin joins those edges into a path on five vertices. Removing n-3 marks and adding one leaves deficit n-4.

In the six-dimensional example shown, crosses mark the removed addresses 8, 16 and 32. Adding address 0 creates the path 3,2,0,4,5. The former partners of the three deleted vertices are now isolated. All matching edges outside the picture remain unchanged.
A completion would contain the origin and therefore differ from M. Yet it could omit at most n-3 vertices of M. For n\ge6 this is fewer than the 2^{n-4} required for distinct full forests. In dimension five this modification has one completion, but another 15-vertex forest has none. Its binary addresses, written as integers, are 2,3,4,5,7,8,9,10,16,17,22,27,28,29,31. Its paths have sizes 1, 2, 4 and 8. The eight-vertex path alone rules out completion: the longest path in any full pattern has seven vertices.
For every n\ge5, then, n-4 is the first deficit at which completion can fail. In dimension four the count gives the exceptional value one. Below the threshold every forest lies inside one of the six full patterns, so its number of edges divided by the number of cube vertices is at most 3/8, strictly below the known 13/32 construction. A search for more edges must leave those patterns.
Reaching the threshold allows escape but does not force it: deleting vertices from a full forest still gives completable examples there. And the first forest that escapes need not itself have many edges.
References
Jeff Kahn and Jinyoung Park. The number of maximal independent sets in the Hamming cube. Combinatorica 42 (2022).
Shahram Rasoolzadeh. Classification of All t-Resilient Boolean Functions with t+4 Variables. IACR Transactions on Symmetric Cryptology 2023(3), 213–226.
Hao Huang. Induced subgraphs of hypercubes and a proof of the Sensitivity Conjecture. Annals of Mathematics 190 (2019), 949–955.
Paul Orland et al. New Snake-in-the-Box Records via Snakepit Surgery and Learned Construction. arXiv:2607.15270v3 (2026), §7 and Appendix D. Accompanying snakepit vertex sets.