[Tex/LaTex] how to draw a self loop and also label graph edges in Tikz

diagramstikz-pgf

I have the following tikz code:

\documentclass{scrartcl}

\usepackage{tikz}

\usetikzlibrary{shapes,snakes}

\begin{document}
  \begin{tikzpicture}

        \draw (10,10) node(C)[ellipse,draw] {C};
        \draw (8.5,8.5) node(N)[ellipse,draw] {N};
        \draw (11.2,8.5) node(Y)[ellipse,draw] {Y};
        \draw (7.5,7.2) node(W)[ellipse,draw] {W};
        \draw (9.3,7.2) node(K)[ellipse,draw] {K};

        \draw [->] (C) -- (N) {N};
        \draw [->] (C) -- (Y) {cc};
        \draw [->] (N) -- (W) {dd};
        \draw [->] (N) -- (K) {ee};

  \end{tikzpicture}

\end{document}

It has several problems.

1) the code won't compile because of the bottom drawing commands, what I am trying to do is draw a label next to each of the arrows. If I remove the labels such as {cc} or {dd} etc. for all -> commands, it works, but it doesn't show labels next to the edges.

  1. I want to have a labeled "self-loop" for the C node (labeled with "T"), but when I do draw -> from one node to the same node, it won't draw a self loop.

Best Answer

Something like this?

enter image description here

\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{shapes}

\begin{document}
    \begin{tikzpicture}[->]
    \node[ellipse,draw] (C) at (10,10) {C};
    \node[ellipse,draw] (N) at (8.5,8.5) {N};
    \node[ellipse,draw] (Y) at (11.2,8.5) {Y};
    \node[ellipse,draw] (W) at (7.5,7.2) {W};
    \node[ellipse,draw] (K) at (9.3,7.2) {K};

    \path (C) edge              node[above] {C} (N);
    \path (C) edge              node[above,right] {cc} (Y);
    \path (N) edge              node[above,left] {dd} (W);
    \path (N) edge              node[above, right] {ee} (K);
    \path (C) edge [loop above] node {T} (C);
  \end{tikzpicture}

\end{document}