1

The Figure that want draw

\begin{center}
\begin{tikzpicture}[
    node distance = 7mm and 21mm,
      start chain = going below,
        V/.style = {circle, draw, 
        fill=#1, 
        inner sep=0pt, minimum size=3mm,
        node contents={}},
 every fit/.style = {ellipse, draw=#1, inner ysep=-1mm, inner xsep=5mm},]
% vertices 
\foreach \i in {0,...,3} 
{
\ifnum\i=0
    \node (n2\i) [V, above right=0.001mm and 22mm of n1\i,
    label={right:$z_{\i}$}];
\else
    \node (n2\i) [V, above right=0.001mm and 22mm of n1\i,
    label={right:$z_{\i}$}];
    \node (n1\i) [V,
    on chain
    ,label={left:$y_{\i}$}];
\fi
}

% Conjunto U_1
\node [fit=(n11) (n13),label=above:$I$] {};
% Conjunto U_2
\node [fit=(n20) (n23),label=above:$S-I$] {};

\draw [->,shorten >=1mm, shorten <=1mm]
        (n20) edge (n11) 
        (n11) edge (n21)
        (n21) edge (n12)
        (n22) edge (n13)
        (n12) edge (n22)
        (n13) edge (n23);
\end{tikzpicture}
\end{center}

I need draw this graph with t vertices in partition I and t+1 vertices in partition S-I. Below as shown the figure. Anyone who can help I will be grateful!

1
  • Any news? Does my answer fit your expectation? If it, it will be nice from you to accept it (by clicking on check mark at to left side of answer).
    – Zarko
    Jan 28 at 23:55
1

enter image description here

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta,
                chains,
                decorations.markings}

\begin{document}
    \begin{tikzpicture}[
node distance = 7mm and 21mm,
  start chain = going below,
     U/.style = {circle, draw, fill=#1,
                inner sep=0pt, minimum size=3mm, 
                node contents={}},
     V/.style = {U, on chain},
every edge/.style = {decoration={markings,
                                 mark=at position .5 with {\arrow{Straight Barb}}},
                     draw, postaction={decorate}
                     },
                    ]
% vertices
\foreach \i [count=\j from 0] in {1,2,3}%
{
    \node (n1\j) [V,label=left:{$y_{\i}$}];
    \node (n2\j) [U,above right=of n1\j, label=right:{$z_{\j}$}];
}
    \node (n23) [U,right=of n12, label=right:{$z_{3}$}];
    \node (n13) [on chain]      {$\vdots$};
    \node (n24) [right=of n13]  {$\vdots$};
    \node (n14) [V,label=left:{$z_{t}$}];
    \node (n25) [U,right=of n14, label=right:{$z_{t}$}];
%
\node [above=1mm of n10 |- n20, label=left:$I$] {}; 
\node [above=1mm of n20, label=right:{$S/I$}] {};
% connections 
\foreach \i [count=\j from 0] in {1,2,3}%
{
\draw   (n2\j) edge (n1\j) 
        (n1\j) edge (n2\i);
}
\draw   (n14) edge (n25);
\end{tikzpicture}
\end{document}                

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.