Automatically center label between Tikz nodes

Viewed 6085

I'm new on using the latex package Tikz, and I'm trying to write a Tableau. My problem is to create sufficient space between sibling so that I can put a label in the center. This is what I've done. I would like to avoid manual spacing as much as possible, so I'm looking for a general solution.

 \begin{tikzpicture}[auto, node distance=1.3cm]


 \node (A) {$X^1$};
 \node (B) [below of=A] {$X^2$};
 \node (C) [below of=B] {$X^3$};
 \node (D) [below of=C] {$X^4$};
 \node (E) [below of=D] {$X^5$};  
 \node (F) [label={[label distance=-1cm] \color{green}{Complete}}, below left of=E,left=1cm] {$X^6$};
 \node (G) [below right of=E, right=1cm] {$X^7$};
 \node (H) [below left of=G,left=1cm] {$X^8$};
 \node (I) [label={[label distance=-1cm] \color{red}{Closed}}, below right of=G, right=1cm] {$X^9$};
 \node (L) [label={[label distance=-1cm] \color{red}{Closed}}, below of=H] {$X^{10}$};


 \path (A) edge  (B);
 \path (B) edge (C);
 \path (C) edge (D);
 \path (D) edge (E);
 \path (E) edge  node [below=0.3cm, right=0.4cm]{PB-Rule}  (F)
        edge (G);
  \path (G) edge node [below=0.3cm, right=0.4cm] {PB-Rule} (H)
        edge  (I);          
 \path (H) edge node {E-Rule} (L);

\end{tikzpicture}

Any Suggestion ?

1 Answers
Related