2

I want to draw graph representation with some labels that look like this:

enter image description here

The working that I'm using is the following:

\begin{figure}[h!]
    \centering
    \begin{tikzpicture}
    \centering
    \coordinate (0) at (0,0);
    \coordinate (A) at (4,0);
    \coordinate (B) at (0,-2);
    \coordinate (C) at (4,-2);
    \coordinate (E) at (1.5,1);
    \coordinate (F) at (5.5,1);
    \coordinate (G) at (1.5,-1);
    \coordinate (H) at (5.5,-1);
    \coordinate (I) at (1.5,-0.8);
    
    \draw (0) node[left]{$MI$};
    \draw (E) node[above]{$MC$};
    \draw (F) node[above]{$TM$};
    \draw (B) node[left]{$BMI$};
    \draw (C) node[below]{$FMI$};
    \draw (H) node[right]{$FM$};
    \draw (I) node[left]{$BM$};
    \draw [fill=black] (0) circle (2pt);
    \draw [fill=black] (A) circle (2pt);
    \draw [fill=black] (B) circle (2pt);
    \draw [fill=black] (C) circle (2pt);
    \draw [fill=black] (E) circle (2pt);
    \draw [fill=black] (F) circle (2pt);
    \draw [fill=black] (G) circle (2pt);
    \draw [fill=black] (H) circle (2pt);
    
    \draw (0) -- (A) -- (C) -- (B) -- (0) -- (E);
    \draw (E) -- (F) -- (H) -- (G) -- (E);
    \draw (A) -- (F);
    \draw (C) -- (H);
    \draw (B) -- (G);
    \end{tikzpicture}
    \caption{Graph Representation of $FTTM$ version 1 and $FTTM$ version 2}
    \label{figure:graph-representation}
\end{figure}

that produces:

enter image description here

Anyone please help.

1 Answer 1

3

Here is a proposal using a pic for the repeating scheme.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[bullet/.style={circle,fill,inner sep=1.5pt,},
    pics/A-graph/.style={code={
     \draw (-2,0) node[bullet,label={above left:$A_2^{#1}$}] (A-#1-2){}
      -- (-1,1) node[bullet,label={above right:$A_1^{#1}$}] (A-#1-1){}
      -- (1,1) node[bullet,label={above left:$A_n^{#1}$}] (A-#1-n){}
      -- (2,0) node[bullet,label={above right:$A_{n-1}^{#1}$}] (A-#1-m){};
     \draw[densely dotted]  (A-#1-2) to[out=-90,in=-90] (A-#1-m);
     \draw[blue!80,line width=3pt,-{Stealth[width=7pt,length=5pt]}] 
        (2.1,-0.5) -- (2.6,-0.5)node[black,right]{$FTTM_n^{#1}$};
    }}]
 \path (60:5.5) pic{A-graph=1} (60:4) pic{A-graph=2}
    (60:2) pic{A-graph=j} (0,0) pic{A-graph=k};
 \foreach \X in {2,1,n,m}
 {\draw plot[samples at={1,2,j,k}] (A-\x-\X);}
\end{tikzpicture}
\end{document}

enter image description here

Or, to address the question in the comment, a dashed line can be achieved by using the dashed key.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[bullet/.style={circle,fill,inner sep=1.5pt,},
    pics/A-graph/.style={code={
     \draw (-2,0) node[bullet,label={above left:$A_2^{#1}$}] (A-#1-2){}
      -- (-1,1) node[bullet,label={above:$A_1^{#1}$}] (A-#1-1){}
      -- (1,1) node[bullet,label={above:$A_n^{#1}$}] (A-#1-n){}
      -- (2,0) node[bullet,label={above right:$A_{n-1}^{#1}$}] (A-#1-m){};
     \draw[densely dotted]  (A-#1-2) to[out=-90,in=-90] (A-#1-m);
     \draw[blue!80,line width=3pt,-{Stealth[width=7pt,length=5pt]}] 
        (2.1,-0.5) -- (2.6,-0.5)node[black,right]{$FTTM_n^{#1}$};
    }}]
 \path (75:5.5) pic{A-graph=1} (75:4) pic{A-graph=2}
    (75:2) pic{A-graph=j} (0,0) pic{A-graph=k};
 \foreach \X in {2,1,n,m}
 {\draw[dashed] plot[samples at={1,k}] (A-\x-\X);}
\end{tikzpicture}
\end{document}

enter image description here

2
  • How can I change all the straight line from A_k^2 to A_2^2 and so on to be densely dotted line, but at the same time maintain the straight line from A_2^2 to A_2^1 exactly like the picture? @Schrödinger's cat Feb 26, 2020 at 4:04
  • @AmirulAizad I added such an example.
    – user194703
    Feb 26, 2020 at 4:09

You must log in to answer this question.

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