I am trying to make a multi graph, but the edges all overlap one another. This question has already been asked but I have not been able to find a solution that will work for the format I am using.
I have the following code so far:
\begin{tikzpicture}[scale=2,vertex/.style={circle, fill=black!30, draw, minimum size=.3cm, inner sep=0pt},
arc1/.style={draw=red,line width=1.5pt},
arc2/.style={draw=blue,line width=1.5pt},
arc3/.style={draw=orange,line width=1.5pt},
arc4/.style={draw=purple,line width=1.5pt},
arc5/.style={draw=green,line width=1.5pt}]
\foreach [count=\i] \coord in {(0,0), (1,1), (-1,1), (1,2), (-1,2)}{
\node[vertex] (p\i) at \coord {\i};
}
\foreach [count=\r] \row in {{0,1,0,0,0}, {1,0,0,1,0}, {0,0,0,0,0}, {0,1,0,0,0}, {0,0,0,0,0}}{
\foreach [count=\c] \cell in \row{
\ifnum\cell=1%
\draw[arc1] (p\r) edge (p\c);
\fi
}
}
\foreach [count=\r] \row in {{0,0,1,0,0}, {0,0,0,0,0}, {1,0,0,0,1}, {0,0,0,0,0}, {0,0,1,0,0}}{
\foreach [count=\c] \cell in \row{
\ifnum\cell=1%
\draw[arc2] (p\r) edge (p\c);
\fi
}
}
\foreach [count=\r] \row in {{0,1,0,0,0}, {1,0,1,0,0}, {0,0,1,0,1}, {0,0,0,0,0}, {0,0,1,0,0}}{
\foreach [count=\c] \cell in \row{
\ifnum\cell=1%
\draw[arc3] (p\r) edge (p\c);
\fi
}
}
\foreach [count=\r] \row in {{0,0,1,0,0}, {0,0,1,1,0}, {1,1,0,0,0}, {0,1,0,0,0}, {0,0,0,0,0}}{
\foreach [count=\c] \cell in \row{
\ifnum\cell=1%
\draw[arc4] (p\r) edge (p\c);
\fi
}
}
\foreach [count=\r] \row in {{0,1,0,0,0}, {1,0,1,0,0}, {0,1,0,0,1}, {0,0,0,0,1}, {0,0,1,1,0}}{
\foreach [count=\c] \cell in \row{
\ifnum\cell=1%
\draw[arc5] (p\r) edge (p\c);
\fi
}
}
\end{tikzpicture}
I just need each coloured edge to be visible. I am sure it is a simple change to the line arc1/.style={draw=red,line width=1.5pt},
but everything that I have tried will not work. Any help will be much appreciated.