[Tex/LaTex] TikZ Graph with a circle alround some of it’s vertices

tikz-pgftkz-graph

I want to draw the following Graph with the tikz package and/or tkz-graph package, but I'm still very new to this. Could someone please help me? 🙂

enter image description here

Best Answer

Here is one attempt using tikz:

enter image description here

The code:

\documentclass[border=5mm,tikz]{standalone}
\usepackage{mwe}
\usepackage{tikz}
\begin{document}

    \begin{tikzpicture}
      \draw(0,0)--(2,0)--(0,1)--(2,1)--(0,0);
      \draw(0,3)--(2,3);
      \draw[very thin, double distance=2pt](0.6,2.2)--(1.4,1.6);
      \draw[very thin, double distance=2pt](0.6,1.6)--(1.4,2.2);
      \foreach \y/\lab in {0/1,1/2,3/h} {
          \filldraw(0,\y) circle[radius=2pt]node[left]{$v_{\lab}$};
      }
      \foreach \y/\lab in {0/n-h+1,3/n,-2/h+1} {
          \filldraw(2,\y) circle[radius=2pt]node[right=3mm]{$v_{\lab}$};
      }
      \filldraw(2,1) circle[radius=2pt];
      \node at (0,2) {$\vdots$};
      \node at (2,2) {$\vdots$};
      \node at (2,-1) {$\vdots$};
      \draw[rounded corners] (1.7,-2.3) rectangle (2.3,3.3);
    \end{tikzpicture}

\end{document}
Related Question