I want a graph that is basically just two rings of the same number of nodes, with the corresponding nodes of the two rings joined. In my mind, this should just be two concentric rings, something like this terrible ASCII art:
O-------O
/ \ / \
/ O---O \
/ / \ \
O---O O---O
\ \ / /
\ O---O /
\ / \ /
O-------O
I feel like the graph should be defined basically like this:
graph {
layout="circo"
oneblock=false
Aa -- Ba -- Ca -- Da -- Ea -- Fa -- Aa
Ab -- Bb -- Cb -- Db -- Eb -- Fb -- Ab
Aa -- Ab
Ba -- Bb
Ca -- Cb
Da -- Db
Ea -- Eb
Fa -- Fb
}
The correct layout engine would seem to be "circo", as specified. But this just produces a mess, and toggling the value of oneblock doesn't do anything. Leaving out the second line (deleting one of the rings) produces a graph with the nodes laid out like I want, but adding in any of the second ring's edges throws the layout off again.
I suppose I can process it with "circo" with only the one ring, then add the second ring to the output of that and then render it again with neato, but it feels like there should be a better way.
(I just noticed that using "neato" directly on the initial definition comes close to what I want, but it renders it as basically two offset, overlapping rings, instead of two concentric rings. Maybe there's a way to "push" the second ring's nodes outward?)
Circo seems to "just" do 1 or more non-concentric rings. Here is a solution using twopi. Note that it does not have flat-edges on the top & bottom like your sketch, but has them on the sides. Though there is a request submitted to make starting angle/position administrable, it is not implemented.
If rotating the image is important, here is a radial preprocessor (https://gist.github.com/steveroush/60d9a850a545ec4e02b0482c7bac3ad5) that can produce a correctly rotated version of your graph
Giving:
