带有虚线集 U 的二分图

带有虚线集 U 的二分图

我正在绘制下图。遵循已经编写的代码:

剩下的就是绘制虚线集 U 并将顶点 z 向下放置。最后,剩下的就是绘制包含在 $SI$ 中的集合 $ X_1 $ 和 $ X_2 $。请问如何做到这一点?

    \documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{chains,fit,shapes}
\begin{document}
    \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},]
        
        \node (y) [V, on chain, label={left:$y$}];
% vertices 
        \foreach \i in {0,...,3} 
        {
            \node (n1\i) [on chain]{};
            \node (n2\i) [above right=0.01mm and 22mm of n1\i]{};
        }
        \node (z) [V,above right=0.01mm and 22mm of y,label={right:$z$}]{};
        % Set I
        \node [fit=(n10) (n13)(y),label=above:$I$] {};
        % Set S-I
        \node [fit=(z)(n20) (n23),label=above:$S-I$] {};
        
        \draw [->,shorten >=1mm, shorten <=1mm](y) edge (z);
    \end{tikzpicture} 
\end{document}

插图

相关内容