September 24, 2011
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | \documentclass {article} \usepackage [papersize={85mm, 20mm}, text={75mm, 15mm}]{geometry} \usepackage {pgf, tikz} \usetikzlibrary {arrows,automata} \begin {document} \begin {figure}[h] \footnotesize \centering \begin {tikzpicture}[ % type of arrow head & gt ;=stealth', % keep arrow head from touching the surface shorten & gt ;= 1pt, % automatic node positioning auto, % node distance=1.5cm, % line thickness semithick, % text for the initial state arrow. I left it as blank initial text=] \tikzstyle {every state}=[draw=blue!50, thick, fill=blue!20, minimum size=4mm] \node [state] (v1) {$v_1$}; \node [state] (v2) [right of=v1] {$v_2$}; \node [state] (v3) [right of=v2] {$v_3$}; \node [state] (v4) [right of=v3] {$v_4$}; \node [state] (v5) [right of=v4] {$v_5$}; \path [-& gt ;] (v1) edge (v2); \path [-& gt ;] (v3) edge (v4); \path [-& gt ;] (v4) edge (v5); \path [-& gt ;, bend right, bend angle = 5] (v2) edge (v5); \path [-& gt ;, bend left, bend angle = 25] (v1) edge (v3); \end {tikzpicture} \end {figure} \end {document} |
Comments Off on directed graph