TeX - LaTeX Asked by KaneM on August 15, 2020
I have the tikz diagram below and I am trying to change the white nodes into arrows from the parent node.
Here is the current diagram
Here is what is a rough sketch of what I am trying to make:
I have posted what I have so far below. Any help in making this would be very much appreciated
documentclass[11pt]{report}
usepackage{tikz}
begin{document}
begin{tikzpicture}[level/.style={sibling distance=90mm/#1},scale=0.7]
node [circle,draw,fill=gray,scale=0.7] (z){$s_0$}
child {node [circle,draw,scale=0.7](d){$a_1$}
child {node [circle,draw,fill=gray,scale=0.6] (a) {$s_1'$}
child {node {$vdots$}}edge from parent node[left=4mm] {small{$r=10$}}edge from parent node[ fill=white] {tiny{$1$}}
}
}
child {node [circle,draw,scale=0.7] (a) {$a_2$}
child {node [circle,draw,fill=gray,scale=0.6] (b) {$s_2'$}
child {node {$vdots$}}
child {node {$vdots$}}edge from parent node[ above=0.2mm, left=3mm] {small{$r=20$}}edge from parent node[ fill=white] {tiny{$0.5$}}
}
child {node [circle,draw,fill=gray,scale=0.6] (g) {$s'_3$}
child {node {$vdots$}}
child [grow=right] {node (q) {s'} edge from parent[draw=none]
child [grow=up] {node (r) {a} edge from parent[draw=none]
child [grow=up] {node (s) {$s$} edge from parent[draw=none]}}
}edge from parent node[ above=1mm, right=2mm] {small{$r=75$}}edge from parent node[ fill=white] {tiny{$0.5$}}
}
}
;
end{tikzpicture}
end{document}
You can add ->,level 2/.style={-}
to the options of your tikzpicture environment to draw an arrow to the first child level.
documentclass[11pt]{report}
usepackage{tikz}
begin{document}
begin{tikzpicture}[
level/.style={sibling distance=90mm/#1},
->,
level 2/.style={-},
scale=0.7]
node [circle,draw,fill=gray,scale=0.7] (z){$s_0$}
child {node [circle,draw,scale=0.7](d){$a_1$}
child {node [circle,draw,fill=gray,scale=0.6] (a) {$s_1'$}
child {node {$vdots$}}edge from parent node[left=4mm] {small{$r=10$}}edge from parent node[ fill=white] {tiny{$1$}}
}
}
child {node [circle,draw,scale=0.7] (a) {$a_2$}
child {node [circle,draw,fill=gray,scale=0.6] (b) {$s_2'$}
child {node {$vdots$}}
child {node {$vdots$}}edge from parent node[ above=0.2mm, left=3mm] {small{$r=20$}}edge from parent node[ fill=white] {tiny{$0.5$}}
}
child {node [circle,draw,fill=gray,scale=0.6] (g) {$s'_3$}
child {node {$vdots$}}
child [grow=right] {node (q) {s'} edge from parent[draw=none]
child [grow=up] {node (r) {a} edge from parent[draw=none]
child [grow=up] {node (s) {$s$} edge from parent[draw=none]}}
}edge from parent node[ above=1mm, right=2mm] {small{$r=75$}}edge from parent node[ fill=white] {tiny{$0.5$}}
}
}
;
end{tikzpicture}
end{document}
Answered by luki on August 15, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP