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

enter image description here

I tried using, for example, the HypercubeGraph function:

HypercubeGraph[8]

which generates

enter image description here

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?

up vote 10 down vote accepted

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]

enter image description here

  • 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

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.