5

I am trying to draw a (undirected) graph using the Tikz package, such that there exist multiple edges between some nodes in the graph. Is it possible to do such a thing? I tried the following code to try and get atleast two edges between the nodes, but to no avail:

\begin{tikzpicture}
[scale=.8,auto=left,every node/.style={circle,fill=blue!20}]
\node (nA) at (1,10) {A};
\node (nB) at (9,10) {B};
\node (nC) at (5,8)  {C};
\node (nD) at (5,6)  {D};

\foreach \from/\to in {nA/nC,nA/nD,nC/nB,nD/nB,nC/nA,nD/nA,nB/nD,nB/nC}
\draw (\from)--(\to);
\end{tikzpicture}

Could someone help me out with this? Thanks!

Qrious
  • 677
  • 2
  • 9
  • 15

1 Answers1

11

How about replace the

\draw (\from)--(\to);

with

\path (\from) edge [bend left] (\to);
yanto
  • 136
  • 1
  • 2
  • 3
    Can we `bend left` with different radius if we have more than 3 edges between two nodes? We can connect w/o bending, bend left, then bend right. But if I have a 4th or more edges ... I want to add them without overlapping. – sAguinaga Mar 11 '18 at 18:59
  • 1
    It is possible to set `bend left/right=angle` so you can have `bend left=15`, `bend left=30`… – Jan Tojnar May 10 '20 at 12:28