# Edge not crossing other edges in a TikZ graph

The following code

\documentclass{article}

\usepackage{tkz-berge}
%\usepackage{tkz-graph}

\usepackage{comment}
%\usepackage{polski}
\usepackage[cp1250]{inputenc}

\usetikzlibrary{positioning}

\textwidth16cm
\begin{document}

\def\kob{circle (3pt)} % kółko białe
\def\koc{circle (3pt)} % kółko czarne do \filldraw[black]

\def\ticircw{\tikzset{VertexStyle/.style = {
shape = circle,
fill = black,
inner sep = 0pt,
outer sep = 0pt,
%minimum size = 8pt,
minimum size = 0pt,
draw}}
}

\begin{tikzpicture}
\tikzset{VertexStyle/.style = {
shape = circle,
fill = black,
inner sep = 0pt,
outer sep = 0pt,
%minimum size = 8pt,
minimum size = 0pt,
draw}}
\SetVertexNoLabel
%\grEmptyPath[Math,prefix=p,RA=2,RS=0]{5}
%\grEmptyPath[Math,prefix=q,RA=2,RS=3]{5}
\grPath[Math,prefix=p,RA=0.5,RS=0]{6}
\begin{scope}[xshift=1.25 cm]
\grPath[Math,prefix=q,RA=1,RS=1.73]{1}
\grPath[Math,prefix=n,RA=1,RS=-1.73]{1}
%\EdgeFromOneToAll{r}{q}{0}{4}
\Edges(q0,p0,n0,p1,q0,p2,n0,p3,q0,p4,n0,p5,q0);
\Edge[style={bend right=120}](p0)(p5)
\draw[fill=white] (p0)\kob;
\filldraw[black] (p1)\koc;
\draw[fill=white] (p2)\kob;
\filldraw[black] (p3)\koc;
\draw[fill=white] (p4)\kob;
\filldraw[black] (p5)\koc;
\filldraw[black] (q0)\koc;
\draw[fill=white](n0)\kob;

%\draw[fill=white] (p2)\kob;
%\draw[fill=white] (q3)\kob;
\end{scope}
\end{tikzpicture}

\end{document}


gives

(the black part).

Is there any standard possibility to change the black curve to a curve not crossing edges, as the red one?

• Try adding \node (proforma) [inner sep=0pt,below= 1cm of n0] {}; \path [draw,bend left=77] (proforma) to (p0); \path [draw,bend right=77] (proforma) to (p5); at the end of your tikzpicutre right before \end{scope}. Not yet finished. – Shade Apr 3 '18 at 19:15

UPDATE: I missed the fact that these were coordinates, not nodes, and used the parameters from Przemysław Scherwentke's comment, and made the code a bit leaner (thanks to @cfr).

\documentclass{article}
\usepackage{tkz-berge}
\usepackage[cp1250]{inputenc}

\usetikzlibrary{positioning}

\textwidth16cm
\begin{document}
\begin{tikzpicture}
\tikzset{VertexStyle/.style = {
shape = circle,
fill = black,
inner sep = 0pt,
outer sep = 0pt,
%minimum size = 8pt,
minimum size = 0pt,
draw}}
\def\kob{circle (3pt)}
\def\koc{circle (3pt)}
\SetVertexNoLabel
\grPath[Math,prefix=p,RA=0.5,RS=0]{6}
\begin{scope}[xshift=1.25 cm]
\grPath[Math,prefix=q,RA=1,RS=1.73]{1}
\grPath[Math,prefix=n,RA=1,RS=-1.73]{1}
\Edges(q0,p0,n0,p1,q0,p2,n0,p3,q0,p4,n0,p5,q0);
\coordinate (b0) at ([yshift=-15pt]n0);
\draw[blue,thick] (p0) to [out=-105,in=180] (b0) to [out=0,in=-75] (p5);
\draw[fill=white] (p0)\kob;
\filldraw[black] (p1)\koc;
\draw[fill=white] (p2)\kob;
\filldraw[black] (p3)\koc;
\draw[fill=white] (p4)\kob;
\filldraw[black] (p5)\koc;
\filldraw[black] (q0)\koc;
\draw[fill=white](n0)\kob;
\end{scope}
\end{tikzpicture}
\end{document}

• +1, but I will wait a little for possible other solutions. – Przemysław Scherwentke Apr 3 '18 at 20:36
• @PrzemysławScherwentke Sure. Just for curiosity: what features should the solution have? Do you want it to automatically avoid crossings? Or do you want it to use the \Edge syntax? – user121799 Apr 3 '18 at 20:50
• Avoiding crossing automatically seems to be very difficult. However, some possibilities of controlling distance of the rounded edge from a vertex would give me enough control on the shape of a graph. – Przemysław Scherwentke Apr 3 '18 at 20:56
• It seems that you prepared the needed parts. After changing to \coordinate (b0) at ([yshift=-15pt]n0); \draw(p0) to [out=-105,in=180] (b0) to [out=0,in=-75] (p5); it looks pretty good for me. – Przemysław Scherwentke Apr 3 '18 at 21:14
• Adding +1 for your excellent work. – Sebastiano Apr 3 '18 at 21:28