Phil
Phil

Reputation: 3520

How to draw a set-enumeration tree with GraphViz?

I am looking forward to draw a set-enumeration tree using GraphViz, which should look like this:

Image of graph

Can it be easily done using GraphViz? Is there any existing graphviz examples to produce such a tree?

Upvotes: 0

Views: 343

Answers (1)

stefan
stefan

Reputation: 3759

A completly naive approach works near perfect. If for some reason graphviz does mess up horizontal ordering there is no real solution.

digraph {
 node [shape=plaintext]

 "{}" -> "{1}"
 "{}" -> "{2}"
 "{}" -> "{3}"
 "{}" -> "{4}"

 "{1}" -> "{1,2}"
 "{1}" -> "{1,3}"
 "{1}" -> "{1,4}"

 // ...
}

gives

enter image description here

Upvotes: 1

Related Questions