[Tex/LaTex] Two parallel curved edges in Tikz (Or, one curved edge with two colors side-by-side)

colordiagramsnodestikz-pgf

I'm working on a series of (linguistic) diagrams in which nodes are connected by lines. Some lines need to bend to go around other nodes. Each diagram has 16 nodes and lots of lines (>50).

Ideally, I'd be able to draw some lines in two colors. I'd like to do them side-by-side, and I can't figure out a way to achieve that (at least, in a way that scales easily for many lines).

Here's a minimal example showing the sort of line I'd like to get:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (one)    at (2,0);
\coordinate (oneb)   at (2,0.05);
\coordinate (two)    at (0,0);
\coordinate (three)  at (-2,0);
\coordinate (threeb) at (-2,0.05);
\path (one) edge[blue, very thick, bend left=40] (three);
\path (oneb) edge[red, very thick, bend left=40] (threeb);
\path (three) edge[red, very thick, bend left=40] (one);
\filldraw[draw=black,fill=white] (one)   circle (0.2in);
\filldraw[draw=black,fill=white] (two)   circle (0.2in);
\filldraw[draw=black,fill=white] (three) circle (0.2in);
\node at (one)   {one};
\node at (two)   {two};
\node at (three) {three};
\end{tikzpicture}
\end{document}

This results in the following:

Curved two-colored line between two nodes

This method (defining new coordinates) works well enough when there's only one line to draw, but it's not feasible when there are many lines in many different directions.

Is there a simpler way to define a two-color edge like the lower line in the above example?

Best Answer

I have a tricky way using postaction

\documentclass[tikz,border=9]{standalone}
\begin{document}
\tikzset{
    side by side/.style 2 args={
        line width=2pt,
        #1,
        postaction={
            clip,postaction={draw,#2}
        }
    },
    circle node/.style={
        circle,
        draw,
        fill=white,
        minimum size=1.3cm
    }
}
\begin{tikzpicture}
    \node[circle node](one)at(2,0){one};
    \node[circle node](two)at(0,0){two};
    \node[circle node](three)at(-2,0){three};
    \path(one)edge[blue,bend left](three);
    \path(one)edge[side by side={green}{blue},bend right](three);
\end{tikzpicture}

If you found wedge-like ends annoying, you may also cover them by nodes.

\begin{tikzpicture}
    \node(one)at(2,0){};
    \node(two)at(0,0){};
    \node(three)at(-2,0){};
    \path(one)edge[blue,bend left=50](three);
    \path(one)edge[side by side={green}{blue},bend right=50](three);
    \node[circle node]at(one){one};
    \node[circle node]at(two){two};
    \node[circle node]at(three)at(-2,0){three};
\end{tikzpicture}
\end{document}
\end{document}