ノードと接続エッジが円であるグラフを作成する

ノードと接続エッジが円であるグラフを作成する

12 個の円形ノードを円で結ぶグラフを作成する方法を見つけようと苦労しています。コードは次のとおりです。

\begin{tikzpicture}
\graph [nodes={draw, circle}, clockwise, radius=3in, nodes, n=12] {
subgraph C_n [name=outer]
};
\end{tikzpicture}

すると次のようになります: ここに画像の説明を入力してください しかし、私はそれらをつなぐ辺が十二面体ではなく円に似た曲線を描くようにしたいのです。この問題はノードを接続するための反時計回りのパス曲線私はそのコードを再現しようとしましたが、ノードを 4 つではなく 12 個使用して正方形になりました。この方法の唯一の利点は、最終製品で行いたいように、ノードを 1 ではなく 0 から開始できることです。

\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=3cm,    thick,main node/.style={circle,draw,font=\sffamily\Large\bfseries}]
\node[main node] (1) {0};
\node[main node] (2) [below right of=1] {1};
\node[main node] (3) [below right of=2] {2};
\node[main node] (4) [below right of=3] {3};
\node[main node] (5) [below left of=4] {4};
\node[main node] (6) [below left of=5] {5};
\node[main node] (7) [below left of=6] {6};
\node[main node] (8) [above left of=7] {7};
\node[main node] (9) [above left of=8] {8};
\node[main node] (10) [above left of=9] {9};
\node[main node] (11) [above right of=10] {t};
\node[main node] (12) [above right of=11] {e};

\path[every node/.style={font=\sffamily\small}]
(1) edge [bend right] node[right] {} (2)
(2) edge [bend right] node[right] {} (3)
(3) edge [bend right] node[right] {} (4)
(4) edge [bend right] node[right] {} (5);
(5) edge [bend right] node[right] {} (6)
(6) edge [bend right] node[right] {} (7)
(7) edge [bend right] node[right] {} (8)
(8) edge [bend right] node[right] {} (9);
(9) edge [bend right] node[right] {} (10)
(10) edge [bend right] node[right] {} (11)
(11) edge [bend right] node[right] {} (12)
(12) edge [bend right] node[right] {} (1);
\end{tikzpicture}

ここに画像の説明を入力してください

ノードとエッジの両方を円形にする方法はありますか?

答え1

以下についてはどうでしょうか:

\documentclass[tikz]{standalone}
\usetikzlibrary{graphs, graphs.standard}

\begin{document}

\begin{tikzpicture}
\graph [nodes={draw, circle}, clockwise, radius=3in, nodes, n=12, edge={bend left=12}] {
subgraph C_n [name=outer]
};
\end{tikzpicture}

\end{document}

ここに画像の説明を入力してください


編集:あなたの質問をもう一度読んでみると、0 から始めたいということがわかりました。したがって、おそらくこれは受け入れられる解決策です:

\documentclass[tikz]{standalone}
\usetikzlibrary{graphs, graphs.standard}

\begin{document}

\begin{tikzpicture}
\graph [nodes={draw, circle, minimum width=.25in, inner sep=0pt}, clockwise, radius=1in, nodes, n=12, V={0,...,11}, ->, edge={bend left=10,>=stealth}] {
subgraph C_n [name=outer]
};
\end{tikzpicture}

\end{document}

ここに画像の説明を入力してください

関連情報