I see that you're using spring layout
but it seems to me that the resulting graphic is more like distributed charges (electric charges) making me think that the spring electrical layout
is more suiting. Just by using it you already see the difference in the final graph. Furthermore, to fine tune the graphic you can use the nudge=<coordinate>
key (or the variants nudge up
, down
, left
and right
), although to mee it seems a little rudimentar, but if the drawing needs 'simple' nudges, than it's ok:
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{graphs,graphdrawing}
\usegdlibrary{force}
\begin{document}
\tikz \graph [spring electrical layout, random seed=1] {
A -- F;
A -- I;
B -- F;
C -- D;
C -- F;
D -- E;
D -- H;
D -- I;
E -- I;
F -- J[nudge=(210:10mm)];
I -- J;
G[nudge=(260:11mm)] -- J;
G -- A;
G -- I;
};
\end{document}

You can alse try to set electric charge
s to the nodes, fine tunning the intensity they repell (positive values) or atract (negative values) the connected nodes. Though with this way the result is sometimes quite unpredictable.
Second Approach
If you look at the previous drawing seems that node J
has an invisible connection with nodes C
and D
. The same could be said for the node G
with F
. My thought was, if I could make this invisible connection then the resulting graph would probably be what the OP wants without any nudge
s and with more reliable graph. To do so we must give the line-to operator (--
) the option draw=none
when making the Connections (I also took the liberty of shortening the code a little):
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{graphs,graphdrawing}
\usegdlibrary{force}
\begin{document}
\tikz \graph [spring electrical layout] {
A -- F -- C -- D -- E -- I -- A;
D -- I;
B -- F;
H -- D;
I -- J -- F;
I -- G -- A;
G -- J;
% invisible connections
D --[draw=none] J --[draw=none] C;
G --[draw=none] F;
};
\end{document}
The result is nearly the same as before, but should give no Errors this time:
