# Number of permutations with combinatorial geometric constraints

We are given a $$d$$-dimensional hypercube $$H$$, where each vertex is labeled with an integer $$\ell\in\{1, 2, \ldots, 2^d\}$$. Let $$L$$ be this labelling.

Question: How many labelling permutations $$L'$$ of $$L$$ satisfy the property that each vertex $$v$$ of $$H$$ is labeled in $$L'$$ with one of the $$d$$-many labels associated in $$L$$ with the $$d$$ vertices adjacent to $$v$$ (i.e., lying on one of the edges of $$v$$) in $$H$$?

Example: When $$d=2$$, the required number of permutations is 4.

• @MartinRubey: is that just based on some computations or is it easy to see? – Sam Hopkins Feb 25 at 17:37
• Create a bipartite graph consisting of two copies of the hypercube such that the white vertices form a complete set of vertices of the hypercube, and so do the black vertices. Then a perfect matching of this graph corresponds bijectively to a permutation of the required kind. Unless I made a mistake. – Martin Rubey Feb 25 at 17:48
• @MartinRubey: Ahhh, I see: another way to say it is that such a permutation is given by choosing a(n ordered) pair of perfect matchings of the hypercube. But then you linked to the wrong OEIS entry. I think you meant oeis.org/A005271. – Sam Hopkins Feb 25 at 17:53
• @MartinRubey: maybe you should post your comments as an answer? There is no simple formula for the number of perfect matchings of the hypercube, but it's a well-studied quantity so I think this is the best answer that could be given. – Sam Hopkins Feb 25 at 17:59
• Of course ultimately this interpretation as the square of the number of perfect matchings of the hypercube is the same as saying the number of these permutations is the permanent of the adjacency matrix of the hypercube, which is certainly true (and obvious) but not really helpful... – Sam Hopkins Feb 25 at 18:29

To see this, note that the hypercube $$H_n$$ is a bipartite graph. Let $$H_n^b$$ be a proper $$2$$-coloring of the vertices of $$H_n$$ with colours black and white, and let $$H_n^w$$ be the other (complementary) coloring. Consider now the disjoint union $$U_n = H_n^b \cup H_n^w$$ of these two coloured graphs.
Then a perfect matching of $$U_n$$ can be interpreted as a permutation of the vertices of $$H_n$$: the image of a vertex in $$H_n$$ is the partner of the corresponding black vertex in $$U_n$$. Conversely, a permutation $$\pi$$ of the vertices of $$H_n$$, such that $$u$$ and $$\pi(u)$$ are adjacent in $$H_n$$ is evidently a perfect matching of $$U_n$$.