Drawing many bent paths [(n*(n+1))/2] in a nice way (tikz)

Hmm, you're right that it's tricky to position the nodes so that the same amount of bend will always work. Here's my solution:

\documentclass[tikz, border=5pt]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[
    latent/.style={circle, draw , very thick, inner sep=0pt, minimum size=22mm, align=center},
    twopaths/.style={<->, >=latex, thick, bend right=20}
]

\draw (0,0) node[latent] (n0) {$A$} node[latent, draw=none] (n13) {};
\foreach \name [count=\i,
                evaluate=\i as \ii using int(\i+13),
                evaluate=\i as \p using \i/7] in {C,I,J,K,L,M}{
  \path (1,0) .. controls (6,-3) and (6,-18) .. (0,-21) node[latent, pos=\p] (n\i) {$\name$} node[latent, draw=none, pos=\p] (n\ii) {};
}
\foreach \name [count=\i from 7,
                evaluate=\i as \ii using int(\i+13),
                evaluate=\i as \p using 1-(\i-6)/7] in {H,G,F,E,D,B}{
  \path (-1,0) .. controls (-6,-3) and (-6,-18) .. (0,-21) node[latent, pos=\p] (n\i) {$\name$} node[latent, draw=none, pos=\p] (n\ii) {};
}
\foreach \x in {1,...,13}{
  \foreach \d [evaluate=\d as \y using int(\x+\d)] in {1,...,6}{
    \draw[twopaths] (n\x) to (n\y);
  }
}
\end{tikzpicture}
\end{document}

complete graph


Even if there is no room for an n-gon layout as discussed in comments, I think that using a symmetic layout gives a better chance of a less jumbled appearance, so I moved your bottom node to the right and equalised the spacing.

it would be possible to reduce the coding a bit using some foreach loops but as the amount of bend is chosen by eye in each case, keeping it as you had it is probably simpler. having symmetrised the node layout I then ensured that the arcs were symmetric, using the matching curvature for each opposite pair of nodes.

enter image description here

