Tikz에서 다음 Hasse 다이어그램을 어떻게 생성합니까?

Tikz에서 다음 Hasse 다이어그램을 어떻게 생성합니까?

나는 다음과 같은 Hasse 다이어그램을 만들고 싶습니다.

여기에 이미지 설명을 입력하세요

그래서 저는 다음 명령을 쓰기 시작했습니다.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.7]
 \node (6) at (0,10) {$\{4,3,2,1\}$};

 \node (5dot1) at (-6,8) {$\{4,3,1,2\}$};
 \node (5dot2) at (-3,8) {$\{4,2,3,1\}$};
 \node (5dot3) at (0,8) {$\{3,4,2,1\}$};

 \node (4dot1) at (-9,6) {$\{4,1,3,2\}$};
 \node (4dot2) at (-6,6) {$\{4,2,1,3\}$};
 \node (4dot3) at (-3,6) {$\{3,4,1,2\}$};
 \node (4dot4) at (0,6) {$\{2,4,3,1\}$};
 \node (4dot5) at (3,6) {$\{3,2,4,1\}$}; 

 \node (3dot1) at (-14,4) {$\{1,4,3,2\}$};
 \node (3dot2) at (-11,4) {$\{4,1,2,3\}$};
 \node (3dot3) at (-8,4) {$\{2,4,1,3\}$};
 \node (3dot4) at (-5,4) {$\{3,1,4,2\}$};
 \node (3dot5) at (-2,4) {$\{3,2,1,4\}$};
 \node (3dot6) at (1,4) {$\{2,3,1,4\}$};

 \node (2dot1) at (-11,2) {$\{1,4,2,3\}$};
 \node (2dot2) at (-6,2) {$\{1,3,4,2\}$};
 \node (2dot3) at (-3,2) {$\{2,1,4,3\}$};
 \node (2dot4) at (0,2) {$\{3,1,2,4\}$};
 \node (2dot5) at (3,4) {$\{2,3,1,4\}$};

 \node (1dot1) at (-6,0) {$\{1,2,4,3\}$};
 \node (1dot2) at (-3,0) {$\{1,3,2,4\}$};
 \node (1dot3) at (0,0) {$\{2,1,3,4\}$};

  \node (0) at (0,-2) {$\{1,2,3,4\}$};
  \draw (0) -- (1dot1) -- (2dot1) -- (3dot1) -- (4dot1) -- (5dot1) -- (6) -- (5dot2)-- (4dot2)--(3dot2)--(2dot1); 

\end{tikzpicture}
\end{document}

문제는 이 스타일로는 별도의 체인을 만들 수 없기 때문에 모든 체인을 만들 수 있는 더 나은 방법을 찾고 있다는 것입니다.

답변1

나는 지루한 해결책을 생각해 냈습니다.

    \documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.7]
 \node (6) at (-3,10) {$\{4,3,2,1\}$};

 \node (5dot1) at (-6,8) {$\{4,3,1,2\}$};
 \node (5dot2) at (-3,8) {$\{4,2,3,1\}$};
 \node (5dot3) at (0,8) {$\{3,4,2,1\}$};

 \node (4dot1) at (-9,6) {$\{4,1,3,2\}$};
 \node (4dot2) at (-6,6) {$\{4,2,1,3\}$};
 \node (4dot3) at (-3,6) {$\{3,4,1,2\}$};
 \node (4dot4) at (0,6) {$\{2,4,3,1\}$};
 \node (4dot5) at (3,6) {$\{3,2,4,1\}$}; 

 \node (3dot1) at (-14,4) {$\{1,4,3,2\}$};
 \node (3dot2) at (-11,4) {$\{4,1,2,3\}$};
 \node (3dot3) at (-8,4) {$\{2,4,1,3\}$};
 \node (3dot4) at (-5,4) {$\{3,1,4,2\}$};
 \node (3dot5) at (-2,4) {$\{3,2,1,4\}$};
 \node (3dot6) at (1,4) {$\{2,3,4,1\} $};

 \node (2dot1) at (-11,2) {$\{1,4,2,3\}$};
 \node (2dot2) at (-6,2) {$\{1,3,4,2\}$};
 \node (2dot3) at (-3,2) {$\{2,1,4,3\}$};
 \node (2dot4) at (0,2) {$\{3,1,2,4\}$};
 \node (2dot5) at (3,2) {$\{2,3,1,4\}$};

 \node (1dot1) at (-6,0) {$\{1,2,4,3\}$};
 \node (1dot2) at (-3,0) {$\{1,3,2,4\}$};
 \node (1dot3) at (0,0) {$\{2,1,3,4\}$};

  \node (0) at (0,-2) {$\{1,2,3,4\}$};
  \draw (0) -- (1dot1) -- (2dot1) -- (3dot1) -- (4dot1) -- (5dot1) -- (6) -- (5dot2)-- (4dot2)--(3dot2)--(2dot1); (0)--(1dot1)--(2dot1)--(3dot1), (2dot1)--(3dot3);
  \draw (0) -- (1dot2);
  \draw (0) -- (1dot3);

  \draw (1dot1) -- (2dot1);
  \draw (1dot1) -- (2dot3);

  \draw (1dot2) -- (2dot2);
  \draw (1dot2) -- (2dot4);

  \draw (1dot3) -- (2dot3); 
  \draw (1dot3) -- (2dot5); 

  \draw (2dot2) -- (3dot1); 
  \draw (2dot2) -- (3dot4); 

  \draw (2dot3) -- (3dot3);

  \draw (2dot4) -- (3dot4); 
  \draw (2dot4) -- (3dot5);

  \draw (2dot5) -- (3dot5); 
  \draw (2dot5) -- (3dot6); 

  \draw (3dot1) -- (4dot1);

  \draw (3dot2) -- (4dot1);
  \draw (3dot2) -- (4dot2); 

  \draw (3dot3) -- (4dot2);
  \draw (3dot3) -- (4dot4);

  \draw (3dot4) -- (4dot3); 

  \draw (3dot5) -- (4dot5);  

  \draw (3dot6) -- (4dot4); 
  \draw (3dot6) -- (4dot5);   

  \draw (4dot1) -- (5dot1);

  \draw (4dot2) -- (5dot2);

  \draw (4dot3) -- (5dot1);
  \draw (4dot3) -- (5dot3);

  \draw (4dot4) -- (5dot2);   
  \draw (4dot5) -- (5dot3);  

  \draw (5dot1) -- (6);   
  \draw (5dot2) -- (6); 
  \draw (5dot3) -- (6); 




\end{tikzpicture}
\end{document}

위의 코드는 다음을 제공합니다. 여기에 이미지 설명을 입력하세요

훨씬 더 창의적인 솔루션을 기대하고 있습니다!

관련 정보