How can I increase the spacing between nodes A and B? Right now they are right beside each other. Also, is there a way to prevent node H from overlapping with the other nodes?
The above output is produced from the following commands.
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,quotes, positioning}
\tikzset{block/.style={ellipse, draw, fill=gray!20,
text width=8em, text centered, rounded corners, minimum height=4em, width=4em},
line/.style={draw, -latex'},}
\begin{document}
\begin{tikzpicture}[node distance = 3cm, auto]
\node [block] (A) {A};
\node [block,right of=A] (B) {B};
\node [block, above of=A] (C) {C};
\node [block, above of=B] (D) {D};
\node [block, below left of=B, below right of=A] (E) {E};
\node [block, right of=E] (F) {F};
\node [block, above right of=F, node distance=3cm] (G) {G};
\node [block, above of=G] (H) {H};
% Draw edges
\path [line] (C) edge["a"'] (A) ;
\path [line] (D) edge["b"'] (B) ;
\path [line] (A) -- (E);
\path [line] (B) -- (E);
\path [line] (F) -- (E);
\path [line] (F) edge["g"'] (G) ;
\path [line] (G) edge["h"'] (H);
\end{tikzpicture}
\end{document}
Edit: edited to include environment based on Skillmon's answer. Apologies for not making my code compilable initially


\documentclass{...}, the required\usepackage's,\begin{document}, and\end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Skillmon Nov 19 '18 at 09:23shapeslibrary to getellipseto work. – Skillmon Nov 19 '18 at 10:13