[Tex/LaTex] How to modify the distance between branches when drawing trees using TiKZ

tikz-pgftikz-trees

I want to modify the distance between a parent node and a child node when drawing a tree using TiKZ package. I looked at the example at TiKZ site, and add a property called sibling distance. However, no matter where I added (parent and child), it points to a wrong place.

enter image description here

As we can see, if I add more children to node 2, it will overlap with 5. Adding a sibling distance yield even a worse result:

enter image description here

And I couldn't figure out what caused this issue. Any idea? Thank you.

Minimal Example

\documentclass[a4paper,landscape]{scrartcl}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[auto]
    \node [circle,draw] (z){0}
        child { [sibling distance=10mm]
            node[circle,draw] (a) {1}
            child { 
                node[circle,draw] (c) {5} 
            }
            child { 
                node[circle,draw] (d) {5} 
            }   
            child { 
                node[circle,draw] (e) {5} 
            }   
            child { 
                node[circle,draw] (f) {5} 
            }   
        }
        child {
            node[circle,draw] (b) {2}
        }
        ;

    \path (z) -- (a);
    \path (z) -- (b);
    \path (a) -- (c);
    \end{tikzpicture}
\end{document}

Best Answer

You can change the sibling distance for each level of the tree individually, using level <number>/.style={sibling distance=<value>}:

\documentclass[a4paper,landscape]{scrartcl}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[
    auto,
    level 1/.style={sibling distance=40mm},
    level 2/.style={sibling distance=10mm}]
    \node [circle,draw] (z){0}
        child {
            node[circle,draw] (a) {1}
            child { 
                node[circle,draw] (c) {5} 
            }
            child { 
                node[circle,draw] (d) {5} 
            }   
            child { 
                node[circle,draw] (e) {5} 
            }   
            child { 
                node[circle,draw] (f) {5} 
            }   
        }
        child {
            node[circle,draw] (b) {2}
        }
        ;
    \end{tikzpicture}
\end{document}