I am tryng to draw the following figure that is a graph with bipartition $X$ and $Y$:
I'm having trouble drawing arcs so they don't intersect. Follows the my code that alreadys did:
\begin{tikzpicture}[
node distance = 5mm and 33mm,
start chain = going below,
doc/.style = {
dot,
on chain
},
dot/.style = {circle, fill, inner sep=0pt, outer sep=0pt, minimum size=3mm,
node contents={}},
FIT/.style = {ellipse, draw, thick, inner xsep=2em, yshift=-1ex, fit=#1},
->-/.style = {decoration={markings,
mark=at position .5 with {\arrow{Straight Barb}}}, draw, postaction={decorate} },
every edge/.append style = {very thick, dotted, shorten <=3mm, shorten >=3mm}
]
% vertices
\foreach \i [count=\j] in {1,2,3,4,5,6,t-1,t}%
{
\ifnum\j=6
\node (m\j) [doc,fill=none];
\else
\node (m\j) [doc,label=left:{$a_{\i}$}];
\node (n\j) [dot, right=of m\j, label=right:{$b_{\i}$}];
\draw[->-, red] (m\j) -- (n\j);
\fi
}
\draw[->-, blue]
(m2) -- (n1);
\draw[->-, blue]
(m1) -- (n2);
\draw[->-, blue]
(n4) -- (m5);
\draw[->-, blue]
(n3) -- (m4);
\draw[->-, blue]
(n3) -- (m4);
\draw[->-, blue]
(n7) -- (m8);
% dashed line
\draw (m5) edge (m7) (n5) edge (n7);
\node[FIT=(m1) (m7), label=$X$] {};
\node[FIT=(n1) (n7), label=$Y$] {};
\end{tikzpicture}
For example in my code the arcs $(b_1,a_2)$ and $(b_2,a_1)$ intersects. I wish to draw as shown in the figure. How I can to do?