I'm about to draw a ring of cliques graph, with a custom number of nodes in the cliques and a custom number of cliques.
My first solution is to use tikz-graphs to draw the cliques, but the problem is how to tile the cliques with rotation around a center and how to add lines that connect the cliques with a path as in a)
I can draw a clique with:
\begin{tikzpicture}
\graph [nodes={draw=none, circle, fill=darkgray}, circular placement, empty nodes, n=8] { subgraph K_n [name=outer] };
\end{tikzpicture}
While, for positioning of simple nodes, something like:
\foreach \s in {22.5,112.5,202.5,292.5}
{
\node[draw, circle, rotate=\s+90,xscale=10.25,yscale=7.25] at (\s:2) {};
}
works, I don't know how to loop in this way for tikz-graphs macros.
Whi
Best Answer
Based on the last comment of the OP for n>=8, this attempt did not seek help from
tikz-graph
but define a macro for the cliques calledsingle
which takes 2 arguments #1= labels for different cliques in the ring, #2= number of cliques in the ring. Basically, this code usesscope
environment to allocate the cliques in a circular manner andforeach
loops are used extensively.Code