2

I am trying to draw a graph on 216 vertices - 215 vertices distributed on a wheel around a fulcrum. Then I want to connect all the peripheral vertices to the fulcrum and join the vertices on the wheel in groups of 5. I managed to do this but one cannot tell the groups of 5 apart. I would like to curve the edges joining the vertices in the groups of 5, so that they are more discernible.

\begin{tikzpicture}[main/.style = {draw, circle, inner sep=1.2, fill=black}] 
\node[main, label=right:{$e$}] at (360:0mm) (0) {};
\graph[circular placement, group polar shift=(360/215:0), empty nodes, radius=6cm, nodes={circle, inner sep=1.2, draw=black, fill=black}] {
    \foreach \x in {1,...,215} {       
        \x -- (0);    
    };    
    \foreach \x [evaluate={\xi=int(\x+4);}] in {1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 96, 101, 106, 111, 116, 121, 126, 131, 136, 141, 146, 151, 156, 161, 166, 171, 176, 181, 186, 191, 196, 201, 206, 211} {
        \foreach \y in {\x,...,\xi} {
            \x -- \y;
        };
    };
}; 

\end{tikzpicture}

the code gives rise to this: enter image description here

what I would like is to add, instead, curved edges that highlight the groups of 5 - like this: enter image description here

where the different colours are just to highlight different groups of 5 in the example. I tried with \x to [out=275,in=265,looseness=2] \y; but it does not work. Also something like \draw \x to [out=275,in=265,looseness=2] \y; does not work. Any help is much appreciated!

2 Answers 2

3

As far as I understand what you want, here's a way to start with. I didn't know how you want to distribute the colours, though:

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{graphs}

\begin{document}
    \begin{tikzpicture}[main/.style = {draw, circle, inner sep=1.2, fill=black}] 
    \node[main, label=right:{$e$}] at (360:0mm) (0) {};
    \graph[circular placement, group polar shift=(360/215:0), empty nodes, radius=6cm, nodes={circle, inner sep=1.2, draw=black, fill=black}] {
        \foreach \x in {1,...,215} {       
            \x -- (0);    
        };
     };    
        \foreach \x [evaluate={\xi=int(\x+4);}] in {1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 96, 101, 106, 111, 116, 121, 126, 131, 136, 141, 146, 151, 156, 161, 166, 171, 176, 181, 186, 191, 196, 201, 206, 211}
            {
            \foreach \y in {\x,...,\xi} \draw[blue] (\x) to[bend left=80] (\y);
            }
    \end{tikzpicture}
\end{document}

whole picture

close up

EDIT: Maybe tou wanted to link each vertices in a group of 5 to the four other ones. In this case, your foreach loop is probably not written completely.

1
  • 1
    thank you @SebGlav! Indeed, I need to change the loop but I can take it from here. Commented Jul 19, 2021 at 11:37
2

Thank you for the posted solutions! based on them, here is the final code:

\begin{tikzpicture}[main/.style = {draw, circle, inner sep=1.2, fill=black}]      
\node[main, label=right:{$e$}] at (360:0mm) (0) {};     
\graph[circular placement, group polar shift=(360/215:0), empty nodes, radius=6cm, nodes={circle, inner sep=1.2, draw=black, fill=black}] {         
    \foreach \x in {1,...,215} {                    
        \x -- (0);             
    };      
};             
\foreach \x [evaluate={\xi=int(\x+4);}] in {1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 96, 101, 106, 111, 116, 121, 126, 131, 136, 141, 146, 151, 156, 161, 166, 171, 176, 181, 186, 191, 196, 201, 206, 211} {             
    \foreach \y in {\x,...,\xi} { 
        \foreach \v in {\y,...,\xi} \draw[black] (\v) to[bend left=90, looseness=2] (\y);
    }           
}
\end{tikzpicture}

giving the following graph: enter image description here

1
  • Note that you can change the bend for every distance, which would create a more legible design. But this is great ;)
    – SebGlav
    Commented Jul 19, 2021 at 11:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .