PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : OBDDs mit TiKZ



misterjan
18-05-2008, 13:46
Hallo,
für eine Seminarausarbeitung erstelle ich mit dem Paket TiKZ ordered binary desision diagrams (OBDDs). Ein Beispiel ist das Folgende:



\begin{tikzpicture}
[level 1/.style={sibling distance=30mm},
level 2/.style={sibling distance=20mm}]
\node[circle,draw] (z) {z}
child {node[circle,draw] (x1) {x} [dashed]
child {node[circle,solid,draw] (y1) {y} [dashed]}
child {node[circle,solid,draw] (y2) {y} [solid]
child {node[rectangle,solid,draw] (0) {0} [dashed]}}}
child {node[circle,draw] (x2) {x}
child {node[circle,draw] (y3) {y} [dashed]
child {node[rectangle,solid,draw] (1) {1} [solid]}}
child {node[circle,draw] (y4) {y}}};
\draw[dashed] (y1) -- (0);
\draw[solid] (y1) -- (1);
\draw[solid] (y2) -- (1);
\draw[dashed] (y3) -- (0);
\draw[solid] (y4) -- (0);
\draw[dashed] (y4) -- (1);
\end{tikzpicture}


Dafür brauche ich jetzt noch eine Erweiterung derart, dass links neben jeden Knoten noch eine Beschriftung der Form "#x" mit x \in N. Weiß jemand wie so etwas erreiche?

Spindoctor
18-05-2008, 17:08
Hab noch nicht mit TikZ geareitet, aber hier machen sie glaub ich sowas ähnliches...
http://www.statistiker-wg.de/pgf/tutorials/mindmap.htm

misterjan
19-05-2008, 18:43
Vielen Dank! Dort habe ich genau die Information gefunden die ich brauchte. Vollständig sieht mein OBDD jetzt wie folgt aus:



\begin{tikzpicture}
[level 1/.style={sibling distance=33mm},
level 2/.style={sibling distance=23mm}]
\node[circle,draw] (z) {z}
child {node[circle,draw] (x1) {x} [dashed]
child {node[circle,solid,draw] (y1) {y} [dashed]}
child {node[circle,solid,draw] (y2) {y} [solid]
child {node[rectangle,solid,draw] (0) {0} [dashed]}}}
child {node[circle,draw] (x2) {x}
child {node[circle,draw] (y3) {y} [dashed]
child {node[rectangle,solid,draw] (1) {1} [solid]}}
child {node[circle,draw] (y4) {y}}};
\draw[dashed] (y1) -- (0);
\draw[solid] (y1) -- (1);
\draw[solid] (y2) -- (1);
\draw[dashed] (y3) -- (0);
\draw[solid] (y4) -- (0);
\draw[dashed] (y4) -- (1);
\node[left] at (z.west) {$\#$5};
\node[left] at (x1.west) {$\#$2};
\node[left] at (x2.west) {$\#$4};
\node[left] at (y1.west) {$\#$2};
\node[left] at (y2.west) {$\#$2};
\node[right] at (y3.east) {$\#$2};
\node[left] at (y4.west) {$\#$3};
\node[left] at (0.west) {$\#$0};
\node[right] at (1.east) {$\#$1};
\end{tikzpicture}