[Tex/LaTex] How to add labels in the arrows

arrowserrorsnodespathstikz-pgf

I have the following code:

\begin{tikzpicture}
\node (A) at (0, 0) [shape=circle,draw] {$\BC^n$};
\node (B) at (4, 0) [shape=circle,draw] {$\BC$};
\draw [->] (A) to [out=60,in=120, bend right]  (B);
\draw [->] (B) to [out=60,in=120, bend right ] (A);
 \path[->]  (A) edge [out=140,in=80,looseness=12]  (A);
 \path[->] (A) edge [out=-190,in=230,looseness=12] (A);
\end{tikzpicture}

I want to add labels to my arrows but when I insert the {some label} option I get an error when compiling. Any solutions?

Best Answer

Here are two ways for drawing a labeled graph.

enter image description here

\documentclass[border=2mm]{standalone}
\newcommand\BC{X}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[baseline=(A.base)]
\node (A) at (0, 0) [shape=circle,draw] {$\BC^n$};
\node (B) at (4, 0) [shape=circle,draw] {$\BC$};
\draw [->] (A) to [out=60,in=120, bend right] node[below]{a}  (B);
\draw [->] (B) to [out=60,in=120, bend right ] node[above]{b} (A);
 \path[->]  (A) edge [out=140,in=80,looseness=12] node[above]{c}  (A);
 \path[->] (A) edge [out=-190,in=230,looseness=12] node[below]{d} (A);
\end{tikzpicture}
\qquad
\begin{tikzpicture}%
  [baseline=(A.base),
   vertex/.style={circle,draw,inner sep=2pt,minimum size=2em},
   auto,>=stealth
  ]
  \node[vertex] (A) {$\BC^n$};
  \node[vertex,right=2cm of A] (B) {$\BC$};
  \path[->] (A) edge[bend right] node[swap]{a} (B)
                edge[loop above] node{c} (A)
                edge[loop left]  node{d} (A)
            (B) edge[bend right] node[swap]{b} (A);
\end{tikzpicture}
\end{document}