0

I'm looking for the way to draw such a diagram as http://mitpress.mit.edu/sicp/full-text/book/ch3-Z-G-35.gif, http://mitpress.mit.edu/sicp/full-text/book/ch3-Z-G-49.gif, http://mitpress.mit.edu/sicp/full-text/book/ch3-Z-G-51.gif, named after signal-flow diagram in SICP. I've tried some methods, but failed. I'm waiting for your help.

I've tried graphviz and written the following code. I want to get a diagram for the stream of Fibonacci sequence.

digraph G {
    add [shape = box];
    cons_1 [shape = box, label = "cons"];
    cons_2 [shape = box, label = "cons"];
    fibs [shape = point];
    Efibs [shape = point];
    single_0 [shape = none, label = "0"];
    single_1 [shape = none, label = "1"];
    subgraph cluster_0 {
        add -> cons_1 -> Efibs -> cons_2 -> fibs;
    }
    single_0 -> cons_1 [style = dotted];
    single_1 -> cons_2 [style = dotted];
    Efibs -> add;
    fibs -> add;
}

But the result is awkward. Is there any simple tool (I prefer WYTIWYG) or tutorial to draw this kind of diagram?

Thanks a lot.

Yai0Phah
  • 433
  • 4
  • 14

1 Answers1

0

If you are comfortable with LaTeX the TiKz package can produce nice diagrams. Although if you haven't used it before it probably isn't worth learning just for this.

dshepherd
  • 4,989
  • 4
  • 39
  • 46
  • Thanks. Some days before, I learnt TiKz and pictured some flow charts. Now I'm starting to read TAOCP. – Yai0Phah Jul 27 '12 at 03:46