# tikz graphs: draw an edge from a node without a goal node

Is it possible to write an edge going from a node but out into nowhere, see image below (ignore the trace of goal node that is visible)

-
If you are doing diagrams like this, you may be interested in the tikz-cd package. – Manuel Dec 4 '12 at 10:20
What is the difference between the two packages? is tikz-cd a subset of tikz ? – Parham Dec 4 '12 at 10:54
tikz-cd is a bunch of macros which use tikz. i.e. the arrow you want to do would be written like \arrow[loop above]{}{1} inside a tikzcd environment. – Manuel Dec 4 '12 at 13:56
tikz-cd is a bunch of macros which use tikz. i.e. the arrow you want to do would be written like \arrow[loop above]{}{1} inside a tikzcd environment. The only problem is that I don't know how to make the circles, that's why I don't write an answer. – Manuel Dec 4 '12 at 14:05
@Manuel : tikz-cd is designed for commutative diagrams. While you can probably tweak it to draw graphs or automata, tikz libraries such as automata are probably more suitable for this purpose. – T. Verron Dec 4 '12 at 15:31

Something like \draw[->] (node) --++(0:2cm) node[above,midway]{0}; or \draw[->] (node) --++(2cm,0) node[above,midway]{0}; ?

-
Nice! Is it possible to get the arrowhead too? – Parham Dec 4 '12 at 10:40
@Parham: I'm not sure to understand your comment, \draw[->] means draw a line with an arrowhead at the end. If you don't see the arrowhead with this command, may be it's better that you edit your question and include a minimal 'not' working example. – Ignasi Dec 4 '12 at 10:45
Nevermind, a typo was the culprit. Thanks though! – Parham Dec 4 '12 at 11:10
@Parham: Your welcome! – Ignasi Dec 4 '12 at 11:31

For automata drawings, you can also use the tikz library automata.

It doesn't really bring anything new for your example, but if you try to extend it to a real automaton, it may prove easier to use that syntax.

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{automata}

\begin{document}

\begin{tikzpicture}
\node[state,initial by arrow, initial text={}] (s) {$b_{0}b_{1}$};
\path[->] (s) edge[loop above] node {1} ();
\path[->] (s) edge node[above] {0} +(1,0);
\end{tikzpicture}

\end{document}


Note that if you don't need the label above the right arrow, you can use a similar syntax to initial..., that is :

accepting by arrow, accepting text={}


-