So I'm trying to plot a graph with routes. I have two questions:
- How can I bend the lines? I would like the 9->4 to go around node 7.
- How can I change the names of the nodes? I want node 9 to be called "0".
Is the method I chose to simple to make these changes?
\begin{tikzpicture}[scale=.1,vertex/.style={draw,circle}, arc/.style={draw,thick,->}]
\foreach [count=\i] \coord in {(40,30),(90,10),(20,70),(100,20),(90,20),(70,30),(70,40),(10,70),(50,50)}{
\node[vertex] (p\i) at \coord {\i};
}
\foreach [count=\r] \row in {{0,0,0,0,0,0,0,0,1},{0,0,0,0,1,0,0,0,0},{1,0,0,0,0,0,0,0,0},{0,1,0,0,0,0,0,0,0},{0,0,0,0,0,1,0,0,0},{0,0,0,0,0,0,1,0,0},{0,0,0,0,0,0,0,0,1},{0,0,1,0,0,0,0,0,0},{0,0,0,1,0,0,0,1,0}}{
\foreach [count=\c] \cell in \row{
\ifnum\cell=1%
\draw[arc] (p\r) edge (p\c);
\fi
}
}
\end{tikzpicture}


