Possible Duplicate:
How two connect any arbitrary nodes of tree in tikz
Hello everyone I'm new to latex. And just started using the tikz package to draw. I have here a code below, which is like networking with 6 childs. Now, I want to connect the two childs say child $v_1$ and child $v_2$ to form a triangle from vertices $v_0$, $v_1$ to $v_2$, and I want it to colour with red. Sorry for asking this simple question, I just find it difficult. And I'm actually stacked, thus any help would greatly be appreciated.
\begin{center}
\begin{tikzpicture}
[parent anchor=south,child anchor=north,grow=south]
\tikzstyle{every node}=[ball color=orange,circle,text=white]
\tikzstyle{edge from parent}=[draw,dashed,thick,red]
\node {$v_0$}
child {node {$v_1$}}
child {node {$v_2$}}
child {node {$v_3$}}
child {node {$v_4$}}
child {node {$v_5$}}
child {node {$v_6$}}
;
\end{tikzpicture}
\end{center}
And what if I have a child and a sub-child, and I want the edge that connect the child to the sub-child to be in different colour, say blue. Here's what I did,
\begin{center}
\begin{tikzpicture}
[parent anchor=south,child anchor=north,grow=south]
\tikzstyle{every node}=[ball color=orange,circle,text=white]
\tikzstyle{edge from parent}=[draw,dashed,thick,red]
\node {$v_0$}
child {node (a) {$v_1$}
child {node (b) {$v_2$}}
child {node (c) {$v_3$}}
child {node (d) {$v_4$}}
}
child {node (e) {$v_7$}}
child {node {$v_8$}}
child {node {$\cdots$}}
child {node {$v_{16}$}}
;
\path[draw=red,thick,dashed]
(a) edge[blue] (b)
(a) edge[blue] (c)
(a) edge[blue] (d)
(a) edge[bend right, blue] (e);
\end{tikzpicture}
\end{center}
My network now has an overlapping blue colour. How can I fix this? Thanks!



child {node (<name>) {$v_1$}}, then you can draw a connecting line using\draw [dashed, red] (<first name>) -- (<second name>);. See How two connect any arbitrary nodes of tree in tikz – Jake Sep 04 '12 at 12:26athen that would bechild {node (a) {$v_1$}}. And if I connect the child $v_2$ with node namebthat ischild {node (b) {$v_2$}}. Then if I connect it I would use child {node (a) {$v_1$}}`child {node (b) {$v_2$}}? But I got error. I think that I'm wrong with connecting? – Al-Ahmadgaid Asaad Sep 04 '12 at 12:35\tikzstyleis not recommended as per Should \tikzset or \tikzstyle be used to define TikZ styles? – Claudio Fiandrino Sep 06 '12 at 07:54