2

I am working on a structure I called a flower graph. Basically, it is many cycles with possibly different lengths sharing one central vertex and it can be drawn to look like a flower. For example the figure below should have 5 cycles with the lengths specified.

enter image description here

I need different instances of this graph none of which will have more than 5 cycles; however, I might need to add three dots to indicate continuation like the figure. The style I used for my vertices is

\tikzset{ myVrtxStyle/.style = {
        circle, minimum size= 4mm, %very thick, 
        draw= #1!60!black!85, 
        top color= white, bottom color= #1!70!black!60,
        font= \normalsize \ttfamily \bfseries, text= black,
    },
    myVrtxStyle/.default= gray,
    >= {Stealth[length=2.5mm]}
}

I am slightly better than beginners in tikz. The thought of where and how to begin designing a code to draw this structure is a bit daunting for me at my level. Any idea or suggestion that might help me or make my code easier is appreciated.

4
  • You need to create a MWE. The vertex style is not really relevant for your problem!? Given a solution to your problem, you can then add the style you want afterwards. You also need to supply the e.g. parametric equation for your plot. If you do not know the equation, you can find someting suitable with google "Flower parametric plot" or ask in a math forum. Aug 9, 2021 at 20:16
  • @hpekristiansen thank you for the comment. I provided the style so that people know the restriction(s) that my minimum node size might (or might not) impose. Also my question is how do you think is the best way to approach and solve this problem. Having not decided that how can I provide MWE? In this type of question what should my MWE have?
    – Aria
    Aug 9, 2021 at 20:36
  • Regarding the parametric equation, my graph comes from graph theory and not a figure for an equation. I am not sure if drawing this graph using a "complete" mathematical equation is the best idea. I think it is more likely that a looped simple curvature gives more flexibility and better suits my needs. Maybe I am wrong. One of the reasons I ask this question here is actually to see if someone else more apt in mathematics can suggest such good mathematical expression, but then how do I leave space for my three dots?
    – Aria
    Aug 9, 2021 at 20:43
  • Sebglav demonstrates perfectly how to do it. I just wrongly assumed you would want a special "flower" equation. Aug 9, 2021 at 20:55

1 Answer 1

6

Just as a starting point, you can study this code, using the to[out=<>,in=<>] syntax to draw an automatic curve from the central node to itself (using different anchors).

flower graph

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

\begin{document}

    \begin{tikzpicture}[dot/.style={fill=black, inner sep=0pt, outer sep=0pt, minimum size=3pt,circle}]

        \node[dot,minimum size=6pt] (O) {};

        \draw (O.80) to[out=70,in=110,looseness=500] node[dot,pos=0.2](C11){} node[dot,pos=0.45](C12){} node[dot,pos=0.75](C13){} node[dot,pos=0.85](C14){}  (O.100);
        \node[fit=(O)(C11)(C12)(C13)]{$C_1$};


        \draw (O.0) to[out=0,in=40,looseness=500] node[dot,pos=0.2](C21){} node[dot,pos=0.45](C22){} node[dot,pos=0.75](C23){} node[dot,pos=0.85](C24){} node[dot,pos=0.95](C25){}  (O.20);
        \node[fit=(C21)(C24)]{$C_2$};


        \draw (O.-80) to[out=-70,in=-110,looseness=500] node[dot,pos=0.3](CI1){} node[dot,pos=0.55](CI2){} node[dot,pos=0.85](CI3){}  (O.-100);
        \node[fit=(O)(CI1)(CI2)(CI3)]{$C_i$};

        \draw (O.160) to[out=140,in=180,looseness=500] node[dot,pos=0.1](CK1){} node[dot,pos=0.4](CK2){} node[dot,pos=0.6](CK3){} node[dot,pos=0.8](CK4){} (O.180);
        \node[fit=(CK1)(CK4)]{$C_k$};
    \end{tikzpicture}
\end{document}
3
  • 1
    Thanks man, I think the looseness and pos are really helpful, especially the looseness. Great starting point. I will try it and if everything went well will accept this answer.
    – Aria
    Aug 9, 2021 at 20:51
  • 2
    Couple of small suggestions: you could use a loop to draw the vertices on each loop, and use the path bounding box pseudo-node to place the label rather than the fit hack (which, I have to say, is a very cunning idea) Aug 9, 2021 at 23:24
  • You're right, Andrew, as always. I have to admit I did this very fast and didn't look for the best way to optimize it. Thanks for the suggestions.
    – SebGlav
    Aug 10, 2021 at 17:41

You must log in to answer this question.

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