Student Post: Variations in Size on General Petersen Graphs

Hello again!

One more blog post dealing with Petersen Graphs. Last week we saw several examples of embeddings of Petersen graphs. Since one of the main goals behind creating those realizations is to 3D print them. As such, it is important that the dimensions of our embeddings are reasonable. In the previous embeddings, the graphs were realized with edges of radius .02mm. The realizations from last time were created using code that hard coded most of the dimensions of the objects instead of using any of the inherent values of a Petersen graph. Since then, the code has been changed to be much more general (also allowing it to be more readable). I have also changed the code to include the vertices of the graphs as well to more effectively demonstrate the properties of a Petersen graph.

The following example is of GP(12, 4) where the edges have radius 2mm and the spherical vertices have radius 3mm. The radius of the approximated circle created by the outer ring (in blue) is 50mm. The height of the graph is also reasonable dimensioned in this embedding.

App Sized Double Thickness Centered Terraces GP 12 4

The code that produced this example is relatively robust in terms of what dimensions it can produce when realizing these embeddings of Petersen graphs. The smaller n/k is the more variability there is in how large the radius of the edges of the graph can be. I also took a suggestion to realize the graph with the base in the center, creating a beautiful embedding.

This example is of GP(40, 10) where the edges have radius 1mm and the base has radius 50mm. The height on this graph however is ~200mm.

Modified Steel Cable Structure GP 40 10

The biggest issue with this code is that it is not very robust in terms of the size of the radius of the edges. Last week we had an example of GP(60, 12) which was very tight and had a “steel cable” in it. However, this code was only able to produce an embedding with no intersections due to the tiny radius that was being used. This example however has edges that are just thick enough to print. Given the height of this graph, one might be interested in an embedding that doesn’t have such proportionally thin edges.

As stated last time, now that we have some relatively printable realizations of general Petersen graphs, I’m going to shift my focus to working with n-panelled and n-flat graphs for next time.

Thanks for reading!


-Ben Flint

Student Post: Several Generalized Petersen Examples

Welcome back!

My last blog post dealt with learning some of OpenSCAD to tackle the problem of representing graphs in 3D, culminating in some OpenSCAD code that would draw any generalized Petersen graph. To do so, I wrote code that would take in values for the parameters that define a Petersen graph and then use a dedicated loop to draw three edges of the graph at a time by rotating 360/n degrees each time the loop was run. This created a very interesting representation of a Petersen graph where the outer rim was drawn entirely on one plane with the edges approximating a circle and the inner rim was drawn on a plane that was parallel to the outer rim. The inner rim, when drawn in a plane, creates many intersection points between the edges of the rim. However, one might have reason to be interested in representing graphs in 3D without any intersections.

I have started working on the problem of representing general Petersen graphs without any intersections between the edges that make up the inner rim (recall that they take the form (i + k)’ where (i + k) is read mod n). One thing to note before I jump into how I represented these graphs is that the edges of the inner rim form a set of cycles, C. If k divides n then these cycles will be of length m where k * m = 0 mod n and |C| = k. If k does not divide n, then |C| = 1 and that cycle will have length m = n. Thus the inner rim of GP(12, 3) will have cycles of length m = 4 and |C| = 3.

Keeping that in mind, my first attempt at drawing Petersen graphs was to draw the distinct cycles on their own planes. However, this ONLY works for generalized Petersen graphs where k divides n, because as we saw, attempting to draw generalized Petersen graphs where k does not divide n with the single cycle in the plane results in many intersections. My first attempt at drawing these graphs works by raising each vertex by a set amount. To isolate the cycles, I realized that the distinct cycle starting at vertex i’ had vertices {i’, (i + k)’, (i + 2k)’, … , (i + (n-1)k)’}. I also noted that each one of these vertices is the same mod k. Then to correctly graph the distinct cycles, I changed the height of each point by a set amount depending on its value mod k. The results presented some very interesting examples of Petersen graphs, including the following: Terraces GP 12 3The Colliseum GP 60 4The Highrise GP 60 12Top Down GP 60 12 The first of these examples is a representation of GP(12, 3), the second of GP(60, 4), and the third and fourth are of GP(60, 12) (the fourth is a top down view of GP(60, 12)). One interesting thing to note about the representation that I’ve chosen to implement is only partially successful at representing general Petersen graphs without any intersections. First there is the obvious issue that this code is severely limited in that it can’t represent any Petersen graph where k does not divide n. The second is that, even if given n and k such that k divides n, if the value of n is too large compared to the value of k, the cycles will be so long (have too many edges) that each edge will be short and intersect with the edges making the spokes of the graph. This can be seen in the second example, the representation of GP(60, 4), which I like to call “The Coliseum”. In “The Coliseum” each cycle has length 15 but there are only 4 such cycles.

I decided that the first of these issues that I would tackle would be that this code cannot represent generalized Petersen graphs for any valid values of n and k. In order to rectify this, I wrote a new function that assigned a different height to each vertex. Then I changed the function that drew the edges of the inner rim to modify the height based on its value (i + k)’ mod n. The resulting code could draw any generalized Petersen graph with valid values for n and k where the first half of the inner rim edges have rising height and the other half have descending height. This code is much more robust than the other code in that it can draw many more generalized Petersen graphs and still maintains the property that distinct cycles are all raised to different heights. However, given how close the rising edges are, the thickness of the edges had to be lowered significantly to avoid intersections. Consider the following three examples this code has produced:

The Crazy Coaster GP 11 3Funland Ride GP 12 3Steel Cable Suspension Structure GP 60 12

At first glance, the first two pictures look like they represent the same graph, but on closer inspection, the first represents GP(11, 3) and the second represents GP(12, 3). A fine distinction, to be sure but note that GP(11, 3) only has one distinct cycle, whereas all three distinct cycles of GP(12, 3) can be picked out. The third example represents GP(60, 12). Given the perspective of the picture, it can be difficult to see, but this graph is embedded with no intersections. The resulting graph looks a lot like a structure that is being suspended by tightly knit steel cables that are under tension. Though this code is more robust in the amount of Petersen graphs that it can represent, it is still plagued by the issue of drawing Petersen graphs with large values of n and small values of k without intersections.

For next week, I intend to move away from Petersen graphs and start working on representing examples of flat and panelled graphs following along with the paper On n-panelled spatial graphs, n-flat graphs and graph minors by Ryo Nikkuni and Yukihiro Tsutsumi.

As always, thank you for reading!

-Ben Flint


Nikkuni, Ryo, and Yukihiro Tsutsumi. “On n-Panelled Spatial Graphs, n-Flat Graphs and Graph Minors.” preprintWeb.

Student Post: General Petersen Graphs in OpenSCAD

The field of graph theory is diverse and interesting. There are many topics to explore and endless different representations of different graphs. A particularly interesting side of graph theory to explore involves different embeddings of graphs in 3 Space. This is exciting in part due to the modern ability to 3D print. Given that there are so many different ways to embed the same graph, one has reason to be interested in spatial embeddings of graphs that illustrate the unique and interesting properties of a graph. Considering the question of which embedding to choose is putting the cart before the horse however, as there is a more pressing question to consider: How do we represent spatial embeddings of graphs at all?

Towards answering that question, I have been learning to use OpenSCAD in order to model graphs. A class of graphs I find interesting are the Generalized Petersen graphs.  A Generalized Petersen graph, GP(n, k) has 2n labelled vertices with labels 0, 1, … , n-1, 0′, 1′, … , (n-1)’ and edges of the form (i, i’), (i, i+1), and (i’, (i + k)’) where all numbers are read mod n. The edges (i, i+1) form the “outer” rim of the graph, the edges (i’, (i+k)’) form the “inner” rim of the graph, and the edges (i, i’) form the “spokes” of the graph. It has been shown that all Generalized Petersen graphs have a Tait coloring. A Tait coloring of a trivalent graph (each vertex has three edges attached or valence 3) is an edge coloring in three colors of the graph where each vertex is adjacent to all three colors. I decided to try and realize an a Tait colored embedding of GP(11, 3) in OpenSCAD.

