# Petrie polygon projection of a hypercube graph

I am trying to generate the Petrie polygon projection of the 8-cube in Mathematica, like this one:

I tried using, for example, the HypercubeGraph function:

HypercubeGraph[8]


which generates

As you can tell from the lack of symmetry (notice the shape of the innermost ring, for example), this is not the right projection. I also tried looking at some GraphPlot options like Method:

GraphPlot[HypercubeGraph[8], Method -> "SpringElectricalEmbedding"]


but to no avail. How can I generate the Petrie polygon projection of an 8-cube in Mathematica?

## 1 Answer

As I understand this, GraphData are based on many nice custom pre-set layouts. Graph is based on algorithms that compute layouts, so computation is not always guaranteed to result in a specially defined geometry.

SetProperty[GraphData[{"Hypercube", 8}], VertexStyle -> Red]


• Thank you! Is there a way to label different vertices or color them differently according to a function? – user76284 Feb 23 '16 at 0:20
• @user1667423 VertexShapeFunction most generally with. You should take a good nickname. – Vitaliy Kaurov Feb 23 '16 at 0:31
• Thanks again! It doesn't seem like the projection is working properly for the 3-cube. Is it not currently possible to specify the Petrie projection in general? – user76284 Feb 23 '16 at 1:12