![绘制带有顶点对的图形](https://linux22.com/image/376357/%E7%BB%98%E5%88%B6%E5%B8%A6%E6%9C%89%E9%A1%B6%E7%82%B9%E5%AF%B9%E7%9A%84%E5%9B%BE%E5%BD%A2.png)
答案1
该图的标签基于维基百科中的 Kneser 符号示例。
\documentclass[tikz,border=3.14pt]{standalone}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes.geometric}
\begin{document}
\tikzset{c/.style={draw,circle,fill=black,minimum size=4pt,inner sep=0pt,
anchor=center},
d/.style={draw,circle,fill=white,minimum size=4pt,inner sep=0pt, anchor=center}}
% from https://tex.stackexchange.com/a/294254/121799
\def\colorlist{{"cyan", "red", "orange", "yellow", "green", "gray", "blue", "violet"}}
\begin{tikzpicture}[font=\tiny]
\pgfmathtruncatemacro{\Ncorners}{5}
\node[regular polygon,regular polygon sides=\Ncorners,minimum size=3cm]
(poly\Ncorners) {};
\node[draw,regular polygon,regular polygon sides=\Ncorners,minimum size=5cm]
(outerpoly\Ncorners) {};
\foreach\x in {1,...,\Ncorners}{
\pgfmathtruncatemacro{\myprevx}{ifthenelse(\x==1,5,mod(\Ncorners+\x-1,\Ncorners))}
\pgfmathtruncatemacro{\mynextx}{mod(\Ncorners+\x,\Ncorners)+1}
\pgfmathsetmacro\myfill{\colorlist[\myprevx]}
\node[d,label={{18+\x*72}:{$\{\myprevx,\mynextx\}$}},color=\myfill] (outerpoly\Ncorners-\x) at (outerpoly\Ncorners.corner \x){};
\pgfmathtruncatemacro{\myprevx}{ifthenelse(\x==2,5,mod(\Ncorners+\x-2,\Ncorners))}
\pgfmathtruncatemacro{\mynextx}{mod(\Ncorners+\x+1,\Ncorners)+1}
\ifcase\x
\pgfmathtruncatemacro{\ang}{0}
\or
\pgfmathtruncatemacro{\ang}{0}
\or
\pgfmathtruncatemacro{\ang}{90}
\or
\pgfmathtruncatemacro{\ang}{120}
\or
\pgfmathtruncatemacro{\ang}{60}
\or
\pgfmathtruncatemacro{\ang}{90}
\fi
\pgfmathsetmacro\myfill{\colorlist[\myprevx]}
\node[d,label={{\ang}:{$\{\myprevx,\mynextx\}$}},color=\myfill] (poly\Ncorners-\x) at (poly\Ncorners.corner \x){};
\draw (poly\Ncorners-\x) -- (outerpoly\Ncorners-\x);
}
\foreach\X in {1,...,\Ncorners}{
\foreach\Y in {1,...,\Ncorners}{
\pgfmathtruncatemacro{\Z}{abs(mod(abs(\Ncorners+\X-\Y),\Ncorners)-2)}
\ifnum\Z=0
\draw (poly\Ncorners-\X) -- (poly\Ncorners-\Y);
\fi
}
}
\end{tikzpicture}
\end{document}
更新: 颜色。