Learning to use OpenSCAD has been an adventure in realizing that all the coding tips and tricks I’ve picked up still apply. At first, I approached the problem of drawing GP(11, 3) by hard coding every edge. After realizing that that was tiring and a pain, I started using loops to draw the outer rim and the spokes of the graph. I wrote loops that drew the outer rim and the spokes of GP(11, 3). The loops worked by drawing an edge between vertex 0, (1, 0, 0), and vertex 0 rotated by 360/11 degrees (vertex 1) as well as between vertex 0 and vertex 0′, (1, 0, dist(vertex 0, vertex 1)) then drawing an edge between vertex 1 and vertex 1 rotated by 360/11 degrees (vertex 2) as well as between vertex 1 and vertex 1′, etc. From there I realized that not only could I condense the two loops I had written but that I could draw the inner rim in the same loop as well. Note that this embedding draws the outer rim as a polygon approximating a circle. This picture of a crown was my first attempt at drawing both rims and the spokes of the graph in the same loop. The Crown

This picture illustrates the outer rim but not the spokes or the inner rim. I had used the wrong points in the OpenSCAD code trying to create the spokes and inner rim which had connected the spokes to two vertices on the outer rim instead of across the graph to create the inner rim. This obviously does not follow the correct form for a Generalized Petersen graph, but it did result in a pretty circlet that could be colored and printed.

After inadvertently making the crown, I starting thinking about how I could draw the inner rim in for any valid k given instead of hard coding GP(11, 3). I also realized that I could easily change my current code to correctly draw the outer rim and spokes for any given value of n by rotating by 360/n degrees instead of 360/11 degrees. In order to draw the inner rim, I chose to use a similar method to the one I used to draw the outer rim and spokes . To draw the inner rim, vertices i’ and (i+k)’ have to have an edge. In order to draw this in using the same loop, I drew an edge between vertex 0′ and vertex 0′ rotated by k*360/n degrees (vertex (0+k)’) and repeated that process the same way as before. This created a properly drawn embedding of GP(n, k) given valid parameters. I decided that aesthetically having the i and i’ vertices be aligned vertically was not pleasant to look at, so I modified that code so that the “lower” (outer) rim could be scaled. Doing so resulted in the following picture of a peanut butter cup (GP(11, 3)).Peanut Butter Cup

Looking at this peanut butter cup was much more pleasant and also illustrative of a fun geometric property of GP(11, 3). When looking at the structure from the top, the outer rim almost disappears as its shape is created by the intersections of the inner rim. After all that, you might notice that this graph is only one color. That is due to the fact that a Tait coloring of this graph cannot be easily drawn using the loop that I have written. The current loop essentially draws a 3 edge chunk n times, each time rotated by 360/n degrees. Since simply coloring each edge a different color and rotating that does not result in a valid coloring, several logic statements are needed to actually realize a Tait coloring on this graph. This code can currently draw any GP(n, k). I am not sure that a Tait coloring on any distinct GP(n, k)  can be drawn in the same way.

For most of the embeddings I work with this semester, I am using a simple module in OpenSCAD called rod_rounded_ends to draw the edges and vertices of a given graph. This approach only allows for straight edge embeddings of graphs. In general this will be of interest to me as I continue to look into panelled and flat graphs and their properties.

Thank you for reading! Keep checking back for more interesting graphs!

-Ben Flint


F Castagna, G Prins
Every generalized Petersen graph has a Tait coloring
Pacific J. Math., 40 (1972), pp. 53-58