\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usepackage{calc}
\usetikzlibrary{arrows,positioning,shapes}
\newcommand{\at}{\makeatletter @\makeatother}
\begin{document}
\begin{tikzpicture}[auto, node distance=.2cm,
    latent/.style={circle, draw , very thick, inner sep=0pt, minimum size=22mm, align=center},
    twopaths/.style={<->, thick, >=stealth'}
]

\node [latent] (AFACET) at (0,0) {A};
\node [latent] (BFACET) [below left=0cm and 3cm of AFACET] {B};
\node [latent] (CFACET) [below right=0cm and 3cm of AFACET] {C};
\node [latent] (DFACET) [below=2cm of BFACET] {D};
\node [latent] (EFACET) [below=2cm of DFACET] {E};
\node [latent] (FFACET) [below=2cm of EFACET] {F};
\node [latent] (GFACET) [below=2cm of FFACET] {G};
\node [latent] (HFACET) [below=2cm of GFACET] {H};
\node [latent] (IFACET) [below=2cm of CFACET] {I};
\node [latent] (JFACET) [below=2cm of IFACET] {J};
\node [latent] (KFACET) [below=2cm of JFACET] {K};
\node [latent] (LFACET) [below=2cm of KFACET] {L};
\node [latent] (MFACET) [below=2cm of LFACET] {M};


\draw [twopaths] (AFACET) to [bend right=10] node {} (BFACET);
\draw [twopaths] (AFACET) to [bend left=10] node {} (DFACET);
\draw [twopaths] (AFACET) to [bend left=10] node {} (EFACET);
\draw [twopaths] (AFACET) to [bend left=10] node {} (FFACET);
\draw [twopaths] (AFACET) to [bend left=10] node {} (GFACET);
\draw [twopaths] (AFACET) to [bend left=10] node {} (HFACET);
\draw [twopaths] (AFACET) to [bend left=10] node {} (CFACET);
\draw [twopaths] (AFACET) to [bend right=10] node {} (IFACET);
\draw [twopaths] (AFACET) to [bend right=10] node {} (JFACET);
\draw [twopaths] (AFACET) to [bend right=10] node {} (KFACET);
\draw [twopaths] (AFACET) to [bend right=10] node {} (LFACET);
\draw [twopaths] (AFACET) to [bend right=10] node {} (MFACET);


\draw [twopaths] (BFACET) to [bend left=-10] node {} (DFACET);
\draw [twopaths] (BFACET) to [bend left=25] node {} (EFACET);
\draw [twopaths] (BFACET) to [bend left=30] node {} (FFACET);
\draw [twopaths] (BFACET) to [bend left=30] node {} (GFACET);
\draw [twopaths] (BFACET) to [bend left=30] node {} (HFACET);
\draw [twopaths] (BFACET) to [bend left=-5] node {} (CFACET);
\draw [twopaths] (BFACET) to [bend left=10] node {} (IFACET);
\draw [twopaths] (BFACET) to [bend left=10] node {} (JFACET);
\draw [twopaths] (BFACET) to [bend left=10] node {} (KFACET);
\draw [twopaths] (BFACET) to [bend left=10] node {} (LFACET);
\draw [twopaths] (BFACET) to [bend left=10] node {} (MFACET);


\draw [twopaths] (CFACET) to [bend right=10] node {} (DFACET);
\draw [twopaths] (CFACET) to [bend right=10] node {} (EFACET);
\draw [twopaths] (CFACET) to [bend right=10] node {} (FFACET);
\draw [twopaths] (CFACET) to [bend right=10] node {} (GFACET);
\draw [twopaths] (CFACET) to [bend right=10] node {} (HFACET);
\draw [twopaths] (CFACET) to [bend right=-10] node {} (IFACET);
\draw [twopaths] (CFACET) to [bend right=25] node {} (JFACET);
\draw [twopaths] (CFACET) to [bend right=30] node {} (KFACET);
\draw [twopaths] (CFACET) to [bend right=30] node {} (LFACET);
\draw [twopaths] (CFACET) to [bend right=30] node {} (MFACET);


\draw [twopaths] (DFACET) to [bend left=-10] node {} (EFACET);
\draw [twopaths] (DFACET) to [bend left=20] node {} (FFACET);
\draw [twopaths] (DFACET) to [bend left=30] node {} (GFACET);
\draw [twopaths] (DFACET) to [bend left=50] node {} (HFACET);
\draw [twopaths] (DFACET) to [bend left=10] node {} (IFACET);
\draw [twopaths] (DFACET) to [bend left=10] node {} (JFACET);
\draw [twopaths] (DFACET) to [bend left=10] node {} (KFACET);
\draw [twopaths] (DFACET) to [bend left=10] node {} (LFACET);
\draw [twopaths] (DFACET) to [bend left=10] node {} (MFACET);


\draw [twopaths] (IFACET) to [bend right=-10] node {} (JFACET);
\draw [twopaths] (IFACET) to [bend right=20] node {} (KFACET);
\draw [twopaths] (IFACET) to [bend right=30] node {} (LFACET);
\draw [twopaths] (IFACET) to [bend right=50] node {} (MFACET);
\draw [twopaths] (IFACET) to [bend right=10] node {} (EFACET);
\draw [twopaths] (IFACET) to [bend right=10] node {} (FFACET);
\draw [twopaths] (IFACET) to [bend right=10] node {} (GFACET);
\draw [twopaths] (IFACET) to [bend right=10] node {} (HFACET);

\draw [twopaths] (JFACET) to [bend right=-10] node {} (KFACET);
\draw [twopaths] (JFACET) to [bend right=30] node {} (LFACET);
\draw [twopaths] (JFACET) to [bend right=50] node {} (MFACET);
\draw [twopaths] (JFACET) to [bend right=10] node {} (EFACET);
\draw [twopaths] (JFACET) to [bend right=10] node {} (FFACET);
\draw [twopaths] (JFACET) to [bend right=10] node {} (GFACET);
\draw [twopaths] (JFACET) to [bend right=10] node {} (HFACET);

\draw [twopaths] (KFACET) to [bend right=-10] node {} (LFACET);
\draw [twopaths] (KFACET) to [bend right=40] node {} (MFACET);
\draw [twopaths] (KFACET) to [bend right=10] node {} (EFACET);
\draw [twopaths] (KFACET) to [bend right=10] node {} (FFACET);
\draw [twopaths] (KFACET) to [bend right=10] node {} (GFACET);
\draw [twopaths] (KFACET) to [bend right=10] node {} (HFACET);

\draw [twopaths] (LFACET) to [bend right=-10] node {} (MFACET);
\draw [twopaths] (LFACET) to [bend right=10] node {} (EFACET);
\draw [twopaths] (LFACET) to [bend right=10] node {} (FFACET);
\draw [twopaths] (LFACET) to [bend right=10] node {} (GFACET);
\draw [twopaths] (LFACET) to [bend right=10] node {} (HFACET);

\draw [twopaths] (MFACET) to [bend right=10] node {} (EFACET);
\draw [twopaths] (MFACET) to [bend right=10] node {} (FFACET);
\draw [twopaths] (MFACET) to [bend right=10] node {} (GFACET);
\draw [twopaths] (MFACET) to [bend left=10] node {} (HFACET);

\draw [twopaths] (EFACET) to [bend left=-10] node {} (FFACET);
\draw [twopaths] (EFACET) to [bend left=30] node {} (GFACET);
\draw [twopaths] (EFACET) to [bend left=50] node {} (HFACET);

\draw [twopaths] (FFACET) to [bend left=-10] node {} (GFACET);
\draw [twopaths] (FFACET) to [bend left=40] node {} (HFACET);

\draw [twopaths] (GFACET) to [bend left=-10] node {} (HFACET);

\end{tikzpicture}
\end{document}

Does APA style accept circuit board?

\documentclass[border=9,tikz]{standalone}
\usepackage{}
\usetikzlibrary{}
\begin{document}

\tikzset{
    label/.style={
        line width=1,draw,minimum size=4cm
    },
    <-->/.style={
        line width=1,<->,shorten <=1,shorten >=1
    }
}

\tikz{
    \foreach\A[count=\i]in{A,B,C,D,E,F,G}{
        \draw(0,\i*5-5)node[label]{\A};
    }
    \foreach\A[count=\i]in{H,I,J,K,L,M}{
        \draw(19,\i*6-6)node[label]{\A};
    }
    \foreach\i in{1}{
        \draw[<-->](2,30-1/4)--+(10/4,0)|-(2,1/4);
    }
    \foreach\i in{1,...,5}{
        \draw[<-->](2,30-\i/4-1/4)--+(10/4-\i/4,0)|-(2,\i*5+\i/4+1/4);
        \draw[<-->](2,\i*5+\i/4-7/4)--+(10/4-\i/4,0)|-(2,\i/4+1/4);
    }
    \foreach\i in{1,...,3}{
        \draw[<-->](2,25-\i/4-3/4)--+(5/4-\i/4,0)|-(2,\i*5+5+\i/4+3/4);
        \draw[<-->](2,\i*5+5+\i/4-7/4)--+(5/4-\i/4,0)|-(2,5+\i/4+3/4);
    }
    \foreach\i in{1,...,1}{
        \draw[<-->](2,20-6/4)--+(1/4,0)|-(2,\i*5+10+\i/4+5/4);
        \draw[<-->](2,\i*5+10+\i/4-7/4)--+(1/4,0)|-(2,10+6/4);
    }
    \foreach\i in{1}{
        \draw[<-->](17,30-2/4)--+(-8/4,0)|-(17,2/4);
    }
    \foreach\i in{1,...,4}{
        \draw[<-->](17,30-\i/4-2/4)--+(-8/4+\i/4,0)|-(17,\i*6+\i/4+2/4);
        \draw[<-->](17,\i*6+\i/4-7/4)--+(-8/4+\i/4,0)|-(17,\i/4+2/4);
    }
    \foreach\i in{1,...,2}{
        \draw[<-->](17,24-\i/4-4/4)--+(-4/4+\i/4,0)|-(17,\i*6+6+\i/4+4/4);
        \draw[<-->](17,\i*6+6+\i/4-7/4)--+(-4/4+\i/4,0)|-(17,6+\i/4+4/4);
    }
    \foreach\i in{1}{
        \draw[<-->](17,18-6/4)--+(-1/4,0)|-(17,12+6/4);
    }
    \foreach\i in{1,...,7}{
        \foreach\j in{1,...,6}{
            \draw[<-->](2,\i*5-5+\i/4+\j/4-15/8)-|
            ({(6*(\i+\j)+max(7-\i-\j,0)-max(\i+\j-8,0)+\j-18.5)/8+4.2},{(6*(\i+\j)+max(7-\i-\j,0)-max(\i+\j-8,0)+\j-18.5)/2+.25})--+(3.75,0)|-(17,\j*6-6+\j/4+\i/4-15/8);
        }
    }
}

\end{document}

Tags:

Tikz Pgf