Possible Duplicate:
Typesetting a directed, weighted graph with TikZ

I would like to draw a DAG - Directed acyclic graph. How can I do this?

marked as duplicate by Roelof Spijker, Werner, egreg, Joseph Wright Dec 18 '11 at 7:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Have a look at the packages TikZ and pstricks. You will find much information and examples in the web. For example: tug.org/PSTricks/main.cgi?file=examples or texample.net/tikz/examples – Marco Daniel Dec 17 '11 at 11:44
  • 1
    If you decided which package you prefer, and if you then have a problem in creating the drawing, you could edit your question and show to us what you have tried, so we could help you to improve that. – Stefan Kottwitz Dec 17 '11 at 11:49
  • I'd go with the TikZ package and its automata and positioning libraries.:) – Paulo Cereda Dec 17 '11 at 11:54
  • 3
    For a possible solution see this question. – Thorsten Donig Dec 17 '11 at 12:01
  • Also, you might consider using metapost. – mbork Dec 17 '11 at 12:18

A solution with tkz-graph based on TikZ. You can used the styles from TikZ but you need to learn another syntax (very minimal) and you can use TikZ.

An advantage is that you can use scale without difficulty.


    \tikzstyle{VertexStyle} = [shape            = ellipse,
                               minimum width    = 6ex,%

    \tikzstyle{EdgeStyle}   = [->,>=stealth']      

    \Vertex{11}  \NO(11){5}   \WE(11){2} \SO(11){7} \EA(11){10}
                 \SOEA(11){9} \SOEA(10){3}\SOEA(9){8}
    \Edges(5,11,10) \Edges(3,8,9) \Edges(7,11,2)
    \Edges(11,9)    \Edges(3,10)

The first example of your link gives

enter image description here

  • 4
    that is what some people like: that others do all the work ... – user2478 Dec 17 '11 at 14:17
  • 9
    @Herbert I read your comment as criticism of both Altermundus and Filipe... but I would like to stress that without the answer of Altermundus, I would not have known about tkz-graph and its potential for simplifications (and I am probably not the only one). Considering that Altermundus himself is the author of tkz-graph (unless I am mistaken), I would judge that his answer is a win-win-situation for him and Filipe. – Christian Feuersänger Dec 17 '11 at 20:41
  • Thanks for the help! But I'm with trouble to print in pdf, I just can print it into DVI? – Filipe Ferminiano Dec 17 '11 at 21:28
  • @FilipeFerminiano Use comments, not answers, please. – Harold Cavendish Dec 17 '11 at 21:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.