i got this problem of overlapping nodes in a Branch-and-Bound tree using TikZ.
Here's my code:
\documentclass[
12pt,
oneside,
a4paper,
english,
french,
spanish,
brazil
]{abntex2}
\usepackage{graphicx}
\usepackage{float}
\usepackage{tikz}
\usetikzlibrary{calc, shapes,positioning}
\usepackage[lmargin=2.5cm,rmargin=2.5cm,tmargin=2.5cm,bmargin=2.5cm]{geometry}
\begin{document}
\begin{figure}[H]
\centering
\tikzset{thick,
tree node/.style = {align=center, inner sep=0pt, font = \footnotesize},
every label/.append style = {font=\footnotesize},
PL/.style = {draw, circle, minimum size = 10mm, inner sep=0pt,
top color=white, bottom color=blue!20,align=center},
ENL/.style = {% edge node left
font=\footnotesize, left=1pt},
ENR/.style = {% edge node right
font=\footnotesize, right=1pt},
grow = down,
sibling distance = 8cm,
level distance = 2cm
}
\fbox{
\begin{tikzpicture}[every node/.style={font=\scriptsize}]
\node [PL] {$1$}
child{node [PL] {$2$}
child{node [PL] {$3$}
child{node [PL] {$4$}}
child{node [PL] {$5$}}}
child{node [PL] {$6$}
child{node [PL] {$7$}}
child{node [PL] {$8$}}}
}
child{node [PL,] {$9$}
};
\end{tikzpicture}
}
\caption{Árvore de busca do exemplo numérico.}
\end{figure}
\end{document}
So, as result you get this picture:
As you can see, the node 7 is overlapping the node 5, how can i fix this?



